samedi 4 mars 2017

How to use EMUI’s App Twin Feature on any Launcher

A few days ago, I shared a tutorial outlining how to use EMUI's App Twin feature with any installed application or game on your device.

If you own a Huawei or Honor device that is on Android 7.0 Nougat with EMUI 5 (such as the Huawei Mate 9 family, Huawei P9/P9 Lite, Honor 6X, or Honor 8), then you may have found that tutorial useful. While it's certainly a neat workaround solving an unnecessary restriction put in place by Huawei/Honor, there was another restriction on the feature that I felt was silly.

Even with the instructions outlined in that tutorial that bypassed the worst offender hindering the App Twin feature, you still had to deal with the fact that App Twin only works with the stock EMUI launcher. Unsatisfied with this big asterisk placed on my tutorial, I wanted to see if there was a way around this. Fortunately, there is.

I discovered that cloned applications are not sandboxed applications, and can in fact react to regular Android intents targeting the original applications' activities. For example, when I tried to share a link from Chromium to Reddit is Fun, I was met with the "complete action using" dialog asking me to pick between the original app and the cloned app.

What this means is that the cloned application can be launched through sending an intent targeting the application's main activity. After all, if Chromium can do it, why can't we?

It is in fact fairly simple to do this using something like this, allowing us to launch cloned applications from any third-party launcher of our choice. Using an Intent/Shortcut maker such as Intent or Start Intent from the Play Store, we can make shortcuts to open the "complete action using" chooser.

Although these applications are free, they require you to know the name of the main activity/component which you can glean from either logcat or by looking at the AndroidManifest. Hence, due to the difficulty associated with figuring out the proper activity to target, I will instead show you how to do this using Tasker.

App Twin in Nova Launcher

Note: this tutorial is pointless if you aren't using the App Twin feature. This tutorial will work with any cloned app using the feature, but by default EMUI only allows you to clone Whatsapp/Facebook or QQ/Wechat. If you want to clone other apps to use them in a third-party launcher, then you will need to follow my previous tutorial to do so.


Use the App Twin Feature on any Launcher

How this will work is simple. We will create a series of Tasks in Tasker, with each Task containing only one Action each: launching the main activity of each app in the App Twin list. When the activity is launched, it will open the dialog asking you to open the main activity of either the original app or your cloned app. We will place a shortcut to run each Task onto the home screen, such as in Nova Launcher, so we can unbind the App Twin feature from the EMUI launcher.

Open up Tasker and tap on the "Task" tab up top. Press on the + icon in the bottom right to create a new Task. Name the Task after the app that you've cloned. Once you're in the Task editing screen, add a new Action by tapping on the + icon in the bottom middle of the screen. Go to App –> Launch App and find the app that you've cloned. Long press on the app name to bring up a list of activities. Find something that looks like the Main Activity in the list and select that.

Note that there won't always be a "MainActivity" in this list. The activity that launches the main screen of an app can technically be named anything. For instance, the main Activity that launches Gmail is called "MailActivity." In case you're having trouble figuring out which one it is, don't worry, as you can find it by simple trial and error. Simply go back to the Task editing screen after you've picked an Activity and press the play button in the bottom left to test the Task. If you see a "complete action using" dialog pop-up, then you've got the right activity.

Finally, in order for Tasker to enable this Task to be added as a shortcut/widget on your home screen, we have to assign an icon to the Task. In the Task creation screen once again, press on the bottom-right hand corner icon (the one that looks like a grid of 9 blocks). You will see an "Image Select" dialog pop-up. If you have a custom icon you want to use, you can select "Local Media", otherwise I recommend tapping on Application Icon so you can just use the application's default icon.

That should be it for this Task. Repeat this process for all of the other cloned applications that you want added to your third-party launcher.

Once you've done that, it is very simple to add this Task to your home screen. Simply bring up the widget creation menu of your launcher (usually a long-press on an empty area) and look for the Task shortcut under the Tasker widget list. Tap on that and then pick the Task that you created earlier. You'll have to repeat this for each cloned app that you want.

And that's it! Now you can enjoy EMUI's App Twin feature, with any app of your choice on any launcher of your choice. Both of Huawei/Honor's attempts at limiting the exclusivity of this feature are now rendered moot. Let's just hope this doesn't get patched out in a future update!


If you own a Huawei/Honor device on EMUI 5.X, try this out and let us know if it works for you!



from xda-developers http://ift.tt/2mZu3HX
via IFTTT

Aucun commentaire:

Enregistrer un commentaire