Android Question keep password in app

omidaghakhani1368

Well-Known Member
Licensed User
Longtime User
Hi.
How i use password in basic4android without anyone see my password in code?

example i declare
Dim pass as string
pass = "111111"

now if anyone extract apk file with apk tool and can see my password in java class file

is there any solution?
 

Peter Simpson

Expert
Licensed User
Longtime User
Hello @arminkh,
Why don't you just save the key in a RandomAccessFile and then use
B4X:
Raf.WriteEncryptedObject
and
B4X:
Raf.ReadEncryptedObject
 
Upvote 0

ArminKH

Well-Known Member
@Peter Simpson
Thank u
But again for decrypt encrypted object we need a password
Which place is safe for store this password?
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
RandomAccessFile is a safe place to store a password. Just use MD5 or SHA-1 encryption to encrypt the password then store the encrypted password into the password protected RAF. You are making it harder than it actually need to be...
 
Upvote 0

ArminKH

Well-Known Member
@Peter Simpson
Iknow that but when some body decompile my app then they has full access to my original key or any key for decrypt or any algorithms
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
@arminkh everything is hackable/crackable, nothing is safe and there's absolutely nothing you or I can do about it. Listen if Facebook, Twitter, Apple, Adobe, the Pentagon and NASA can all get hacked into just to name a few, then there absolutely nothing you, I, anybody on the forum and yes that even includes @Erel can do to stop it from happening. So I suggest that you do the best that you can to protect your app and get on with your Android project.

Basically what I'm saying is that if a half decent hacker/cracker really want to get in to see the basics of your Android apps source code, then nothing will stop them. I've learn from from the fact that my best selling Windows program has both been cracked(no unlock code needed) and there's also a keygen for it out there too. Changing the formula is a waste of time as all you have to do is request that is get cracked again and within a month it is done and a new keygen is released. I gave up attempting to stay one step ahead of keygen creators years ago. I now just concentrate on making my products better for my customers...
 
Last edited:
Upvote 0
Top