Android Question how code generators/valditors generate/accept different codes

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Hello all ,

I hope my question is clear .
I have 2 apps :

App (A) When run , generate a user id
App (B) Gets the user id that was generated in App (A) and make an activation code
APP (A) When entering the activation code generated in App (B) , gets unlocked

I made a working (probably stupid ) projects but I have one more requirement : I want to generate more than one code that can work
for example If App (A) generated UID12345 , I want App (B) to generate ACT12345 , ACT98765 ... etc that all should unlock the App (A)

Regards
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If you are fine with including a "secret key" in the apps then you can encrypt the value: (user id & "," & random number) in App B. The activation code is the first x characters of the base 64 string with the random number.

In App A you can encrypt the same value and check whether it starts with the same bytes.

However for a more secured solution you should use a server. With local apps it will not be too complicated to get the keys from the compiled code.
 
Upvote 0
Top