I'm working in some game portal catalog (kind of a PlayStore) based on a subscription model. I have a partnership with some editor that can provide me some game apks. But not their sources codes. So I have rights to modify stuff about them but I havn't the code.
Here is what I want to do, and need you to tell me if you think:
- it's possible this way
- it's good way of doing it
- If there is a better way, what is it
So, my goal is to make a wrapper that will allow me to:
- pop a webview to my game portal
- get the UID of the user and send it to the game portal
- be able to get a callback from the web portal (with javascript)
- Register locally information about user rights (like a status, and an "end subscription date") and check them at launch
Adding to this all sort of logic like, "if I get this reponse from the game portal callback, then I close the webview".
This is how I think doing it:
- Taking a game in which I have source code
- Write all the code requested above in Java, putting everything in one single class
- Set up all calls in methods that will always exists in every APK(mainactivity - onCreate() for example)
- Compile my apk
- Decompile my apk with a tool like APK Studio that will produce some readable SMALI code
- Spot the code part that correspond to my wrapper (by differencing the classic compiled/decompiled apk with the one in which I added the wrapper)
- Copy this code part into an other classic compiled/decomplied APK
- Recompile the APK
So I know that I can do everything in the Java part, but I want to be sure that it will be possible to make the "SMALI trick" that I want to use.
Thanks in advance :)
EDIT: I've been wondering, wouldn't it be better for me to create a new Activity that will replace the MainActivity in the smali file and start the real MainActivity throught an Intent call ?