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

gregordr 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).

Can confirm, even after rebooting! The new version is like 2.1 but more consistent

Home button works, but with a flash sometimes App switcher works

It works 100% of the time now! Unlike 2.1, I NEVER get stuck in the amazon launcher.

Thanks again for this amazing app, it made my 50 something$ investment also really usable! Have you considered putting up a donate link?

arminth commented 5 years ago

Another remark regarding Task-Switcher/recent apps. It works with Apex, Nova and also Google launcher. You just have to switch the tablet off and on again. Then it is working with any launcher I tested. Again - thanks a ton!! Donate link is definetly something you should think about!

arminth commented 5 years ago

I stand corrected! Just found that the recent apps stops working after some time... This is obviously the crappy "ads on lockscreen"! The moment they appear on the lockscreen (and after a reboot, this is not yet the case immediately which is why it worked for me in the first place), recent apps is not working anymore. Well, I can live with it! ;)

davidfi01 commented 5 years ago

So far, 3.2 works fine. I installed it, turned on overlay rebooted, upon reboot, choose Google now launcher. Rebooted to Google now. Went to settings, apps, and disabled overlay more for launcher hijack.

Only side effect I have so far is Amazon launcher glasses when home button pressed sometimes.

davidfi01 commented 5 years ago

Please add a donate button. This app needs your support!

gregordr commented 5 years ago

@davidfi01 Can you use widgets? I couldn't get them to work on Nova.

Also, can you tell me how to install Google Now launcher? I tried it, but when I tried to use it I just got a message stating there is a newer version, redirecting me to a non-existant page.

BaronKiko commented 5 years ago

I will think about the donation button. I don't really like asking for money. In regards to the ads you can either ask amazon support nicely and they will sometimes disable it for free, pay amazon or:

  1. Enable ADB on device & install ADB on computer
  2. Connect and verify on computer that device is connected with "adb devices"
  3. adb shell
  4. pm clear --user 0 com.amazon.kindle.kso
  5. Restart the device

It works on my device.

Also if you really want to stop the flicker from the default launcher you can simply remove/corrupt the firelauncher. There are 2 known issues with this, 1) when closing the last app in the app switcher you get kicked back to the lock screen. 2) You can't bring it back without making a new user account, the one you delete it on will be stuck without it forever. It's still much nicer in my opinion so I just have a second dummy account so I can fix my tablet if I break my main account.

Installing google now is odd, if you can find and install it you can't open it directly. But if you select it in LauncherHijack you can use it. You should be able to get widgets on any launcher with: appwidget grantbind --package --user current Launcher Hijack tells you the package name when selecting a launcher (the second line).

gregordr commented 5 years ago

appwidget grantbind --package --user current

I tried that before, but it didn't work. Either way, now it does!

For reference, nova launcher is: adb shell appwidget grantbind --package com.teslacoilsw.launcher --user current

This: https://play.google.com/store/apps/details?id=com.google.android.launcher

Is not even selectable in LauncherHijack. I assume the package has been disabled in an update. I will later try an older version.

BaronKiko commented 5 years ago

The widget limit is a real shame. These darn new kindles -_- If installed google should be selectable, it is selectable on my tablet. The package is com.google.android.googlequicksearchbox for some reason.

arminth commented 5 years ago

Widgets on Google now launcher work.

arminth commented 5 years ago

Is there something like a Team Win Recovery Rom and LineageOS for that thing?

BaronKiko commented 5 years ago

There are custom roms but they wont help you unless you can unlock the boot loader which is infamously hard on the fire devices. If it were that simple this whole project wouldn't exist :P

drizzt09 commented 5 years ago

You mentioned you were going to post final on fdroid. Aptoide is a good store as well

BaronKiko commented 5 years ago

Will have a look see, F-Droid is being a pain to publish to and not really what I wanted after further investigation. Sadly I have noticed a pretty bad issue, basically my new home button capture doesn't work with software buttons. I thought I had tested but I guess not. So that explains all the reports you guys have been sending. Will have to think about it but I have been at it for a good 8 hours today so I think it's time to call it and clear my head. My initial target of fixing the TV version was a success so this is top priority now.

In regards to donations, I was hoping to get this released today, and with it some front page comments regarding the issue, but alas no luck. So while I honestly don't want to encourage it as that's your hard earned money you can send it to my paypal with my email: andy.075109@hotmail.co.uk Please please don't feel obliged.

