Android Question Assest Folder Files Security

selvamurali

Active Member
Licensed User
Longtime User
Dear Team .

i have many html file or text files in my local assest folder. i need to add security for that files. that is when user decompile the apk the files not showed. how to do this .
 

JOANORSKY

Member
Licensed User
Longtime User
So.. but is there any way i can encrypt the files directly on my PC without the need to encrypt them on the application itself? My purpose is to encrypt the files in assets folder on a PC and then import them to the B4A. I need this because i have many files as assets that i don't users to extract without a license. The idea to encrypt the files from within the program itself and them extract those files to later import as assets seem to me a lot of work.. specially when i have some programs with 4000+ text files.. :\

Is there any way i can protect the assets from extraction? :|
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Yes, you can encrypt the files in the PC. You will need to then decrypt them at runtime.

The encryption library supports all kinds of standard encryption methods.

Another option is to create a small Android program that will encrypt the files with one of the "simpler" methods and then copy the files to the PC and add them to the main program.
 
Upvote 0

JOANORSKY

Member
Licensed User
Longtime User
I see... i will try to make a encryption test. I will give feedback if i find difficulties..

As always.. your comments are always very helpful Erel.. Thank you so much!
 
Upvote 0

JOANORSKY

Member
Licensed User
Longtime User
Ok.. i must for help again! Can anyone supply me a example code .. on how to read a assets file (any file.. for instance a "file.pdf").. and save it encoded by using the raf.WriteEncryptedObject command? How can it be decoded in order to make a hardcopy after it has been coded (i mean.. to decode the coded file and save it in a uncoded state so that it can be read again with the native reader, as in this case, Acrobat PDF reader)?

I have tested it on my assets directory with PDF files.. but all i can do is to save a useless file that, although encrypted, does not have the original content inside (i know this for a fact because the size is much smaller on the encrypted file). I must be doing something wrong while reading the original file... but i just don't know what, so a example would like a cherry on top of a cake.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…