BaronKiko / LauncherHijack

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

Doesn't seem to work on Fire OS 6.3 #23

Closed arnoldd98 closed 5 years ago

arnoldd98 commented 5 years ago

Title. Downloaded it inside my Fire HD 8, however when i click on it the screen flashes and the app doesn't open

sturgeo1 commented 5 years ago

I have the same issue. Downloaded it to two brand new Fire HD 8 tablets and the app does not function. It works perfectly on my Fire 7. Any suggestions or workarounds?

drizzt09 commented 5 years ago

v2.1 appears to work on the Fire HD 8 though

friedl commented 5 years ago

I can confirm V3 does not work on a Fire HD8 with Fire OS 6.3.0.1.

v2.1 appears to work on the Fire HD 8 though

Also on the newest Fire OS?

drizzt09 commented 5 years ago

Yes I have brand new out of box yesterday 8HD that upgraded to 6.3.0.1

BaronKiko commented 5 years ago

Sadly I don't own one of the new hd 8's so I honestly have no idea. If some of you could send the crash log from the app opening then I can at least have a guess what's going wrong. It may be easy to fix or hard to fix I just don't know without more info. If it's a hard fix then there really isn't much chance I could fix it as I can't test any changes I have made.

drizzt09 commented 5 years ago

I can plug into logcat this weekend and grab logs. Have to do it when kids aren't around as it's an xmas present. Opened to set it up last night so it's ready to go on unwrap

davidfi01 commented 5 years ago

V3.0 works on HD8 2018 if you enable "allow display over other apps". However, a side effect is that when you open task switcher, and try to jump to another task, it jumps you back to the home page only.

Another overlay shows in YouTube. The control overlay with the pause, forward and back buttons does not disappear when playing videos.

friedl commented 5 years ago

V3.0 works on HD8 2018 if you enable "allow display over other apps". However, a side effect is that when you open task switcher, and try to jump to another task, it jumps you back to the home page only.

Awesome. That worked. I can live with the task switcher not working, because closing tasks still works.

drizzt09 commented 5 years ago

HiJack3Crash.txt ok this is the fatal when trying to launch v3: I/ActivityManager(569): Start proc 11833:com.baronkiko.launcherhijack/u0a178 for service com.baronkiko.launcherhijack/.HomeButtonService 11-25 15:32:24.997: D/VendorDisplayManagerGlobalCallback(11833): callGetInstance: nil 11-25 15:32:25.003: W/ActivityThread(11833): Application com.baronkiko.launcherhijack can be debugged on port 8100... 11-25 15:32:25.009: W/System(11833): ClassLoader referenced unknown path: /data/app/com.baronkiko.launcherhijack-1/lib/arm 11-25 15:32:25.051: D/AndroidRuntime(11833): Shutting down VM 11-25 15:32:25.052: E/AndroidRuntime(11833): FATAL EXCEPTION: main 11-25 15:32:25.052: E/AndroidRuntime(11833): Process: com.baronkiko.launcherhijack, PID: 11833 11-25 15:32:25.052: E/AndroidRuntime(11833): java.lang.RuntimeException: Unable to create service com.baronkiko.launcherhijack.HomeButtonService: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@7867e5 -- permission denied for window type 2006 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3223) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.app.ActivityThread.-wrap5(ActivityThread.java) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1578) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.os.Handler.dispatchMessage(Handler.java:102) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.os.Looper.loop(Looper.java:154) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.app.ActivityThread.main(ActivityThread.java:6188) 11-25 15:32:25.052: E/AndroidRuntime(11833): at java.lang.reflect.Method.invoke(Native Method) 11-25 15:32:25.052: E/AndroidRuntime(11833): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) 11-25 15:32:25.052: E/AndroidRuntime(11833): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:801) 11-25 15:32:25.052: E/AndroidRuntime(11833): Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@7867e5 -- permission denied for window type 2006 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.view.ViewRootImpl.setView(ViewRootImpl.java:705) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95) 11-25 15:32:25.052: E/AndroidRuntime(11833): at com.baronkiko.launcherhijack.HomeButtonService.onCreate(HomeButtonService.java:52) 11-25 15:32:25.052: E/AndroidRuntime(11833): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3213) 11-25 15:32:25.052: E/AndroidRuntime(11833): ... 8 more