arminth commented 5 years ago

Done! ;)

BaronKiko commented 5 years ago

Ok some more testing is needed. This may or may not resolve the task switcher issue but its main purpose is to improve reliability. I would like to know how it effects both. It implements a new 4th capture system, hopefully it's works on your device. I would also like some logs if you can, ideally with some markers so I know when you did various things. Cheers.

app-debug.apk.zip

davidfi01 commented 5 years ago

I'll look at it later today. Thanks.

D

BaronKiko commented 5 years ago

Sounds good. Sadly as I don't have the device I'm basically on hold whenever I release a test. Nothing to do but wait. Luckily there are a couple of you which speeds up response time a lot. Ah well a friend has just come over so time for a break.

gregordr commented 5 years ago

Ok some more testing is needed. This may or may not resolve the task switcher issue but its main purpose is to improve reliability. I would like to know how it effects both. It implements a new 4th capture system, hopefully it's works on your device. I would also like some logs if you can, ideally with some markers so I know when you did various things. Cheers.

app-debug.apk.zip

Alright!

Home button works perfectly, no flashes:

2018-12-02 16:36:01.231 28332-28332/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: homekey
2018-12-02 16:36:01.319 28332-28332/com.baronkiko.launcherhijack E/hg: action:android.intent.action.CLOSE_SYSTEM_DIALOGS,reason:homekey
2018-12-02 16:36:01.319 28332-28332/com.baronkiko.launcherhijack D/New Home: Home Press but new

Task switcher again goes back to home screen: Opening task switcher: 2018-12-02 16:36:51.751 28332-28332/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: recentapps Selecting any app: 2018-12-02 16:37:55.178 28332-28332/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: homekey

2018-12-02 16:37:55.202 28332-28332/com.baronkiko.launcherhijack E/hg: action:android.intent.action.CLOSE_SYSTEM_DIALOGS,reason:homekey
2018-12-02 16:37:55.202 28332-28332/com.baronkiko.launcherhijack D/New Home: Home Press but new

Now Im at the homescreen again :/ One more bug that exists: Go to recent apps:

2018-12-02 16:37:55.178 28332-28332/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: homekey
2018-12-02 16:37:55.202 28332-28332/com.baronkiko.launcherhijack E/hg: action:android.intent.action.CLOSE_SYSTEM_DIALOGS,reason:homekey
2018-12-02 16:37:55.202 28332-28332/com.baronkiko.launcherhijack D/New Home: Home Press but new

Press home button:

2018-12-02 16:39:20.135 28332-28332/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: homekey
2018-12-02 16:39:20.163 28332-28332/com.baronkiko.launcherhijack E/hg: action:android.intent.action.CLOSE_SYSTEM_DIALOGS,reason:homekey
2018-12-02 16:39:20.163 28332-28332/com.baronkiko.launcherhijack D/New Home: Home Press but new

Now Fire launcher flashes shortly, but it's not a huge deal.

by the way, what is the reason that the former version wasn't good enough?

BaronKiko commented 5 years ago

Great logs but not a great result. Does it behave differently if you revoke the system alert window permission and reboot your device? adb shell pm revoke com.baronkiko.launcherhijack android.permission.SYSTEM_ALERT_WINDOW

To explain how why the previous version wasn't good enough, basically there are 4 ways it detects the home button being pressed. 1) Hardware button detection, no use with software home buttons like on the fire tablets but used for the fire tv 2) A system alert window, ie an invisible app that floats over the screen. This gets a chance to capture hardware presses before the underlying app and stop it going through. This allows me to stop the system getting the home press. So it's quick and no flash. 3) A new layer that's only in that build I just gave you. This uses a broadcast receiver to monitor home intents, then it can launch the app. It's about as quick as method 2. 4) The last resort, by far the slowest but more reliable than 2 and 3, uses an accessibility service to get notified when an application has loaded. In this case the default launcher. This isn't ideal because the fire launcher has to finish loading before you can even begin to load the new launcher.

So in the version before only method 4 was being used meaning you are basically using version 2. Not too bad but the big disadvantage is you can't do the trick I mentioned of earlier, deleting/corrupting the default launcher to reclaim the resources and make it almost perfect.

