문제

I want to protect a lot of my png and JPEG (actually in the drawable folder), because it's very easy to decompile an APK and take the images.
How can I make another coded folder and set android:src for ImageView in XML layouts?
Thanks

도움이 되었습니까?

해결책

For this you should have to encrypt the image using linear algebra techniques. convert your image in matrix and then reverse this mat for encryption or you have many techniques to encrypt this mat.Some thing like this.

    public byte[] getBytesFromBitmap(Bitmap bitmap) {
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    bitmap.compress(CompressFormat.JPEG, 70, stream);
    return stream.toByteArray();
}

hope this will help.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top