drizzt09 commented 5 years ago

after following steps above to allow draw over other apps i was too able to open without crash. I also experienced the issue of not be able to use task switcher and captured those logs. Those ones are a little harder to pinpoint the issue so here is the full log for the test. HiJack3.txt

BaronKiko commented 5 years ago

Ah that's part of the same issue that hit fire TV. It's due to new security restrictions added to android. You can probably just run: adb shell pm grant com.baronkiko.launcherhijack android.permission.SYSTEM_ALERT_WINDOW

That allows the app to create it's alert window.

Can you still enable accessibility services on the new hd 8? If not there is another command I can look up for you to set that.

But do let me know how that command changes things. I am still yet to look at the longer log yet. Need my pc for that as mobile formatting is broken

davidfi01 commented 5 years ago

Can you do it by using app permission settings or only through adb?

drizzt09 commented 5 years ago

accessibility detect home is there and able to enable. Maybe we need the other one in the code to set the permission(s).

Running the shell command does not help with the task switcher. However it seems to have messed with the home button being pressed. 1/3 times pressing home chooses my Apex Launcher. 2/3 selects Amazon Home HiJack3home.txt

Update, the home button consistency issue was fixed after device reboot. Task switcher issue still persists

BaronKiko commented 5 years ago

Ah forgot you need a reboot for the perm to fully take effect. You need to set it via adb on more recent android versions because it was used for viruses and other nasty things. Not sure if the latest fireos falls in this category. It doesn't look like I can get around the switcher stuff without some code. If any of you are budding Devs you can check out the firetv branch and may be able to get it going (it works in a totally different way) but it's not nice code so it's probably too much of a time sync for most.

drizzt09 commented 5 years ago

What's different in 2.1 that it doesn't happen with?

BaronKiko commented 5 years ago

It works differently, simply put v2 waits till it sees the home screen open and then opens your desired launcher. V3 directly intercepts the home button press so the default launcher never opens meaning it's much quicker. The fire TV version works differently again to achieve the same effect as v3 but within the new security restrictions and while I got it working on the TV with 100% success rate it broke the settings menu and long press menu severely limiting the usability of the app. Those issues shouldn't be present on the tablet hence why I said you could probably get that version working.

Not sure all that is 100% accurate as I wrote it a long time ago now but it's more or less the story.

gregordr commented 5 years ago

Thanks for the app @BaronKiko. The home-button works perfectly, but the task switcher always defaults back to the home page (just like @drizzt09 said. Is there anything that can be done about this?

BaronKiko commented 5 years ago

As I have said previously the firetv version may fix it as it works differently but it's still in development. Unfortunately I have been busy with getting a real job so it's been on hold for 3-4 months now and shouldn't be used on a device without fixing up. I can try make a build at some point with the extra firetv stuff removed if I get a spare evening or 2 but please don't hold me to it as getting that time isn't so easy.

dwaal commented 5 years ago

I have Hijack running on my FireHD 10 (2017). Works perfect.

I just installed it on my new FireHD 8 (2018) and tested it with various launchers. Sometimes it works, sometimes it does not. Very strange.

Shouldn't it work all the time or not at all? It's more like 50:50

gregordr commented 5 years ago

@BaronKiko I tried the 2.1 one. It sometimes flashes the old screen, but it works just fine for me :) The only thing that is weird are widgets, but I don't think it's possible to fix this.

That said, take your time. Real life is more important than this, so get everything working there before you worry about this :) and good luck with the Job Search!

dwaal commented 5 years ago

I tried 2.1 from scratch on my FireHD 8.

What I did: Installed Apex 3.3.3 and LawnchairLauncher2.2 Installed LauncherHijack v2.1

Started LauncherHijack and selected one of the new launchers Went to "Settings -> Accessibility -> To detect home button press". The problem here is, when I click on it, it does show me an empty screen. Unlike with my FireHD 10, where there is a ON/OFF toggle button to set "detect home button press".

Is this only me or is the option "To detect home button press" permanently "OFF" and there is no way to change it for the new "Fire HD 8 (2018)" ???

Can somebody confirm this?

splitbrain commented 5 years ago

@dwaal I needed to upgrade FireOS to 6.3.0.1 before the accessibility options worked on my 8th gen Fire HD 8. Before I also had the empty screen. I'm using Launcher Hijack v3.

drizzt09 commented 5 years ago

I concur accessibility is broken in 6.3.0.0. had to upgrade to 6.3.0.1 It also doesn't just affect this app. It was same with my parental controls app. Was also missing the on off toggle and needed the OS update

BaronKiko commented 5 years ago

Accessibility is not broken in the os, the menu was removed for security reasons. The new tablets as I am led to believe (don't own one so can't confirm) are using a newer fireos version that the firetv cube and stick have been using for a while now. This new version is based on a later android base version. In fairness it's Google that have made the decision to hide it as it is a really bad security flaw allowing mostly full access to an unrooted device. Amazon may have added the option back and that would be handy to know but you can still enable accessibility services via adb.

The command is in the next post and works for any service you wish to enable. This means you can't accidentally enable it but it is kind of a pain.

Hopefully that clears things up as the same issue has been posted on various threads a couple times now. Either that or people aren't reading this stuff -_-

Somebody mentioned widgets, in amazons infinite wisdom they block widgets on all 3rd party launchers. There are some adb commands that enabled widgets on any launcher of your choosing (can't remember what they are but some googling should bring it up). I never use them because Google being the top dogs have some kinda backdoor in fireos/android that allows their launcher, Google now which seems to be getting killed off :( , to use widgets on the device out of the box so I suggest you just use that. It's a solid launcher anyhow.

BaronKiko commented 5 years ago

THESE COMMANDS ARE WRONG, USE THE ONES FURTHER DOWN THE PAGE!!!

Turns out the command was on another issue so here is it: You can enable the service via adb with:

adb shell settings get enabled_accessibility_services Copy the output from the above command and paste it into the command below

adb shell settings put enabled_accessibility_services (PASTE_HERE):com.baronkiko.launcherhijack/com.baronkiko.launcherhijack.AccServ Hope that helps,

drizzt09 commented 5 years ago

The accessibility settings are there on fireOS 5 (android 5) and in FireOS6 (android 7) with the patch update. It's also on my android phone (android 8.1) and my old phone (Android 6). It's needed for many apps such as parental controls. It was also on my galaxy tablet when it was android 5, 6 and 7. I have never not seen it there.(except fireOS 6.3.0.0)

BaronKiko commented 5 years ago

I can't remember the details but the menu to enable them is defiantly missing on the firetv someone donated to me. Hence the need for the command. It's a smart thing to do honestly, as I mentioned earlier it's really just a great way for hackers to install a virus onto your phone. You get to intercept all button presses, read what's on the screen in the currently loaded app etc. Basically you can lock someones device up, go through all their apps 1 by 1 and take any data that shows up on the screen. So take all your contacts, read your facebook, instagram, twitter and all that good stuff. All while the owner gets to watch his phone flicking through apps unable to do anything as you can't remove a battery in modern devices. Worse yet they can just silently watch everything you do.

Nasty stuff but it's pretty much the only way to do what this app does. Frankly if I didn't write the code I would be hesitant to install it myself.

BaronKiko commented 5 years ago

Oops, command above are wrong though it doesn't seem they are needed. Correct one to get should be: adb shell settings get secure enabled_accessibility_services Set should be: adb shell settings put secure enabled_accessibility_services (PASTE_HERE):com.baronkiko.launcherhijack/com.baronkiko.launcherhijack.AccServ

And as you know you also have to use: pm grant com.baronkiko.launcherhijack android.permission.SYSTEM_ALERT_WINDOW

dwaal commented 5 years ago

Thanks. Works now with a little more jitter compared to v3.

The warning message emitted by the "to detect home button press" toggle sounds quite a little bit less scary: it can read text you type (except passwords). Is it text you type or any data showing on the screen? Btw, why lump into one permission to ability to detect home button press and reading text you type?

Is every app able to "detect home button press" when you turn this on?

This all sounds a bit scary. Maybe I stick with my temporary workaround and just use the Amazon launcher. Once you put ALL the garbage apps from Amazon into a single "app folder" you are basically just left with the stuff you installed yourself from the PlayStore. Also you obviously don't have to turn on "home button detection" ;)

BaronKiko commented 5 years ago

It's not quite all 1 permission, there are multiple sub perms for each service mostly to reduce the noise an app would have to deal with, but it's easier to just enable it all as android perms are a pain. This app specifically intercepts home button presses and listens to the default fire launcher opening and the device booting. I.e. it's not spying or anything like that and if you don't trust me all the code is there to read :P It also creates an invisible overlay window that isn't part of the accessibility services (that's what the other command enables). That also intercepts home button presses.

It is possible that other services will spy but assuming you trust the source you should be fine. Just like how any company that makes drivers for windows could be doing malicious things but you wouldn't worry about installing an nVidia driver for example.

My point was that it makes you think about what you are installing. Most people when told to enable a service in the settings will just do it, similar to how most people just never read the permissions page that comes up when installing an app. Most people that have the know how to install adb, enable dev options and run the required commands know what they are doing and are aware of the risks. Very few can do all that yet not understand the dangers. On top of all that Google's basic rule of thumb is if you break your device through the normal OS it's a security issue and therefore Googles fault (at least in part). If you break it through adb, well you are a dev so that's on you. Not to say they won't help recover your device but it's not a bug for them to fix.

In short the rule is: only install services from developers you trust. Same goes for regular apps but it's far less likely to break the device if you ignore the rule.

Finally if you can get v3 working it should be better, You will need to re-run the commands every time you install, update or reinstall the app.

dwaal commented 5 years ago

I trust you/LauncherHijacker - never implied otherwise :)

I was under the impression from your description that the app unlocks this permission for all apps - obviously not the case - I understand that now.

Finally if you can get v3 working it should be better, You will need to re-run the commands every time you install, update or reinstall the app.

Maybe you should update README.md and list the best path to get it working on FireHD 8 (2018 edition) to save you further trouble ;)

BaronKiko commented 5 years ago

You are probably right but until I know exactly the best way I will have to leave it. I usually wait until I get at least 2 people saying a specific fix worked. If it's not 100% with v3 then something is likely still up. Be that the code, permissions or something else I don't know.

Honestly this whole project needs a face lift to make it clear for the newer devices including the TV range.

Darko016 commented 5 years ago

I too am experiencing the same issues named above on a brand new 8th generation Fire HD 8. I did what davidfi01 mentioned, which is to enable Display over other apps under Special App Access. The problem is that you can't switch between tasks. The other bigger problem I experienced was pressing the home button several times to see if it would break Nova Launcher and surely it broke pretty much 3 out of 4 presses, meaning it went back to Amazon's Fire Home Page instead of Nova Launcher.

BaronKiko commented 5 years ago

If you do the adb commands listed, the "allow display over other apps" and have tried both version then there really isn't a whole lot more I can suggest. Really starting to feel like it's going to need a code rework which isn't easy without a device to test with or the time to do the development.

drizzt09 commented 5 years ago

@darko016 restart the tablet. I have inconsistent home button till I restarted tablet then it was 100%

No resolution for the task switch at this time

gregordr commented 5 years ago

By the way, I think the ADB commands don't work anymore on the new tablet - not related to this app, but still wanted to inform everyone.

I yet have to try it with the Google Now launcher.

BaronKiko commented 5 years ago

