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

Discussion in 'Android Questions' started by somed3v3loper, Jul 21, 2019.

  1. somed3v3loper

    somed3v3loper Well-Known Member Licensed 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
     
  2. Erel

    Erel Administrator Staff Member Licensed 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.
     
    somed3v3loper likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice