BaronKiko / LauncherHijack

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

4k Firestick Accessibility Commands Issue #52

Closed dashriprock007 closed 4 years ago

dashriprock007 commented 5 years ago

I have tried multiple times and installed 4.0.2/3 and the renamed ones

I can get them sideloaded no problem through adb but after I do the adb access commands I still get the error that they are not disabled...over and over again.

wilkovatch commented 5 years ago

That's because apparently (i hope I'm wrong) the latest Fire OS version prevents editing the values involved. Specifically, if you try to set _accessibilityenabled to 1, the value is set to 0 instead (if you put any other value it gets written correctly though), and if you try to edit _enabled_accessibilityservices any value you put gets completely ignored. You can try adb shell settings get on the values to see what happened. This happens even if LauncherHijack is not installed or a clone apk is installed instead, so the apk being on the blacklist is not the problem. (note: I tested it on a 2nd generation Fire TV Stick)

dashriprock007 commented 5 years ago

So this would mean this Hijack is dead? NO way to now use any other launcher but theirs? Sux

wilkovatch commented 5 years ago

Nothing prevents you from installing and running another launcher, but without LauncherHijack you cannot access it using the home button, which will take you to the Amazon launcher instead. Launch on Boot still works, so you can use it to open another launcher on boot/wake. Also, certain launchers (for example AppStarter) will not take you to the Amazon launcher when pressing the back button, so when using one of those you can just spam the back button when you want to leave an app instead of using the home button. Of course this is not a real solution, but it's the best that can be done given the current situation. (unless I'm missing something)

dashriprock007 commented 5 years ago

I dont see any option for launch on boot....where? in the specific Launcher? I like ATV Launcher

wilkovatch commented 5 years ago

Launch on Boot is a separate application, you have to install it (via apk or Google Play) then open it and select which application to launch on boot/wake.

dashriprock007 commented 5 years ago

Ill try that....it seems there is not way back to what we had here before correct?

wilkovatch commented 5 years ago

As far as I know there is currently no way to get LauncherHijack working: you can't downgrade Fire OS, and the latest version cannot be rooted, so no way to get rid of the Amazon launcher or to get the accessibility stuff working for LauncherHijack. Maybe the devs can get around this requirement by changing approach. (in the settings menu LauncherHijack has a setting to enable detecting when the Amazon launcher is opened, but it did not work for me) Note: I could be wrong, the devs can confirm or rectify what I said.

dashriprock007 commented 5 years ago

thanks.....very much a bummer.....all most a deal breaker on 4k stick over an Android Box

MrLinks75 commented 5 years ago

To comment on this also, it seems that on the 6.2.6.4 Software version, it is impossible to enable Launcher Hijack to perform the correct actions , since it constantly requires to enable the accessibility services. Tried for a good 3h on a Firestick 4K to make the Hijack happening.

El-Koder commented 5 years ago

Thanks wilkovatch. I've been banging my head against a brick wall for days trying to get this to work. My new Firestick 4K is on version 6.2.6.4 of Fire OS, and everything you've said checks out. There are many who have succeeded to get it working, but as far as I know you cannot prevent Amazon from updating Fire OS (I have all updating options switched off, yet it still does daily checks for and applies updates regardless), so all of those who've got Launcher Hijack working have their days numbered in Amazon's desperate arms race to control the Fire OS launcher. I can see why they engage in this arms race: advertising of paid content, spy device on your internet connection, voice data to add to your NSA profile. The extremely low price for the hardware specification now makes sense.

I currently use App Startup on Boot to specify the super customisable HA Launcher, however this only starts HA Launcher if you pull the power, or manually do a Restart. Normal Power On just brings the Firestick out of Sleep mode, and launches straight into the Amazon Launcher. You mentioned that Launch on Boot also works on wake, but this is not the case for me.

Which Launch On Boot app did you test this on?

Not the end of the world to do down, down, click every time I switch on, but probably gonna put it on a remote control power socket so it will be switched off when not in use., rather than letting Amazon, NSA, or whatever other damn Americans hack my network and connected devices whenever they want. Now wishing I went for an Android box, but of course the Firestick 4K price tempted me. Considering how little control we have over these devices, I'm not a happy customer at all. I'll be selling it once I can find a suitable replacement that doesn't cost a fortune.

dashriprock007 commented 5 years ago

I have found that Launch on boot does a decent job with ATV Launcher....I long press the home button and put it to sleep....but if you just press home and not power off the stick goes to sleep after the screensaver