I don't see why they wouldn't. You can test if the accessibility service command works, simply: 1) turn you device off fully 2) start your device again 3) see if the home button takes you to default launcher or your custom one (DON'T OPEN THE LAUNCHER HIJACK APP MANUALLY)

If the home works even 0.1% of the time the service is launched properly.

This works because this app starts on boot using the accessibility service. Without it you need to open the app to start the overlay which deffinatly does work on later OS's.

If you are worried about the overlay install Facebook messenger, open and return to home screen. Get someone to send you a message and you should get an overlay.

Hopefully those tests work out

BaronKiko commented 5 years ago

So in a surprise to everybody (myself included) I managed to find some precious dev time. Now no promises but this build may work. I clearly haven't tested it for the new device as I don't have one but it works on the fireTV and the my previous generation tablet.

LauncherHijackV32.apk.zip

Give it a go and let me know how it works. You will need to run the aforementioned commands to get the accessibility service running.

Please let me know how it goes, if all goes well we are looking at a release.

gregordr commented 5 years ago

Pros:

Thanks!

drizzt09 commented 5 years ago

perfect timing. We decided to give the tablet to my daughter for her birthday (today) instead of Xmas. I was just coming on to roll back to v2.1 when i check and saw your email. It may be overkill but I.

  1. stopped v3
  2. cleared data on v3
  3. uninstalled v3
  4. installed v3.2
  5. launched v3.2 which prompted for draw over other apps, turned on
  6. selected my Apex Launcher
  7. went into Fire Settings > Accessibility > Services and turned on HOME detection

home button works (with a flicker of firehome) and the biggest change....recent app switcher now works for me. Excellent job, thank you Note: no commands were needed

gregordr commented 5 years ago

Interesting. Did you reboot? I wonder why the app switcher works for you, but not for me.

drizzt09 commented 5 years ago

spoke too soon, after restart app switcher no longer worked. :(

BaronKiko commented 5 years ago

It shouldn't flicker at all if the requested launcher is still loaded (ie don't launch a game or anything). No idea why you are having issues with the app switcher, I haven't been able to replicate it on any device. This version disables the final backup and is the only thing I could think is stopping it. I haven't updated version numbers so make sure to delete the previous version before installing. app-release.apk.zip

drizzt09 commented 5 years ago

nope now its worse. home detection working 1/3 times-ish and app switcher still not working. even after reboot

drizzt09 commented 5 years ago

went back to v2.1 as i have to wrap it and get stuff ready for her party. I can try other builds at later times

BaronKiko commented 5 years ago

app-release.apk 2.zip Hmm, this build removes the second backup. Does the issue occur on 2.1? If this doesn't help the app switcher then I don't think there is anything more I can do without a device.

It does concern me it's so inconstant in the previous build. On my devices since the new update no matter what I do it never need the final backup.

Thanks for the feedback. good luck with the party, wish her a happy birthday :)

gregordr commented 5 years ago

Now the app switcher works :)

Old launcher still flashes for a bit, but I don't care personally. It still switches after less than a second.

It's perfect for me

drizzt09 commented 5 years ago

Ok I'll have to test at another time. 2.1 everything works except it has the flicker when you press home. Original 3 was better with the home button. Didn't notice a flicker but app switcher (recents) doesn't work. You open app switcher and select any open app and it return to home (proper launcher home, but still home and not the selected app).

arminth commented 5 years ago

Confirm works for me. Tried v3 with the adb-commands (there was nothing to paste actually) and it worked. Then I saw new version which worked for me as well. Using Google now launcher and recent apps switch doesn't work. Will try apex launcher. Thanks a lot! Makes my 53$ black Friday deal really usable!

BaronKiko commented 5 years ago

Of all the things, I will take out that layer and clean up so it should hopefully work for all the devices. Use that one for now, I am trying to get this working with F-Droid to make updating easier. If/when I get that sorted I'm aiming to release this all. That build isn't optimised so do look out for that update. I will post here once it's out. Thank you for testing guys.