Hopefully that makes it clear. Do let me know how changing the perm effects results. Also can you get the line that starts "Launcher Hijack Service Started" as I put your device name there and need to know it to selectively remove parts for the new device. Thank you.

gregordr commented 5 years ago

Alright, will try out later today!

BaronKiko commented 5 years ago

So the task switcher works perfectly? And home works 100% of the time? You edited your response....

gregordr commented 5 years ago

Yeah sorry, i was wrong about what i said.

After taking the logs I uninstalled it and installed the older version again. My mistake, sorry.

BaronKiko commented 5 years ago

Ah that makes sense. I just getting dinner so take your time :)

gregordr commented 5 years ago

Alright, tried that and still no luck.

By the way, does that mean that you are trying to capture the homebutton press, but for whatever reason it also captures any touch in the app-selector?

I couldn't find the line you wanted, only: 2018-12-02 22:48:06.001 7239-7239/com.baronkiko.launcherhijack I/isMyServiceRunning?: false

2018-12-02 22:49:54.608 7479-7479/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: recentapps 2018-12-02 22:49:57.767 7479-7479/com.baronkiko.launcherhijack D/HomeButtonService: Close System Dialog: homekey

Works much less consistently now :/ How about in the homebuttenservice-floating window you color the window in a tint, or just a color, so we can see where it is? Maybe that would help us find out why it takes us home when we use the task switcher.

Also, on which branch is the new apk?

BaronKiko commented 5 years ago

Ok not finding that line I mentioned is kinda concerning. It must have appeared given some of the previous logs. It only gets printed once straight after you enable the service.

Also it appears revoking the perm did nothing. Needs a new builds for the test :( I was aiming to remove the home button service messages. Will try get you that soon.

Changing the colour of the window, for some unknown android reason changes it's behaviour so it's not worth it. Also as I said I'm trying to strip it out to see what happens without it.

All the new stuff is on the fire TV branch, the only one that has been updated in months. The new broadcast receiver method isn't up yet as I'm not sure it will help anything.

BaronKiko commented 5 years ago

app-debug.apk 2.zip Bam, probably last one of the night. Am getting sleepy.

gregordr commented 5 years ago

Task switcher still doesn't work :/

2018-12-03 20:26:15.344 19981-19981/com.baronkiko.launcherhijack V/AccServ: Launcher Hijack Service Started on Amazon KFKAWI

Task switcher opened:

2018-12-03 20:26:15.344 19981-19981/com.baronkiko.launcherhijack V/AccServ: Launcher Hijack Service Started on Amazon KFKAWI Selecting app: 2018-12-03 20:28:11.778 19981-19981/com.baronkiko.launcherhijack E/hg: action:android.intent.action.CLOSE_SYSTEM_DIALOGS,reason:homekey 2018-12-03 20:28:11.779 19981-19981/com.baronkiko.launcherhijack D/New Home: Home Press but new 2018-12-03 20:28:11.938 19981-20377/com.baronkiko.launcherhijack D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000

drizzt09 commented 5 years ago

Im not great at reading android logs but doesnt that look like its selecting home instead of the app selected... which would make sense as thats how it behaves

BaronKiko commented 5 years ago

Yeah for some reason a home request is being issued by the system. Good news if you do have a separate device id (KFKAWI) so I guess I could disable the home button while the task switcher is open on the new tablets. Is it only the task switcher bug that remains? Any flickering of any variety? I got everything I need from logs now btw so you don't need to worry about that anymore.

gregordr commented 5 years ago

I couldn't find any other bug, except that the launcher appears as an app in the app switcher on some occasions, but that doesn't bother me.

Flickering occurs sometimes when closing apps with the home button, and always when doing Recents tasks -> home. If I press home on my homescreen, I can sometimes get it to switch to firelauncher for some reason, until I press home again or open the switcher.

BaronKiko commented 5 years ago

Ok, will try detect the recents menu. Don't know how much it will help. I think the flickering will stick while the default launcher is still installed.

BaronKiko commented 5 years ago

app-debug.apk 3.zip This build should disable the hijack while the app switcher is open assuming the menu has the same class name. Let me know how it goes :)

gregordr commented 5 years ago

Task switcher still not working

Edit: Restarted, now it seems to work. @BaronKiko

Yes, works well now! But my launcher appears as a recent app, if that's important.

Should I try uninstalling the fire launcher?

BaronKiko commented 5 years ago

