androidclonecloneable

Clone an android application programmatically


There are some Android applications which allow user to clone existed application on the phone. eg: http://fixoptimize.com/app-cloner Can you explain how these cloners work? Thank you.


Solution

    1. Change the package name in AndroidManifest.xml and re-sign the app. Notice that the xml is binary instead of text in an apk package. Android identify different apps with package name and with package name changed an app would be considered a "new one".
    2. While the simple approach may or may not work (e.g. the app assumes its package name to be constant, or checks its signature) in many cases various other changes should be applied, including also chage the java package name, disable signature check, change string literals which are assumed path names containing a package name. All these would (likely) require decompiling and deassambling dex and even native codes, which is not only hard but illegal as well.
    3. The modern way: Sandboxify the app. A sandbox environment would be created, within which the app being "cloned" is not actually cloned and remains unchanged. The sandbox would intercept all communication between the cloned app and the system, the user and other apps so it's transparent and stable. Neither the app nor the user would notice that the app's being sandboxed. And this most likely keeps legal concerns away unless a emulator is also outlawed. There are open source sandbox apps on github that you could examine and, well, copy.