Where do you turn off update functions? I dont see that anywhere

wilkovatch commented 5 years ago

Launch On Boot is available here, it has a setting to make it launch the app you selected on wake. Back on topic: after some tests I noticed that the accessibility settings do get written correctly when you edit them, but something overwrites them almost immediately. (about 50 milliseconds later) If the culprit is a non-essential system app maybe it can be disabled. Edit: that's probably done by Android itself to keep things tidy when there are no accessibility services enabled, see my last post instead.

El-Koder commented 5 years ago

I have found that Launch on boot does a decent job with ATV Launcher....I long press the home button and put it to sleep....but if you just press home and not power off the stick goes to sleep after the screensaver

Where do you turn off update functions? I dont see that anywhere

Sorry, it was only turning off apps updating in the Amazon Appstore inside Settings > Appliactions.

I like ATV launcher also, especially as it prevents you from backing out unlike HA Launcher. And I much prefer the icons generated in ATV Launcher. However ATV Launcher only allows a single group/category: Applications. In HA Launcher, I have my own categories: Weather, Films, TV, Games, Launchers, Web, Apps, Tools which makes it much much easier to naviagte. I've managed to set a wallpaper on a Firestick 4K with great difficulty, and customised all the icon/text sizes and appearance. A royal pain to set it all up again though when I do a Factory Reset.

El-Koder commented 5 years ago

Thanks wilkovatch. I've already tried two others, but I'll try that now instead.

dashriprock007 commented 5 years ago

ATV Allows you to make Folders....

El-Koder commented 5 years ago

ATV Allows you to make Folders....

Yes, but they are lumped in under Applications, so you have to navigate to them and then open them. In HA Launcher the Groups are just the next line of icons, one less click, plus all icons displayed out front instead of hidden inside a folder.

wilkovatch commented 5 years ago

Hold on, I found an exploit: the value getting immediately overwritten with 0 is only accessibility_enabled, and that only happens when enabled_accessibility_services is empty. On the other hand, enabled_accessibility_services cannot be written only via adb, via application it gets written correctly, and stays like that. After that, you can write accessibility enabled too, and LauncherHijack works correctly. All you need is to write a tiny application that does this job and grant it via adb the permission com.android.permission.WRITE_SECURE_SETTINGS, since it's a system permission.

Edit: this job could also be done by LauncherHijack itself, then you would just need to grant it the WRITE_SECURE_SETTINGS permission instead of setting the accessibility variables manually.

MrLinks75 commented 5 years ago

Hold on, I found an exploit: the value getting immediately overwritten with 0 is only accessibility_enabled, and that only happens when enabled_accessibility_services is empty. On the other hand, enabled_accessibility_services cannot be written only via adb, via application it gets written correctly, and stays like that. After that, you can write accessibility enabled too, and LauncherHijack works correctly. All you need is to write a tiny application that does this job and grant it via adb the permission com.android.permission.WRITE_SECURE_SETTINGS, since it's a system permission.

Edit: this job could also be done by LauncherHijack itself, then you would just need to grant it the WRITE_SECURE_SETTINGS permission instead of setting the accessibility variables manually.

Hey, thanks for the intel, do you think this should be made as a standalone or maybe as an installator within the LauncherHijack app ?

wilkovatch commented 5 years ago

