App screen indicators

Starting with App Cloner 1.5.31 you will no longer see a confirmation dialog when cloning apps installed as App Bundles. Instead, the app screen will show an App Bundle indicator, which lets you know that this app is installed as a Google Play App Bundle.

If you experience any issues with cloning App Bundle apps, it’s still recommended to try cloning the standalone version instead, which you can download from apkmirror.com or apkpure.com. You can do this directly from the APKs tab in App Cloner. If you don’t see the APKs tab, you may need to enable it first by tapping the folder icon.

Alternatively, tap the App Bundle indicator to search for the app directly on apkmirror.com, apkpure.com or the web.

You may also see two further indicators on the app screen: OBB and LIB.

If you see the OBB indicator the app (or game) uses expansion files, which are additional resource files typically used by games to store graphics or media files. The cloned app won’t be able to download these files itself from the Google Play store and probably won’t work without them. You can either copy these files manually before running the clone or you can upgrade to the premium version of App Cloner to automatically copy expansion files during the cloning process. You can tap the OBB indicator to see additional information and to enable Preserve expansion files, which may help if the game has problems loading its resource files.

If you see the LIB indicator it means the app uses native libraries. Normally, native libraries are also processed during the cloning process. However, sometimes this may cause crashes when launching the cloned app or game. If you see a crash notification asking you to enable the Skip native libraries option, or, if the clone crashes without any message, you should tap the LIB indicator and enable Skip native libraries and clone the app again. You can also enable Skip native libraries under Cloning options.

Google logins in cloned apps

As mentioned in App Cloner and on https://appcloner.app, Google account logins will not work in cloned apps.

The reason for this is that Google logins are facilitated by Google Play Services, which performs a certificate check of the cloned app against the API key used. When cloning an app the certificate changes as the APK must be signed using a new private key.

If the app or game offers another login method such as Facebook, Twitter, email or SMS login, please use the alternative login method instead.

Problems with notifications

Sometimes it happens that notifications do not work in cloned apps, especially when the cloned app is in the background. Some Android devices use aggressive memory management methods, freeing up as much RAM as possible by killing apps when in the background. Depending on the device, this may also affect persistent background services used for delivering new message notifications.

What you should try here is to exclude the clone from any battery optimizations in the Android system settings as this may keep the app’s background services alive.

Using the Launching option Request ignore battery optimizations you can create clones that will automatically prompt to be added to the ignore list.

You can also try to use the option Persistent app to keep the app alive even when in the background. You should remember that persisting apps may reduce the available RAM memory, especially when creating many clones, which might have a negative impact on other apps or system performance in general.

However, sometimes notifications simply don’t work in clones, as in the case with Skype. This may be because of the internal method used to deliver notifications from the server-side components to the app, which may break for modified app certificates or package names (which is often used as an app’s unique identifier).

Device locking

All clones are device-locked by default. This means if you create a clone on one device, it cannot be used on another device. This is to prevent distribution and abuse of clones. This also happens when using the premium version of App Cloner.

The simplest way to get the clone working on another device is to install App Cloner on the other device itself and create a new clone locally. You can always export and import the clone settings used for a particular app.

However, if you want to create a clone for a specific target device, e.g. a friend or family member, then please use the Device lock option, which you can find under Launching options, pasting the correct target device identifier into the dialog. The device identifier is shown in a dialog when trying to open the clone on another device. On smaller devices you may need to scroll down inside the dialog to see the device identifier.

On Android 8.0 or higher do not use the Device ID shown under App Cloner Settings > Device info. Starting with Android 8.0 each app gets its own device identifier, so to find the correct device identifier you must first launch the clone without the Device lock option enabled.

You can also use the Device lock option to paste multiple, comma-separated identifiers, which allows a single clone to run on multiple devices.

The Commercial use donation removes device locking, so you can create clones that run on all devices. However, you are not allowed to distribute clones outside of your company, unless they are your own apps or you are the copyright holder. Please see the App Cloner Terms of Use at https://appcloner.app/terms/.

Layout inspector

App Cloner 1.5.25 comes with a new tool called Layout inspector, which allows visualizing the view hierarchy of cloned apps. You can access it from the pop-up menu under the Cloned apps tab.

Views are shown in a hierarchical tree, where you can tap the nodes to expand or collapse view groups (parent views that contain child views). Each node shows the view’s class name, e.g. LinearLayout, TextView, Button, etc. If a view has an identifier, it will be shown after the @ symbol. If a view has text (e.g. TextView, EditText or a text button), the text is shown in quotes. If a view is hidden or disabled you will see the Hidden or Disabled tags accordingly.

