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