The easiest way is to make it standalone (so the LauncherHijack devs don't need to do anything), but I opened a pull request to include it into LauncherHijack. (it will require some more work to include it elegantly though)

wilkovatch commented 5 years ago

Ok, here is a quick and dirty solution:

Edit: before doing this first uninstall LauncherHijack if you have it still installed.

First install the cloned LauncherHijack apk from here

Then install the apk inside this zip (don't pay attention to its UI if it shows, it's just a template, the important part is that when it opens it configures the accessibility variables as needed)

Then grant it the required permission by running: adb shell pm grant com.example.settest.settingstest android.permission.WRITE_SECURE_SETTINGS

Then open the application (SettingsTest), after you do that, LauncherHijack should open automatically. (if it doesn't and it still complains when you open it then something did not work as intended)

After you're done you can uninstall SettingsTest.

dashriprock007 commented 5 years ago

Ok, here is a quick and dirty solution:

Edit: before doing this first uninstall LauncherHijack if you have it still installed.

First install the cloned LauncherHijack apk from here

Then install the apk inside this zip (don't pay attention to its UI if it shows, it's just a template, the important part is that when it opens it configures the accessibility variables as needed)

Then grant it the required permission by running: adb shell pm grant com.example.settest.settingstest android.permission.WRITE_SECURE_SETTINGS

Then open the application (SettingsTest), after you do that, LauncherHijack should open automatically. (if it doesn't and it still complains when you open it then something did not work as intended)

After you're done you can uninstall SettingsTest.

DUDE!! Awesome work. Much LOVE!!!

dashriprock007 commented 5 years ago

What are the correct setting in Launcher Hijack to have selected?

Overlay?

Launcher OPen detection?

wilkovatch commented 5 years ago

The defaults should be okay, but enabling those should not do any harm. (probably they make it detect cases where the amazon launcher opens without pressing the home button, such as after an app crashes, etc)

El-Koder commented 5 years ago

Ok, here is a quick and dirty solution:

wilkovatch, You are the Maan! Dude it works.

I had to reenter the adb command three times via the Firestick TV remote (phone died yesterday, and I already had Remote adb on the Firestick so stupidly began there, but now realise I should've done it from this computer). The joys of the day after the night before. Eventually got it. Bang!

Now the Firestick 4K is starting to look pretty snazzy.

Thanks bud.

dashriprock007 commented 5 years ago

Just checking, but now when I press and hold the Home button we do not get the sleep etc options we used to with normal Amazon Home....

we cant have both right??

wilkovatch commented 5 years ago

You can still get them by pressing menu before pressing home. (if the setting "disable while menu is held" is enabled in LauncherHijack)

dashriprock007 commented 5 years ago

You can still get them by pressing menu before pressing home. (if the setting "disable while menu is held" is enabled in LauncherHijack)

Grassy Ass!

El-Koder commented 5 years ago

Where do you turn off update functions? I dont see that anywhere

Here's how to disable Amazon Updates to your device... Method 3, configuring parental controls, or server filters... http://www.aftvnews.com/how-to-block-software-updates-on-the-amazon-fire-tv-or-fire-tv-stick/

El-Koder commented 5 years ago

Launch On Boot is available here, it has a setting to make it launch the app you selected on wake.

Thanks to wilkovatch we now have LauncherHijack working again for updated Firesticks. I had to uninstall HA Launcher and reinstall as it wasn't appearing in LauncherHijack as a Launcher. Once I did that everything started to come together.

My Home key is bound to my custom launcher HA Launcher, almost all of the time. Occasionally it fails and the Home key brings me back to the stock Amazon Home screen, but if I press the Home key again it launches my custom HA Launcher. I'm going to try to narrow down when this happens. I can access the Long Press Home functions using Menu and Home together. So far so good.

I'm using Launch On Boot to cover all other ways to avoid the stock Amazon Home screen, but it is not consistent.

I'm testing a few other Launch On Boot type apps.

I've also come across a method to corrupt the stock Amazon Launcher so that it literally cannot run at all The potential downfall with this is if your custom Launcher fails or locks up for any reason, then you could be in trouble with no Launcher, and no easy way to get one working again.

dashriprock007 commented 5 years ago

Where do you turn off update functions? I dont see that anywhere

Here's how to disable Amazon Updates to your device... Method 3, configuring parental controls, or server filters... http://www.aftvnews.com/how-to-block-software-updates-on-the-amazon-fire-tv-or-fire-tv-stick/

This really becomes hard for the 4k stick

dashriprock007 commented 5 years ago

Launch On Boot is available here, it has a setting to make it launch the app you selected on wake.

Thanks to wilkovatch we now have LauncherHijack working again for updated Firesticks. I had to uninstall HA Launcher and reinstall as it wasn't appearing in LauncherHijack as a Launcher. Once I did that everything started to come together.

My Home key is bound to my custom launcher HA Launcher, almost all of the time. Occasionally it fails and the Home key brings me back to the stock Amazon Home screen, but if I press the Home key again it launches my custom HA Launcher. I'm going to try to narrow down when this happens. I can access the Long Press Home functions using Menu and Home together. So far so good.

I'm using Launch On Boot to cover all other ways to avoid the stock Amazon Home screen, but it is not consistent.

* Launching custom HA Launcher from Boot/Restart (Hard Restart or Pull Power) works.

* Launching custom HA Launcher from Sleep (Screen Off/Wake?) doesn't work.

* Launching custom HA Launcher from Power Standby (Soft Restart/Not full Power Off) doesn't work.

I'm testing a few other Launch On Boot type apps.

I've also come across a method to corrupt the stock Amazon Launcher so that it literally cannot run at all The potential downfall with this is if your custom Launcher fails or locks up for any reason, then you could be in trouble with no Launcher, and no easy way to get one working again.

So far with both LauncherHijack and Launch on Boot.....ATV Launcher is almost flawless

I also wouldnt want the Amazon Home to be completely gone...I would think you risk bricking and not being able to recover. You could aslo screw up your ability to get to Prime Video as the app for that doesnt seem to work to get there on mine

s0ybean commented 5 years ago

Launcher hijack used to be 100% flawless in the 3.x version. Once they implemented "long press home for settings," it became unreliable. The bug with Amazon launcher appearing on wakeup was never present before.

dashriprock007 commented 5 years ago

Launcher hijack used to be 100% flawless in the 3.x version. Once they implemented "long press home for settings," it became unreliable. The bug with Amazon launcher appearing on wakeup was never present before.

I would say that is MORE Amazon finding ways to combat Hijacking...IMO

s0ybean commented 5 years ago

Well, not exactly. If 4.x works, then the test versions of 3.x will work. There are betas floating around in the comments from after Amazon originally killed the app and brought attention back to the devs. I believe there were extra adb commands required.

I switched to 4.x but downgraded a while ago due to the Amazon launcher appearing after wake. I just don't go into settings all that often for the update to be worth it. The workaround is to just disable the hijacker if you need to change something.

dashriprock007 commented 5 years ago

Are you even reading this entire thread? Seems not

you are off of my topic....please delete they are misleading

s0ybean commented 5 years ago

Yes, I'm reading your entire thread. The same solution applies to older versions of hijacker. You're using a 3rd party solution to set permissions, then veered off into complaining about the default launcher still appearing. I offered a working solution.

dashriprock007 commented 5 years ago

Clarify the steps....your solution is misleading

s0ybean commented 5 years ago

Step 1) sift through hundreds of old comments about launcher hijacker no longer working (hint: early 2018 collab between baronkiko and speeddymon)

Step 2) find the test APK, I believe there are a couple.

Step 3) apply the same package renaming and 3rd party permission work arounds you're using for the current version.

Good luck.

El-Koder commented 5 years ago

I also wouldnt want the Amazon Home to be completely gone...I would think you risk bricking and not being able to recover. You could aslo screw up your ability to get to Prime Video as the app for that doesnt seem to work to get there on mine

I would love the stock Amazon launcher completely gone. The only visible part I would like to retain are the Settings, the App Drawer, the Long Press Home screen. The rest of it is pure unadulterated marketing user-unfriendly garbage.

Admittedly if you intend to use any Amazon services you would want them, but I don't and never will. I may experiment with killing Amazon's Launcher, and I'm gonna try to track down the update process and freeze that also.

El-Koder commented 5 years ago

Here's how to disable Amazon Updates to your device... Method 3, configuring parental controls, or server filters... http://www.aftvnews.com/how-to-block-software-updates-on-the-amazon-fire-tv-or-fire-tv-stick/

This really becomes hard for the 4k stick

I managed to use URL Filter in my router to block access to the Amazon update servers. I had to substitute an * instead of .net on the longest one, but I subsequently can no longer reach those servers. I'll keep an eye on the date/time of the daily update checks, but won't really know until the next update comes out.

El-Koder commented 5 years ago

I'm using Launch On Boot to cover all other ways to avoid the stock Amazon Home screen, but it is not consistent.

  • Launching custom HA Launcher from Boot/Restart (Hard Restart or Pull Power) works.
  • Launching custom HA Launcher from Sleep (Screen Off/Wake?) doesn't work.
  • Launching custom HA Launcher from Power Standby (Soft Restart/Not full Power Off) doesn't work.

Why I hadn't tried switching the Wake to the App option Off then On in "Launch On Boot" I don't know. I've tried so many things on this Firestick, it's amazing it still works. Needless to say everything works now, including Sleep and Power Standby.

There's still an odd glitch where you hit Home from an app and are taken back to the stock Amazon Launcher instead of HA launcher, but I'm slowly eliminating all the loopholes.

AHA1GE commented 4 years ago

Ok, here is a quick and dirty solution:

Edit: before doing this first uninstall LauncherHijack if you have it still installed.

First install the cloned LauncherHijack apk from here

Then install the apk inside this zip (don't pay attention to its UI if it shows, it's just a template, the important part is that when it opens it configures the accessibility variables as needed)

Then grant it the required permission by running: adb shell pm grant com.example.settest.settingstest android.permission.WRITE_SECURE_SETTINGS

Then open the application (SettingsTest), after you do that, LauncherHijack should open automatically. (if it doesn't and it still complains when you open it then something did not work as intended)

After you're done you can uninstall SettingsTest.

Dude you r awesome!!!!!!! Thank you so much!!!!!! This method should be put into HELP.md

grandleaf commented 4 years ago

THANK YOU SO MUCH!!!

Ok, here is a quick and dirty solution:

Edit: before doing this first uninstall LauncherHijack if you have it still installed.

First install the cloned LauncherHijack apk from here

Then install the apk inside this zip (don't pay attention to its UI if it shows, it's just a template, the important part is that when it opens it configures the accessibility variables as needed)

Then grant it the required permission by running: adb shell pm grant com.example.settest.settingstest android.permission.WRITE_SECURE_SETTINGS

Then open the application (SettingsTest), after you do that, LauncherHijack should open automatically. (if it doesn't and it still complains when you open it then something did not work as intended)

After you're done you can uninstall SettingsTest.

oathzed commented 4 years ago

@El-Koder in launcher hijack settings, simple uncheck "disable while menu is held" yes this will make the hold home button actions no longer work. But it will fix the issue where it going to the Amazon launcher.

Why this is happening example: press the menu key, then press the home key, it will take you to the Amazon launcher. Now that you've disabled that function, no more issues.

oathzed commented 4 years ago

@s0ybean hey, do you think you can link me to those test builds? I can't even seem to find where the comments are to search through that are from 2018. Any help appreciated

dashriprock007 commented 4 years ago

Another bug fixable. If you're in an app and the fire tv goes to sleep and you keep pressing back to get out of the app instead of home it will go back to Amazon's launcher. This only happens until you press the home button.

To fix this, I made 2 tasker profiles, one for the screen state if off, launch ATV Launcher and another for screen state on, launch ATV Launcher.

Which tasker are you using? is the a Firestick version? or did you just sideload one

dashriprock007 commented 4 years ago

@dashriprock007 I bought it on my phone then extracted the apk and sideloaded it. Works like a charm, now I legit never see the Amazon launcher unless I Wana go to settings. I've tested every possible use case.

What settings do you use on Launcher Hijack and Tasker to complete your perfection again?

How did you set up the profile? Some steps would be great for others too.....remote isnt friendly on it

oathzed commented 4 years ago

You gotta make a task off that profile, don't delete it. It should have like a small popup we're it asks you to type a name and click a check mark

dashriprock007 commented 4 years ago

@dashriprock007 Ok so,

First uninstall "launch on boot" app as you don't need it anymore if you have it.

Launcherhijack: Use ATV Launcher as you can't back out of it, settings in launcher hijack to enable are - hardware button detection, broadcast reciever detection. Only have those enabled, disable "disable while menu is held" yes this gives you the ability to hold the menu and long press the home button to get to the sleep/settings menu pop up thing. But it adds a bug if you press the menu key and press home it will go back to Amazon's home. I don't even use that thing as I have a power button on my remote and settings is right inside ATV Launcher as a simple menu button press.

Tasker: click profiles, call it sleep or something, select state > phone (I believe) > display state > keep it set to off then back out and click the check marks on the top right to save it. Then inside that profile it should have a pop up and ask you to make a task for it, choose app > launch app > ATV Launcher.

Now make another profile called wake and do the same thing except make the display set to "on" this time.

I use ATV Launcher pro version which I've extracted for the best experience as it offers more customizability.

Keep in mind when using tasker you'll probably need a mouse or mousetoggle.

What about the setting in LauncherHijack to disable during task switching?

Ive got it all set up....I did like the ability to put it to sleep....this will only goto sleep based of screensaver now?

dashriprock007 commented 4 years ago

I use the launcher hijack on my fire tv so I keep task switching disabled.

If you use it on a tablet enable it or disable it, test it see what works.

Like I said it works perfect for my use case as I have a power button on my remote that puts it to sleep.

If you want to make it go to sleep via a button, you can try making a task that puts device to sleep when you open app (export said app via tasker and tasker factory) then add it to your home screen as an app and you would press the app and it would send the device to sleep.

Someone is currently working on getting accessibility to work with there button mapping app to work with fire tv so you can change what key presses do on your remote. I'll update you when it's out

Please update that here for sure! Right now it does work great!