Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The code to do this is actually just a very clever work around. </p> <p>When a component with </p> <pre><code> &lt;category android:name="android.intent.category.HOME" /&gt; </code></pre> <p>is enabled, generally from an install of a new home application, the default home app gets cleared. </p> <p>To take advantage of this by creating an empty activity with the home component like this. </p> <pre><code>&lt;activity android:name="com.t3hh4xx0r.haxlauncher.FakeHome" android:enabled="false"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.HOME" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>When you want to set your new default, you enable this component, then call the home intent and then disable your fake home component again.</p> <pre><code>public static void makePrefered(Context c) { PackageManager p = c.getPackageManager(); ComponentName cN = new ComponentName(c, FakeHome.class); p.setComponentEnabledSetting(cN, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); Intent selector = new Intent(Intent.ACTION_MAIN); selector.addCategory(Intent.CATEGORY_HOME); c.startActivity(selector); p.setComponentEnabledSetting(cN, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } </code></pre> <p>The end result is that the system thinks a new home app was installed, so the default is cleared allowing you to set yours with no special permissions.</p> <p>Thank you to Kevin from TeslaCoil and NovaLauncher for the information on how this is done!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload