BaronKiko / LauncherHijack

For Amazon Fire Tablets and TV's
GNU General Public License v3.0
353 stars 61 forks source link

5 second delay after hitting the home button #64

Open cgf1 opened 4 years ago

cgf1 commented 4 years ago

After the latest update for Fire OS on my HD 10 2017, there is a five second delay when hitting the home button. LIkely it's due to this android feature:

https://stackoverflow.com/questions/5600084/starting-an-activity-from-a-service-after-home-button-pressed-without-the-5-seco

The code already uses one of the methods mentioned. Converting it to use the alarm method mentioned doesn't work any better.

Zeviral commented 4 years ago

I am having the same problem. Not sure what to do.

cgf1 commented 4 years ago

I ended up just rooting the device, enabling an alternate launcher, and disabling firelauncher as well as any OTA updates.

This rooting method worked for me: https://forum.xda-developers.com/hd8-hd10/general/hd-10-2017-offline-rooting-t3734860

From extensive googling it does seem like maybe there is a way to work around this by hooking the home key in a different way but it might not be completely reliable.

jsclary commented 4 years ago

For me, the following works without rooting from a PC with adb installed:

adb shell pm disable-user --user 0 com.amazon.firelauncher

It disables the user account for firelauncher which prevents it from running entirely. I do the same for the appstore (com.amazon.venezia) which makes google play store links work.

There are no side effects that I've noticed but it will probably get re-enabled on the next OTA update and you'll have to run the command again. If necessary, you can re-enable it with:

adb shell pm enable --user 0 com.amazon.firelauncher

I've been trying to figure out a way to do it from within termux on the same device (mostly so I can use the appstore from time to time) but only the shell user seems to have rights to do that and I haven't figured out how to enable network debugging. I have done it successfully in termux on a separate kindle fire connected to the target one with an USB OTG cable but that won't help many people.

Disabling battery optimization for both LauncherHijack and your chosen launcher helps a bit, too. It makes it a bit less likely to get killed. You'll need ActivityLauncher or somethinig to launch the alternate version of Settings->Battery with the extra menu in the top right corner that's missing from Amazon's version.

kitzhu54 commented 4 years ago

For me, the following works without rooting from a PC with adb installed:

adb shell pm disable-user --user 0 com.amazon.firelauncher

It disables the user account for firelauncher which prevents it from running entirely. I do the same for the appstore (com.amazon.venezia) which makes google play store links work.

There are no side effects that I've noticed but it will probably get re-enabled on the next OTA update and you'll have to run the command again. If necessary, you can re-enable it with:

adb shell pm enable --user 0 com.amazon.firelauncher

I've been trying to figure out a way to do it from within termux on the same device (mostly so I can use the appstore from time to time) but only the shell user seems to have rights to do that and I haven't figured out how to enable network debugging. I have done it successfully in termux on a separate kindle fire connected to the target one with an USB OTG cable but that won't help many people.

Disabling battery optimization for both LauncherHijack and your chosen launcher helps a bit, too. It makes it a bit less likely to get killed. You'll need ActivityLauncher or somethinig to launch the alternate version of Settings->Battery with the extra menu in the top right corner that's missing from Amazon's version.

Is there a tutorial on using adb that I can look up? The launcherhijack apk I'm using keeps getting blocked from FireOS. Thanks in advance!

weipah commented 4 years ago

Is there a tutorial on using adb that I can look up? The launcherhijack apk I'm using keeps getting blocked from FireOS. Thanks in advance!

adb is a command line tool that comes with the Android SDK or Android Studio for example. You can find a lot documentation online. But for this specific problem the command given is acurate. It works on my Fire HD 8 without root.

Amaz0n blocking the LauncherHijack apk can be worked around only by building it yourself with another name or using an app cloner.

dragonfly1033 commented 4 years ago

when running the adb command I get an error: "Error: java.lang.SecurityException: Permission Denial: attempt to change component state from pid=xxxxx, uid=xxxx, package uid=xxxxx" any ideas as to why?

jsclary commented 4 years ago

when running the adb command I get an error: "Error: java.lang.SecurityException: Permission Denial: attempt to change component state from pid=xxxxx, uid=xxxx, package uid=xxxxx" any ideas as to why?

If you are using "disable-user" (not just "disable") and included the "--user 0" flag, something I frequently forget, it should work unless the permission has been disabled in the firmware. It still works with the latest update on my 2018 Fire HD 8 but I can't guarantee it'll work on any other model or firmware revision.

dragonfly1033 commented 4 years ago

Yh I typed it out word for word. And sorry I didnt mention before, my device is the Amazon Fire HD 8 on the latest 5.3.7 update although i have a 2017 model which may be the problem. Thank you for the quick reply anyway.

ghost commented 2 years ago

When I tried to disable fire launcher in fire toolbox it said in the console: Cannot Disable Protected Package.

How do I fix that? (My kindle is the HD 10 2021)

CategoryQ commented 2 years ago

I am also unable to do this - I have a Fire 8 HD (2020/10th gen model). The output from ADB is below.

Security exception: Cannot disable a protected package: com.amazon.firelauncher

java.lang.SecurityException: Cannot disable a protected package: com.amazon.firelauncher
    at com.android.server.pm.PackageManagerService.setEnabledSetting(PackageManagerService.java:21080)
    at com.android.server.pm.PackageManagerService.setApplicationEnabledSetting(PackageManagerService.java:20991)
    at com.android.server.pm.PackageManagerShellCommand.runSetEnabledSetting(PackageManagerShellCommand.java:1610)
    at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:201)
    at android.os.ShellCommand.exec(ShellCommand.java:103)
    at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21634)
    at android.os.Binder.shellCommand(Binder.java:634)
    at android.os.Binder.onTransact(Binder.java:532)
    at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2796)
    at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3963)
    at android.os.Binder.execTransact(Binder.java:731)

LauncherHijack still "works", albeit after recompiling with a different name, and the 5 second delay in loading the home screen (Nova Launcher in my case, if that makes any difference).

Still, the 5 second delay is worth it to avoid the default mess of a home screen!

Tazzzilo commented 2 years ago

I can confirm the delay and the "Permission Denial: attempt to change component state from" on Fire HD 8 with latest Fire OS 5.6.9.0