A DecorView represents the top of a view hierarchy. When an app is showing multiple windows or dialogs, you will have multiple top-level DecorView nodes. If the tree is completely empty, it means the app isn’t showing any activities or windows (you will probably need to launch the clone first).

The pop-up menu shown for each node allows the performing the following actions:

  • Highlight
    Marks the view in yellow, so it can be spotted easily inside the cloned app.
  • Show
    Shows the view. Hidden views only.
  • Hide
    Hides the view. Visible views only. Requires the Medium donation.
  • Enable
    Enables the view. Disabled views only.
  • Disable
    Disables the view. Enabled views only.
  • Check
    Allows selecting check-boxes, toggles or radio buttons. Checkable unchecked views only.
  • Uncheck
    Allows deselecting check-boxes, toggles or radio buttons. Checkable checked views only.
  • Click
    Sends a click event to the view (emulates a tap).
  • Focus
    Requests the view to receive focus.
  • Copy class
    Copies the view class to the clipboard. Useful for the Modify views option.
  • Copy identifier
    Copies the view identifier to the clipboard. Useful for the Modify views option.
  • Copy text
    Copies the view text to the clipboard. Text views only.
  • Edit text
    Allows editing the current view text. Text views only.

Note that any modified views may be quickly overwritten or reset by the cloned app. Especially when modifying views inside scrolling lists, the views are likely going to be replaced as soon as you scroll the list or when the app refreshes the list’s data. If you receive the message ‘Action was not performed’, the view hierarchy may no longer be valid. In this case tap the Refresh button in the toolbar to reload the view tree.

You may use the Search button to enter a search query. This will expand the tree and highlight any views whose class, identifier or view text contain the query text.

You can use the toolbar’s pop-up menu to expand or collapse all tree nodes or to clear any Highlight actions. In case the tree view contains deeply indented nodes, you can also scroll it horizontally.

Send broadcast on start

Send broadcast on start is a developer option, which sends an arbitrary broadcast when the cloned app is started. The broadcast is sent as soon as the app’s process is started, before any app activities may (or may not) be shown. This means the broadcast will also get sent when the cloned app starts any background services. The broadcast’s intent is empty and does not have any action nor intent extras set.

You need to specify the the broadcast receiver’s fully qualified component name in the form of <packageName>/<className>. Do not use the abbreviated form of <className>. When declaring the broadcast receiver in the manifest, make sure to mark it exported.

You may also use this option along with the Shared user ID and Process name options to trigger loading an external extension app into the same process as the cloned main app.

Shared user ID & Process name

App Cloner 1.5.22 adds two new developer options called Shared user ID and Process name.

The Shared user ID option allows generating clones with a specific shared user ID, an arbitrary string value, which must contain at least one ‘.’ separator. Apps with the same shared user ID can access each other’s data and, if desired, run in the same process, provided the apps are also signed with the same certificate.

The Process name option forces all app components to run in the named process. The process name must start with a lower case character and must also contain at least one ‘.’ separator.

This allows creating your own add-ons in separate apps, extending the clone’s functionality.

By signing the clone using a custom certificate (using the Custom certificate option) and creating your own app using the same shared user ID, process name and certificate, the clone and your app will run in the same process and virtual machine (VM).

Each app is executed using its own class loader, which loads classes from the corresponding APK .dex files, so a simple Class.forName("...") won’t work. To access the cloned app’s classes via reflection you must enumerate all threads, find the thread called ContextClassLoaderThread, which is provided by App Cloner, and use its context class loader to load the app’s classes.

Here’s an example in Kotlin:

val threads = arrayOfNulls<Thread>(Thread.activeCount())
Thread.enumerate(threads)
for (thread in threads) {
    if ("ContextClassLoaderThread" == thread!!.getName()) {
        val contextClassLoader = thread.getContextClassLoader()
        val clazz = contextClassLoader.loadClass("...")
        // TODO: Do something with the class
        break
    }
}

If the ContextClassLoaderThread thread cannot be found it means the clone hasn’t yet been launched into the process.

In order to get the cloned app’s Application instance you can use the Utils class provided by App Cloner:

val utilsClass = contextClassLoader.loadClass("com.applisto.appcloner.classes.Utils")
val getApplicationMethod = utilsClass.getMethod("getApplication")
val application: Application = getApplicationMethod.invoke(null) as Application

Once you have the Application instance you can register ActivityLifecycleCallbacks to get notified when the cloned app appears on the screen:

application.registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityResumed(activity: Activity) {}
override fun onActivityPaused(activity: Activity?) {}
override fun onActivityDestroyed(activity: Activity?) {}
override fun onActivitySaveInstanceState(activity: Activity?, outState: Bundle?) {}
override fun onActivityStopped(activity: Activity?) {}
})

The Shared user ID option is available with the medium donation, the Process name option is available with the large donation.