Can you get the log after you select another app in the app switcher?

BaronKiko commented 5 years ago

Great, you can try uninstall it but I suggest you make a new user account to test first. Once broken there is no bringing it back on that account.

Edit: For the launcher appearing in the recents, try close it then don't open it manually and just use the home button. It shouldn't add it but it can't remove it.

gregordr commented 5 years ago

Great, you can try uninstall it but I suggest you make a new user account to test first. Once broken there is no bringing it back on that account.

Any way to back up all the data? Or every time something goes wrong I have to start a new account?

BaronKiko commented 5 years ago

I would suggest you do a backup of your entire device just generally to be safe. But as long as you don't do anything important on that second account then you can simply use it for testing until you are comfortable it works. Once happy delete the testing one, make another just for use if you do break something then delete the default on your main account and job done. You don't technically need the recovery account as you can log in and make one even without the home screen but it's just makes recovering stuff quicker.

BaronKiko commented 5 years ago

We have a release candidate that should work across all devices out of the box, bold claims I know :P Please test it on any Fire devices you can. I'm doing a new help writeup then looking to release if all goes well. app-debug.apk 4.zip

thechanch commented 5 years ago

On your debug APK 4 above, can't click cancel or ok when selecting any launcher, they're both greyes out. Fire 8hd 6.3.0.1

BaronKiko commented 5 years ago

@andrewcianci Very strange, it's just a default android dialog so I have no idea why it wouldn't work. Maybe try reboot your device and/or fully reinstall the app (go to the manage installed page -> Launcher hijack -> menu -> uninstall for all users)

@Somethingweirdhere Btw I added instructions for corrupting the default launcher in the new help file: https://github.com/BaronKiko/LauncherHijack/blob/master/HELP.md

drizzt09 commented 5 years ago

@andrewcianci all builds have been greyed out for me. but still works to select it. i figured it was just a colour scheme looking like its greyed out but not really

thechanch commented 5 years ago

[update] so the buttons are greyed out, but still selectable. hitting OK sets the launcher (evie in this case) but it is not hidden in the task manager (both evie and launcher hijack 3.2 are visible in the task switcher). so, for now it works 👍

drizzt09 commented 5 years ago

@andrewcianci what happens if you swipe or x either of them form task/recents switcher/manager

thechanch commented 5 years ago

@drizzt09 IMG_1014.mp4.zip

drizzt09 commented 5 years ago

@andrewcianci what happens if you press the home button without crashing the 2 two? just open recents and press home button

BaronKiko commented 5 years ago

I'm going to assume that's just the style choice Amazon has chosen for the dialog boxes. I apply no styling and they look different on every device I know of. As long as the buttons work I choose not to worry about it. Launcher Hijack should appear in the recents as it's just an app and doesn't need to be open for the service to work. Your chosen launcher however shouldn't but after watching that video that's the least of your concerns. As has been discovered frequently throughout this thread rebooting after setting up fixes a lot of issues. And clearly make sure the accessibility service is enabled. Assuming you have already done that or doing that makes no difference I need those logs

thechanch commented 5 years ago

unable to grab logs right now, i'll try tonight. accessibility service is enabled and rebooted a handful of times. @drizzt09 for reference, pressing home drops me to the stock launcher, and then hitting home again flashes screen back into evie.

drizzt09 commented 5 years ago

if you go into recents and swipe away everything. it should auto return to home... and if working properly should be eevie. although i found eevie didnt work well on fire tablet 7. which is why i switched to using Apex. I have not tested Eevie on Fire tab 8 since Apex worked so well on FT7 i stuck with it

BaronKiko commented 5 years ago

Oh something to note, the button doesn't override while the recents menu is open. Somebody in this thread (don't want to read it all again to find out) reported issues regarding it so I disabled it in that case. You can go into the new settings menu in launcher hijack and change it but you probably wont be able to switch apps without it.

It does look like the service isn't running, I had the issue where the service wouldn't start regardless of the settings but thought it was just development. If that's the case you have to:

  1. Do a complete uninstall for all user as I mentioned earlier
  2. Do a full reboot so shutdown wait a couple seconds then boot again
  3. Reinstall and all the usual

I think it's due to not changing the version number. If all that doesn't help then it's really about those logs. I'm not planning on doing any more dev today, spent a good 10 hours so there is no need to rush.