[Q] How to restart Google Services Framework (com.google.android.gsf)? - Java for Android App Development

Hello.
I'm totally new to android/java and need help properly restart services from com.google.android.gsf (and whatever else starts from this package).
I'm trying restart google hangouts (com.google.android.talk), but it depends on com.google.android.gsf as well (it uses data from databases in com.google.android.gsf), so by restarting hangouts by itself is not enough.
If I manually kill both packages and then using eclipse start my app (it must be changed so it reinstalls on phone), it automatically restart com.google.android.gsf. So, there is some kind of broadcasters or something in that nature that could trigger proper start of com.google.android.gsf
Here is how I test it (phone is connected to computer):
1) kill both com.google.android.gsf and com.google.android.talk
2) from computer using different google account send message to google account on phone
3) the message never received, however starting hangouts on phone I can send out messages and they received on computer, not other way around!
4) on computer change something in the app's code (add a space) and run it on phone
5) the message almost instantly received on phone.
Can someone help me?
Thank you.
[EDIT]
This kind of works, but there must be a better way to do it:
Code:
su -c am broadcast -a android.intent.action.PACKAGE_ADDED -n com.google.android.gsf/.gtalkservice.PackageInstalledReceiver

[email protected] said:
[EDIT]
This kind of works, but there must be a better way to do it:
Code:
su -c am broadcast -a android.intent.action.PACKAGE_ADDED -n com.google.android.gsf/.gtalkservice.PackageInstalledReceiver
Click to expand...
Click to collapse
This is what I get
Code:
1|[email protected]:/ # su -c am broadcast -a android.intent.action.PACKAGE_ADDED -n com.google.android.gsf/.gtalkservice.PackageInstalledReceiver
le.android.gsf/.gtalkservice.PackageInstalledReceiver <
Unknown id: broadcast
1|[email protected]:/ #
Any idea?

Hangouts installed? And it's in one line, right?

[email protected] said:
Hangouts installed?
Click to expand...
Click to collapse
Was installed but crashing on startup. Just reinstalled a minute ago, let's see if that was the problem...
A.

Nope... Still crashes. And still the same error in terminal

Related

5.0.5.1 - App Blocking

I've recently been digging in to what is causing launchers from being disabled and wanted to share my findings.
The culprit here is
Code:
/system/priv-app/com.amazon.tv.settings.apk
The service name is
Code:
com.amazon.tv.settings.tv.AppDisableService
There are currently two blacklisted apps in the 5.0.5.1 release:
Code:
com.altusapps.firedtvlauncher
de.belu.firestarter
If you are on 5.0.5.1, you can poke around the system partition by running on your computer:
Code:
adb pull /system
Looks like we have a cat-and-mouse game on our hands...
jkchr1s said:
I've recently been digging in to what is causing launchers from being disabled and wanted to share my findings.
The culprit here is
Code:
/system/priv-app/com.amazon.tv.settings.apk
The service name is
Code:
com.amazon.tv.settings.tv.AppDisableService
There are currently two blacklisted apps in the 5.0.5.1 release:
Code:
com.altusapps.firedtvlauncher
de.belu.firestarter
If you are on 5.0.5.1, you can poke around the system partition by running on your computer:
Code:
adb pull /system
Looks like we have a cat-and-mouse game on our hands...
Click to expand...
Click to collapse
Wow. Those sneaky bastards. I think there is a way to disable individual services.
rbox said:
Wow. Those sneaky bastards. I think there is a way to disable individual services.
Click to expand...
Click to collapse
I was thinking the same thing. I don't have the update so I can't test. But can't we do:
Code:
pm hide com.amazon.tv.settings.tv.AppDisableService
without root, and
Code:
pm disable com.amazon.tv.settings.tv.AppDisableService
with?
wouldn't hurt to try, would it?
rbox said:
Wow. Those sneaky bastards. I think there is a way to disable individual services.
Click to expand...
Click to collapse
Unfortunately the 'pm hide' command doesn't work to disable the service because it's for packages only, so non-rooted owners are out of luck. And yes, I did actually try it anyway. I expect the 'pm disable' command will work with root because it differentiates between packages and components.
Also, it doesn't look like they're doing anything special when disabling the two apps, so once we have a pre-rooted ROM, all we'll have to do is:
Code:
adb shell
su
pm disable com.amazon.tv.settings.tv.AppDisableService
pm enable com.altusapps.firedtvlauncher
pm enable de.belu.firestarter
AFTVnews.com said:
Unfortunately the 'pm hide' command doesn't work to disable the service because it's for packages only, so non-rooted owners are out of luck. And yes, I did actually try it anyway. I expect the 'pm disable' command will work with root because it differentiates between packages and components.
Also, it doesn't look like they're doing anything special when disabling the two apps, so once we have a pre-rooted ROM, all we'll have to do is:
Code:
adb shell
su
pm disable com.amazon.tv.settings.tv.AppDisableService
Click to expand...
Click to collapse
Did you verifiy with:
Code:
pm list packages -d
?
AFTVnews.com said:
Unfortunately the 'pm hide' command doesn't work to disable the service because it's for packages only, so non-rooted owners are out of luck. And yes, I did actually try it anyway. I expect the 'pm disable' command will work with root because it differentiates between packages and components.
Also, it doesn't look like they're doing anything special when disabling the two apps, so once we have a pre-rooted ROM, all we'll have to do is:
Code:
adb shell
su
pm disable com.amazon.tv.settings.tv.AppDisableService
pm enable com.altusapps.firedtvlauncher
pm enable de.belu.firestarter
Click to expand...
Click to collapse
It *IS* a cat and mouse game... but really all that has to happen is the authors of those programs just need to change the name of the package.
I was close. The command to disable the blacklist service is:
Code:
pm disable com.amazon.tv.settings/com.amazon.tv.settings.tv.AppDisableService
It survives a reboot. Here is my detailed guide for those who need it.
I've been playing with this on an unrooted box and found that I can crash the AppDisableService by sending an intent, followed by a force-stop of com.amazon.tv.settings:
Code:
am broadcast -a android.content.action.PERMISSION_RESPONSE_RECEIVED
am force-stop com.amazon.tv.settings
This *seems* to stop the AppDisableService since it never spins back up (since it never receives the BOOT_COMPLETED after it crashes), but this still leaves us with the problem of packages being disabled at boot and no way to enable them.
So, this led me to the idea that you could uninstall the apk and preserve the files, then simply reinstall it after the crash.
I tried to uninstall FireStarter and preserve data:
Code:
pm uninstall -k de.belu.firestarter
but on reinstall, it's still disabled (I'm guessing it preserves the disabled state with -k).
So I guess that's sort-of progress...
jkchr1s said:
I've been playing with this on an unrooted box and found that I can crash the AppDisableService by sending an intent, followed by a force-stop of com.amazon.tv.settings:
Code:
am broadcast -a android.content.action.PERMISSION_RESPONSE_RECEIVED
am force-stop com.amazon.tv.settings
This *seems* to stop the AppDisableService since it never spins back up (since it never receives the BOOT_COMPLETED after it crashes), but this still leaves us with the problem of packages being disabled at boot and no way to enable them.
So, this led me to the idea that you could uninstall the apk and preserve the files, then simply reinstall it after the crash.
I tried to uninstall FireStarter and preserve data:
Code:
pm uninstall -k de.belu.firestarter
but on reinstall, it's still disabled (I'm guessing it preserves the disabled state with -k).
So I guess that's sort-of progress...
Click to expand...
Click to collapse
I wonder what would happen if a device reset was done and your tweak were done?
king200 said:
I wonder what would happen if a device reset was done and your tweak were done?
Click to expand...
Click to collapse
Unfortunately a device reset would restart the AppDisableService. Causing the crash only stops it after you initiate the crash (meaning it would start up on next reboot). That's the problem with this approach...
My thought was to run a process to uninstall the disabled app(s), have a copy of the APK on the filesystem to re-install, and write an app that would initiate the crash and reinstall the apk on BOOT_COMPLETED. This approach is only good for keeping the app during a booted session, it would have to be re-run if the device was rebooted, and all app settings would be lost when the uninstall occurred.
Without initiating the crash, it appears they run an alarm task that essentially does a check every so often to disable any newly installed apps.
So it looks like they do the check on boot, then again at scheduled intervals. Initiating the crash causes the scheduled interval checks to not run, but a reboot means the app becomes disabled.
how about rename the app??? sorry if too stupid...
htchd2fix said:
how about rename the app??? sorry if too stupid...
Click to expand...
Click to collapse
Renaming the app works, but requires the source to be recompiled. Not easily done on device.
on the atvnews(dot)com website is a renamed version from firestarter for downlaod.
CU ulli01

Disable OTA on the 2nd Gen Fire TV stick :

Update: It's been reported that the method works on FireOS up to and including 5.2.6.0, but does not work on 5.2.6.1
To catch a break, and avoid force fed OTA updates, run these commands from your ADB:
Code:
adb.exe uninstall -k --user 0 com.amazon.device.software.ota
adb.exe uninstall -k --user 0 com.amazon.device.software.ota.override
This will disable the OTA apps till the next factory reset. In case there is ever root, your system will be old enough to be rootable.
Once you do this, and go check for system updates, it'll generate a message "System update failed".
More details can be found in this thread.
this was patched on the tablets and if not already will likely be patched on the sticks soon as well.
krsmit0 said:
this was patched on the tablets and if not already will likely be patched on the sticks soon as well.
Click to expand...
Click to collapse
Sure, nothing lasts forever ... But even more reason to do this NOW !!!
At the moment, I have this version : Fire OS 5.2.4.1, ro.build.date=Fri Jun 9 23:01:51 UTC 2017, so not patched yet.
@bibikalka is there a way to reinstall an uninstalled APK for user 0 ?
rainman74 said:
@bibikalka is there a way to reinstall an uninstalled APK for user 0 ?
Click to expand...
Click to collapse
I don't know an easy one
But you can always do a factory reset! These operations don't actually delete anything, just flag it as unusable.
This should allow debloating the Fire TV sticks. Does anyone have a list with apps that you can safely remove? Maybe even replacing the stock launcher is possible. Although on the Fire HD 10 5th generation removing the stock launcher breaks the home button detection.
MWin123 said:
This should allow debloating the Fire TV sticks. Does anyone have a list with apps that you can safely remove? Maybe even replacing the stock launcher is possible. Although on the Fire HD 10 5th generation removing the stock launcher breaks the home button detection.
Click to expand...
Click to collapse
Yes, you can completely replace Fire Stick Launcher without root! But first ensure, that all settings are made, because you can not access certain settings anymore (again only after a factory reset).
And you must install another launcher first, e.g. AppStarter (https://github.com/sphinx02/AppStarter/releases)
1. Uninstall:
adb uninstall -k --user 0 com.amazon.device.software.ota
adb uninstall -k --user 0 com.amazon.device.software.ota.override
adb uninstall -k --user 0 com.amazon.tv.nimh
adb uninstall -k --user 0 com.amazon.tv.launcher
2. Access settings then via ADB without com.amazon.tv.launcher (Fire Stick "tank" on 5.2.4.1):
Controller:
Code:
adb shell am start -n com.amazon.tv.settings/.tv.controllers_bluetooth_devices.ControllersAndBluetoothActivity
App-Menu:
Code:
adb shell am start -n com.amazon.tv.settings/.tv.applications.ApplicationsActivity
Network:
Code:
adb shell am start -n com.amazon.tv.settings/.tv.network.NetworkActivity
Factory Reset:
Code:
adb shell am start -n com.amazon.tv.settings/.tv.FactoryResetActivity
rainman74 said:
But first ensure, that all settings are made, because you can not access certain settings anymore (again only after a factory reset).
Click to expand...
Click to collapse
Thanks! Do you know what settings are affected?
I can recommend Activity Launcher to open settings, it also allows you to open some hidden settings. See NO ROOT: Use 'Activity Launcher' to remove accounts, grant/revoke usage access.
MWin123 said:
Thanks! Do you know what settings are affected?
Click to expand...
Click to collapse
yes, because of we can't grant com.amazon.tv.permission.LAUNCHER_SETTINGS to com.amazon.tv.settings (adb -d shell pm grant com.amazon.tv.settings com.amazon.tv.permission.LAUNCHER_SETTINGS), you can't access the following settings anymore:
Account (but you'll in no way ever change your Amazon Account)
Display & Sound (so set each setting there to "automatic" before you uninstall com.amazon.tv.launcher)
Info/About (you'll not need that anyway)
Childlock (no need for that anyway, because you will not have Amazon Launcher)
Debug/ADB (so set ADB/USB to "yes" before you uninstall com.amazon.tv.launcher and you'll be fine)
MWin123 said:
I can recommend Activity Launcher to open settings, it also allows you to open some hidden settings. See NO ROOT: Use 'Activity Launcher' to remove accounts, grant/revoke usage access.
Click to expand...
Click to collapse
Thanks, I'll try that...
After installing modified "Android TV Settings" (https://forum.xda-developers.com/attachment.php?attachmentid=4255667&d=1503965469) with regular "adb install" you can access the following settings again if amazon.tv.launcher is disabled or uninstalled (non-root):
Sound (system sounds only)
Code:
com.android.tv.settings.device.sound.SoundActivity
Info/About
Code:
com.android.tv.settings.about.AboutActivity
Debug/ADB
Code:
com.android.tv.settings.system.DeveloperOptionsActivity
CEC/HDMI Control
Code:
com.android.tv.settings.system.InputsActivity
Bluetooth/Pairing
Code:
com.android.tv.settings.accessories.AddAccessoryActivity
Date/Time
Code:
com.android.tv.settings.system.DateTimeActivity
Device Name
Code:
com.android.tv.settings.name.DeviceNameSettingsActivity
Language
Code:
com.android.tv.settings.system.LanguageActivity
Do the ADB commands in post 1 work on the 2nd gen Amazon Fire TV please? (not the stick).
I have just acquired one which is non rooted and loaded with software v5.2.4.2 which I understand that I am unable to root.
Any advice greatly appreciated.
meohmy said:
Do the ADB commands in post 1 work on the 2nd gen Amazon Fire TV please? (not the stick).
I have just acquired one which is non rooted and loaded with software v5.2.4.2 which I understand that I am unable to root.
Any advice greatly appreciated.
Click to expand...
Click to collapse
Yes they do, I just tried it on mine and it worked flawlessly. Good luck!
Thanks for the prompt reply, I will have a go as soon as the wife goes out.
apologiez for hijacking your thread, these infors are very appreciated.
i 'accidently' uninstalled "com.amazon.tv.settings", any idea how i can force a factory reset? Installing the modfied "Android TV Settings" didnt help.
TV33 said:
apologiez for hijacking your thread, these infors are very appreciated.
i 'accidently' uninstalled "com.amazon.tv.settings", any idea how i can force a factory reset? Installing the modfied "Android TV Settings" didnt help.
Click to expand...
Click to collapse
this is probably not possible anymore then!
But you can try this method: http://www.aftvnews.com/how-to-unbrick-by-entering-recovery-mode-and-factory-reset-the-amazon-fire-tv/
Worked first time so thanks for all the info, now to get a vpn so I can start using it.
Hi, I need help
I have a Fire TV Stick2 (Tank), after trying Post #7 I have no choice to change the WIFI account.
Post #10 doesn't work.
Any Idea? Post #15 seems not possible for "tank"
Any advice greatly appreciated.
remoter3406 said:
Hi, I need help
I have a Fire TV Stick2 (Tank), after trying Post #7 I have no choice to change the WIFI account.
Click to expand...
Click to collapse
You will have access to wifi on Fire TV Stick2 ("tank") with this cmd as stated in post #7:
Code:
adb shell am start -n com.amazon.tv.settings/.tv.network.NetworkActivity
Post #10 doesn't work.
Click to expand...
Click to collapse
Did yo install the modified "Android TV Settings" first. The command definitely works then!
Any Idea? Post #15 seems not possible for "tank"
Any advice greatly appreciated.
Click to expand...
Click to collapse
It's possible with an Micro USB OTA adapter: https://www.amazon.de/gp/product/B00N2LSLKA/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
You will have access to wifi on Fire TV Stick2 ("tank") with this cmd as stated in post #7:
Code:
adb shell am start -n com.amazon.tv.settings/.tv.network.NetworkActivity
Click to expand...
Click to collapse
First, sorry for my english. I mean WIFI is working with my WIFI repeater, but I want change it to my main WIFI router. How?
Did yo install the modified "Android TV Settings" first. The command definitely works then!
Click to expand...
Click to collapse
Yes, I installed the "apk" and it apears on TV, but no reaction. Is a adb command needed for activating?
It's possible with an Micro USB OTA adapter:
Click to expand...
Click to collapse
OK, this is the last try if I coudn't change the WIFI
Many Thanks for your quick response
remoter3406 said:
First, sorry for my english. I mean WIFI is working with my WIFI repeater, but I want change it to my main WIFI router. How?
Click to expand...
Click to collapse
I will show you a screenshot of that later this evening...
Yes, I installed the "apk" and it apears on TV, but no reaction. Is a adb command needed for activating?
Click to expand...
Click to collapse
You can't click the icon, you must access the settings of it via adb or the app "Activity Lauchner" mentioned in this thread:
Code:
adb shell am start -n com.android.tv.settings.about.AboutActivity
adb shell am start -n com.android.tv.settings.accessories.AddAccessoryActivity
adb shell am start -n com.android.tv.settings.device.sound.SoundActivity
adb shell am start -n com.android.tv.settings.name.DeviceNameSettingsActivity
adb shell am start -n com.android.tv.settings.system.DateTimeActivity
adb shell am start -n com.android.tv.settings.system.DeveloperOptionsActivity
adb shell am start -n com.android.tv.settings.system.InputsActivity
adb shell am start -n com.android.tv.settings.system.LanguageActivity

[GUIDE][NO ROOT][STICK 2] Playing With Matches v1

I thought I'd share my relatively less dangerous methods to turn a Fire TV Stick 2 into an Android TV clone.
First up follow my GApps/Google Services installation guide. This will provide the necessary backbone to install every other application.
You can either install Backdrop as below or ignore those instructions and use my newly ported Android TV settings app to select your screensaver! (no root required!).
Get it here: https://github.com/rockon999/TvSettingsOnFire/releases
Note this settings app requires addition permissions that must be granted via adb. They are listed on the releases page.
First let's install Backdrop (this provides a chromecast-like screen saver for your Fire TV).
Here is the APK link.
adb connect [IP of FTV]
adb install [APK PATH]
adb shell
settings put secure screensaver_components com.google.android.backdrop/.Backdrop
Now you have the Android TV screensaver! Look here for how to configure the timing of the screensaver/sleep.
Now let's install the Leanback launcher. Unfortunately the only Leanback launcher that will load on the Fire TV (without root) is one circa ~2015 and it is *buggy*. To aid this guide (and my sanity) I've taken the decompiled sources of LeanbackLauncher, stripped them of Google services, added features, improved stability, and added Fire TV specific features. You can find that here.
Now let's install Google's TV search app. I've found a working 2.x series version that is better looking, more stable, and much faster. You can get the APK here. Unfortunately the latest version is incompatible but an older version works surprisingly well. I've found version 1.0.6.2108324 to be the most stable. You can download the APK here.
UPDATE: I've figured out how to get Google's voice search working! (this only works w/ voice remotes not apps)
Running this command will disable global Alexa and allow Google to work (if you're on an old enough firmware): adb uninstall -k --user 0 com.amazon.vizzini
And there you go! Your Fire TV Stick is an almost-Android TV stick.
Stay tuned because this guide and Leanback on Fire is being continuously updated!
Very good work!
Thank you, this is what I've been looking for.
rockon999 said:
I thought I'd share my relatively less dangerous methods to turn a Fire TV Stick 2 into an Android TV clone.
Click to expand...
Click to collapse
Could you also include that activities in your launcher-mod ?
Code:
com.amazon.tv.settings/.tv.applications.ApplicationsActivity
And for a rooted version of your launcher (just as an idea):
Code:
com.android.tv.settings/.MainSettings
For com.android.tv.settings/.MainSettings you need to simply install TvSettings.apk with root and you will get almost all functions of the standard Android TV settings menu!
Code:
adb push TvSettings.apk /sdcard/
adb shell su -c mkdir /system/priv-app/TvSettings
adb shell su -c chmod 755 /system/priv-app/TvSettings
adb shell su -c cp /sdcard/TvSettings.apk /system/priv-app/TvSettings/TvSettings.apk
adb shell su -c chmod 644 /system/priv-app/TvSettings/TvSettings.apk
adb shell su -c chown root:root /system/priv-app/TvSettings/TvSettings.apk
adb shell su -c rm /sdcard/TvSettings.apk
rainman74 said:
Could you also include that activities in your launcher-mod ?
Code:
com.amazon.tv.settings/.tv.applications.ApplicationsActivity
And for a rooted version of your launcher (just as an idea):
Code:
com.android.tv.settings/.MainSettings
For com.android.tv.settings/.MainSettings you need to simply install TvSettings.apk with root and you will get almost all functions of the standard Android TV settings menu!
Code:
adb push TvSettings.apk /sdcard/
adb shell su -c mkdir /system/priv-app/TvSettings
adb shell su -c chmod 755 /system/priv-app/TvSettings
adb shell su -c cp /sdcard/TvSettings.apk /system/priv-app/TvSettings/TvSettings.apk
adb shell su -c chmod 644 /system/priv-app/TvSettings/TvSettings.apk
adb shell su -c chown root:root /system/priv-app/TvSettings/TvSettings.apk
adb shell su -c rm /sdcard/TvSettings.apk
Click to expand...
Click to collapse
For the first suggestion app settings are accessible by pressing menu while on a specific application and selecting "App Settings". I think that's what you're after, but if not correct me. The issue with launching the settings activity itself is that it will crash (at least on my FTV Stick 2). I have solved crashes before, though, so I'll look into it. As for your second suggestion I can simply look into re-adding the default ATV settings code (which should interface with this app well). Unfortunately, I'll have no way to test this (I only have an un-rootable FTV sticks) so it may take longer.
rockon999 said:
For the first suggestion app settings are accessible by pressing menu while on a specific application and selecting "App Settings". I think that's what you're after, but if not correct me. The issue with launching the settings activity itself is that it will crash (at least on my FTV Stick 2). I have solved crashes before, though, so I'll look into it.
Click to expand...
Click to collapse
No, I actually meant the global app menu. With me this doesn't crash when I start it directly via adb, but via Confireator I get a crash.
So it works without crash:
adb shell at the start -n com. amazon. tv. settings/. tv. applications. ApplicationsActivity
As for your second suggestion I can simply look into re-adding the default ATV settings code (which should interface with this app well). Unfortunately, I'll have no way to test this (I only have an un-rootable FTV sticks) so it may take longer.
Click to expand...
Click to collapse
That would be great!
I tried the microphone. I held the microphone button on my remote and talked. it worked. I don't think you intended it to work at all. So you should probably update about that. And it feels good to have leanback. Also is the recommendations thing impossible?
Pix12 said:
I tried the microphone. I held the microphone button on my remote and talked. it worked. I don't think you intended it to work at all. So you should probably update about that. And it feels good to have leanback. Also is the recommendations thing impossible?
Click to expand...
Click to collapse
The normal leanback recommendations system will either 1) crash or 2) display recommendations w/o their images (neither of those things are particularly pleasant). Together they mean you end up with a bunch of giant grey blocks (that never update) on your screen. So, essentially, the best way forward (I think) is to attempt to completely rewrite the recommendations code from scratch so that it can function in the user space. There is maybe a 50/50 chance that it will actually work though as recommendations operate over the notifications system and with Amazon's notification systems and Google's recommendations setup on the same machine they don't like to get along.
Side note, I'm surprised the microphone worked as Amazon coded it to always go to Alexa. I have some questions
1) Have you debloated? If so, what?
2) Are you rooted?
3) Any special mods?
Thanks!
rockon999 said:
Side note, I'm surprised the microphone worked as Amazon coded it to always go to Alexa. I have some questions
1) Have you debloated? If so, what?
2) Are you rooted?
3) Any special mods?
Thanks!
Click to expand...
Click to collapse
I debloated the FireTV, it's not rooted and I used Launcher Hijacker 3 to use as home screen. It might've been me using the
Code:
adb shell pm grant com.google.android.katniss android.permission.RECORD_AUDIO
command for the Google app to allow the microphone.
Pix12 said:
I debloated the FireTV, it's not rooted and I used Launcher Hijacker 3 to use as home screen. It might've been me using the
Code:
adb shell pm grant com.google.android.katniss android.permission.RECORD_AUDIO
command for the Google app to allow the microphone.
Click to expand...
Click to collapse
I'm guessing it's because your debloat removed the package that forces Alexa. Similar to how removing the launcher allows other launchers to work without modification apps. I'll poke around and see if I can replicate/find the package.
rockon999 said:
I'm guessing it's because your debloat removed the package that forces Alexa. Similar to how removing the launcher allows other launchers to work without modification apps. I'll poke around and see if I can replicate/find the package.
Click to expand...
Click to collapse
Yeah, I removed really everything Amazon. It showed the launcher menu.
Pix12 said:
Yeah, I removed really everything Amazon. It showed the launcher menu.
Click to expand...
Click to collapse
which is the package that forces Alexa?
is a new version of LeanbackLauncher coming soon?
rainman74 said:
is a new version of LeanbackLauncher coming soon?
Click to expand...
Click to collapse
I'm completely rewriting a lot of the database storage code (there are a lot of broken/missing database calls) and am close to done. I'm just trying to fix the favorites row at this point but moving apps elsewhere is working. I've also re-added the code to link to the native android tv settings app and I also ported the native android tv settings app to Fire TV (without root required!). In addition, I've gotten the leanback keyboard fully working! I'd say a day or two and I'll update the guide
rockon999 said:
I'm completely rewriting a lot of the database storage code (there are a lot of broken/missing database calls) and am close to done. I'm just trying to fix the favorites row at this point but moving apps elsewhere is working. I've also re-added the code to link to the native android tv settings app and I also ported the native android tv settings app to Fire TV (without root required!). In addition, I've gotten the leanback keyboard fully working! I'd say a day or two and I'll update the guide
Click to expand...
Click to collapse
WOW! :good::good::good:
rockon999 said:
I'm completely rewriting a lot of the database storage code (there are a lot of broken/missing database calls) and am close to done. I'm just trying to fix the favorites row at this point but moving apps elsewhere is working. I've also re-added the code to link to the native android tv settings app and I also ported the native android tv settings app to Fire TV (without root required!). In addition, I've gotten the leanback keyboard fully working! I'd say a day or two and I'll update the guide
Click to expand...
Click to collapse
Awesome work!
rockon999 said:
I'm completely rewriting a lot of the database storage code (there are a lot of broken/missing database calls) and am close to done. I'm just trying to fix the favorites row at this point but moving apps elsewhere is working. I've also re-added the code to link to the native android tv settings app and I also ported the native android tv settings app to Fire TV (without root required!). In addition, I've gotten the leanback keyboard fully working! I'd say a day or two and I'll update the guide
Click to expand...
Click to collapse
Awesomeeeee!!!!!!!!!:laugh::laugh::laugh:
UPDATE: I've figured out how to get Google's voice search working! (this only works w/ voice remotes not apps)
Running this command will disable global Alexa and allow Google to work (if you're on an old enough firmware): adb uninstall -k --user 0 com.amazon.vizzini
rockon999 said:
UPDATE: I've figured out how to get Google's voice search working! (this only works w/ voice remotes not apps)
Running this command will disable global Alexa and allow Google to work (if you're on an old enough firmware): adb uninstall -k --user 0 com.amazon.vizzini
Click to expand...
Click to collapse
working perfectly with the newer apk from OP
ALPHA 2 OF LEANBACK IS OUT AND ATV SETTINGS APP PORTED
https://github.com/rockon999/Leanbac...leases/tag/0.2
NOTE: You must completely remove Alpha 1 (and clear its storage - instructions on the release page) as Alpha 1 had database storage bugs that make Alpha 2 inoperable.
The first alpha of my port of Android TV's settings app, TvSettingsOnFire, is also available (note the permission requirements)! https://github.com/rockon999/TvSettingsOnFire/releases
Also, if you've ever actually wanted to see what your were editing while you were typing Leanback Keyboard works perfectly in conjunction with my TvSettings port! You can grab it here.

Debloat Samsung A51 (No root) and get crazy performance!

Hello fellow A51 users today i want to share with you a debloat guide so you can get the max performance out of you new smartphone without Samsung clutter.
All credits goes to Khlam and his Samsung Oneui debloat list:
https://github.com/khlam/debloat-samsung-android
I tested it on my device with uninstalling the complete list and it works great.
You do lose some functionality so be careful with what you delete this does only delete the apps one your install of the OS doing a factory reset will reset all apps back to normal this will not void any warranty so i suggest making a backup and trying it on a fresh install and see if you like it.
This guide will strip Oneui to its bare bones so its not for everyone but if you like speed over functionality than give it a try.
Guide:
The following instructions assumes you are familiar with using a command-line interface.
1. On your phone, enable Android's "Developer Options"
2. In "Developer Options", turn on "USB Debugging"
3. On your computer, download Android SDK Platform-Tools for your OS.
https://developer.android.com/studio/releases/platform-tools
4. Extract Android SDK Platform-Tools and start a command-prompt/shell session in the extracted folder's directory.
(The way i do this is putting the platform tools folder in My Documents and en opening the folder then type cmd in the navigation bar and hit enter this will open a command prompt in the folder directory.)
5. Connect your Samsung Android phone to your computer with USB debugging enabled. Verify that adb sees your device and the daemon is running with the following command
adb devices
You should see the device name listed as a "device".
At this point your device should prompt you to accept USB debugging from your computer. Tap "Allow".
6. Enter your device's shell with the following command: adb shell
Once in the device's shell, copy and paste all desired commands from:
https://raw.githubusercontent.com/khlam/debloat-samsung-android/master/commands.txt
(What i do is making a notepad file and copying the whole list in notepad file removing the spaces then copy and paste the whole list in the command prompt.)
Let the script run and when the command prompt reaches the last command you only have to hit enter ones the finish the script.
Thats it you now have a fast bare bone debloated A51 you can close the command prompt and disconnect your phone from your pc.
Enjoy if this all sounds to difficult i suggest you read up on the following articles/guides
https://github.com/khlam/debloat-samsung-android
https://www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access/
They explain it in more depth if you have any questions please put them bellow and im happy to help.
Zoqy :laugh:
Amazing, was looking for this.
Thanks.
very cool... thx for sharing this
I'm not able anymore to access "Sound quality and effects" in the settings.
Anyway to reinstall?
I found out what the solution was.
So when deleting
pm uninstall -k --user 0 com.samsung.aasaservice
And reinstalling
pm install-existing --user 0 com.samsung.aasaservice
How to fix sms app?
pm install-existing --user 0 com.samsung.android.messaging
it's not helping
senq87 said:
How to fix sms app?
pm install-existing --user 0 com.samsung.android.messaging
it's not helping
Click to expand...
Click to collapse
The ADB-Command for reinstalling is:
adb shell pm enable com.samsung.android.messaging
I get a popup message when trying to edit a picture from the gallery app. It asks to download a picture editor but when i click on download it says "no apps availbe to do this action".
edit: got it myself. this fixed it:
pm install-existing --user 0 com.sec.android.mimage.photoretouching
Just found another one today:
upday for Samsung - Zeropage
a51:/ $ pm uninstall -k --user 0 de.axelspringer.yana.zeropage
Success
tried, broke, fixed
ran this script on the sm-a515u verizion. Lost signal, data, and my nova google companion (no edge swipe). Factory reset works as normal again.
this deletes pretty much everything on your phone, including things like image cropping, youtube or the "find my galaxy" thing
some of these functions are much needed so would sort out whatever you need from that list before attempting to do that
I only deinstalled what I really didn't need, what was about 20 apps and services
seems that one of these packages depends on calling and texting. i'm on a spectrum mobile device and after running the entire script i can use mobile data but can't make or recieve phone calls and text messages. of course a factory reset does the trick but i wonder what app is causing this?
EDIT: i finally got around to troubleshooting it. it was most likely these services i had to re-enable again (through adb shell cmd package install-existing <package name>:
com.sec.ims
com.sec.imslogger
com.sec.imsservice
I am getting frequent reboots and will have to factory reset.
FBK2904 said:
The ADB-Command for reinstalling is:
adb shell pm enable com.samsung.android.messaging
Click to expand...
Click to collapse
This did not help, messaging app crashed. But text message retrieval works.
---------- Post added at 20:26 ---------- Previous post was at 20:23 ----------
AOD no longer works.
Frau Son said:
this deletes pretty much everything on your phone, including things like image cropping, youtube or the "find my galaxy" thing
some of these functions are much needed so would sort out whatever you need from that list before attempting to do that
I only deinstalled what I really didn't need, what was about 20 apps and services
Click to expand...
Click to collapse
would you share those 20 apps and services?
settings not opening. what is the solution to that?
albusdanbledore said:
would you share those 20 apps and services?
Click to expand...
Click to collapse
did you get it ?
hhniloy said:
settings not opening. what is the solution to that?
Click to expand...
Click to collapse
Same here, after Update to Android R (11). My Settings still crash. I reinstalled the bloated s***. then settings works again. But I will try which app it caused.
albusdanbledore said:
would you share those 20 apps and services?
Click to expand...
Click to collapse
for me exactly the same question. Please answer.
I suggest using this debloater instead. More recent, covers many more things (not just Samsung specific) and every single setting is documented and tested. The Samsung Debloater uninstalls things that are better left alone if you don't want an unstable device.
chrisimre747 said:
Same here, after Update to Android R (11). My Settings still crash. I reinstalled the bloated s***. then settings works again. But I will try which app it caused.
Click to expand...
Click to collapse
The app which cause the crash is:
com.osp.app.signin
Tested on my Galaxy A51.

[Solved] Error: "Unfortunately, Google Play Services has stopped" On different Note 4 Variants!!

Getting an error on multiple Note 4 variants N910V running Modest Rom & N916K (converted to N910C) running eRobot all within the last couple of days "Unfortunately, Google Play Services has stopped" , seems like a global issue anyone knows why & how to fix this??? Clearing the data cache of Google Appz does not help neither the factory reset, tried that too.
As a temporary solution I freezed " Google Play Services" using Lucky Patcher after some research but all Google Appz are not working, Pros Response is needed!
FOR THE SOLUTION read the last 3 posts starting post #7​
[Solved] Error: "Unfortunately, Google Play Services has stopped" On different Note 4 Variants!!
Getting an error on multiple Note 4 variants N910V running Modest Rom & N916K (converted to N910C) running eRobot all within the last couple of days "Unfortunately, Google Play Services has stopped" , seems like a global issue anyone knows why &...
forum.xda-developers.com
My temp solution was also disabling GMS, but via ADB - the phone itself was spamming with the error messages so much, it was unusable. My commands:
```
adb shell
su
pm disable com.google.android.gms
```
That removes access to all google services, ofc.
The error disappeared for some time after installing GMS 18.7.19 - I described that in the thread:
[solved] Google Play Store uninstalled, now cannot get it back
tl;dr: I uninstalled com.android.vending via adb, now re-installing it from APK isn't bringing the icon, or the functionality, back. So today I tried to use my phone as you do, and "Application Google Play Services has stopped" was popping...
forum.xda-developers.com
.. but few days have passed, and the old version started to do the same thing.
So downgrading GMS won't help.
Some people claimed that full data wipe helps. Would be nice to figure out the single file which needs to be deleted to make everything work, instead of wiping the phone.
UPDATE:
I 'fixed' it again, but not sure if it won't stop working again, tomorrow. What I did was:
1. Identify names of all apps which use Google Servies
2. Disable all of them
3. Clear all cache and all data in all of them
4. Re-enable the ones I use
ad 1.
I used `pm list packages -f | grep google` and few other greps to get the list, then browsed through it to find the apps which have higher chance of making the difference.
You probably don't have to replicate this point if you just want to fix your issue.
Though to execute commands from the points below, you need to first:
```
adb shell
su
```
ad 2.
I disabled the apps which looked relevant to me, and those which I never use anyway:
```
# Google Play Services - the one which is crashing
pm disable com.google.android.gms
# GMail
pm disable com.google.android.gm
# Google Maps
pm disable com.google.android.apps.maps
# Youtube app
pm disable com.google.android.youtube
# Play Store
pm disable com.android.vending
# Web pages view used in other apps
pm disable com.google.android.webview
# Google Service Framework
pm disable com.google.android.gsf
pm disable com.google.android.gsf.login
# Google Search desktop widget
pm disable com.google.android.googlequicksearchbox
# Google Play Videos
pm disable com.google.android.videos
# Google Play Books
pm disable com.google.android.apps.books
# Google Play Games
pm disable com.google.android.play.games
# Google Play Kiosk
pm disable com.google.android.apps.magazines
# Google Photos
pm disable com.google.android.apps.photos
# Google Drive (yes, drive is named docs..)
pm disable com.google.android.apps.docs
```
ad 3.
I cleared data and cache of all these apps. Note that this means google accounts are disconnected, gmail is no longer configured, you are not logged in to YT etc. If you allowed google to move your contacts to their service, all the contacts will disappear as well - a lesson to not allow moving your contacts anywhere in the future.
```
pm clear com.google.android.gms
pm clear com.google.android.gm
pm clear com.google.android.apps.maps
pm clear com.google.android.youtube
pm clear com.android.vending
pm clear com.google.android.webview
pm clear com.google.android.gsf
pm clear com.google.android.gsf.login
pm clear com.google.android.googlequicksearchbox
pm clear com.google.android.videos
pm clear com.google.android.apps.books
pm clear com.google.android.play.games
pm clear com.google.android.apps.magazines
pm clear com.google.android.apps.photos
pm clear com.google.android.apps.docs
```
ad 4.
At this point I was able to re-enable GMS without any crash:
```
pm enable com.google.android.gms
```
Then I re-enabled the apps, only ones which I really use. The rest will stay disabled for ever - there is no need to bloat the phone with unused processing. So my enable list was:
```
pm enable com.google.android.gm
pm enable com.google.android.apps.maps
pm enable com.google.android.youtube
pm enable com.android.vending
pm enable com.google.android.webview
pm enable com.google.android.gsf
pm enable com.google.android.gsf.login
pm enable com.google.android.googlequicksearchbox
pm enable com.google.android.apps.docs
```
Conclusion: I've seen several people here telling GMS is cancer. This is fully true.
xero4zero said:
Getting an error on multiple Note 4 variants N910V running Modest Rom & N916K (converted to N910C) running eRobot all within the last couple of days "Unfortunately, Google Play Services has stopped" , seems like a global issue anyone knows why & how to fix this??? Clearing the data cache of Google Appz does not help neither the factory reset, tried that too.
As a temporary solution I freezed " Google Play Services" using Lucky Patcher after some research but all Google Appz are not working, Pros Response is needed!
Click to expand...
Click to collapse
I thought I was going crazy. Same going on here.
N910T with N935T Rom by Maximum OvrDrive. If I open various apps, they just open, then close to the home screen. I too had to disable GPlayS. Now I'm left scratching my head. Older versions of Play Services just trigger notifications.
After performing all the typical cache clearing, nothing worked. So I formatted, TWRPd my ROM from scratch, I immediately had the same problem!
Reserved for updates if any!
kaszebci said:
My temp solution was also disabling GMS, but via ADB - the phone itself was spamming with the error messages so much, it was unusable. My commands:
```
adb shell
su
pm disable com.google.android.gms
```
That removes access to all google services, ofc.
The error disappeared for some time after installing GMS 18.7.19 - I described that in the thread:
[solved] Google Play Store uninstalled, now cannot get it back
tl;dr: I uninstalled com.android.vending via adb, now re-installing it from APK isn't bringing the icon, or the functionality, back. So today I tried to use my phone as you do, and "Application Google Play Services has stopped" was popping...
forum.xda-developers.com
.. but few days have passed, and the old version started to do the same thing.
So downgrading GMS won't help.
Some people claimed that full data wipe helps. Would be nice to figure out the single file which needs to be deleted to make everything work, instead of wiping the phone.
UPDATE:
I 'fixed' it again, but not sure if it won't stop working again, tomorrow. What I did was:
1. Identify names of all apps which use Google Servies
2. Disable all of them
3. Clear all cache and all data in all of them
4. Re-enable the ones I use
ad 1.
I used `pm list packages -f | grep google` and few other greps to get the list, then browsed through it to find the apps which have higher chance of making the difference.
You probably don't have to replicate this point if you just want to fix your issue.
Though to execute commands from the points below, you need to first:
```
adb shell
su
```
ad 2.
I disabled the apps which looked relevant to me, and those which I never use anyway:
```
# Google Play Services - the one which is crashing
pm disable com.google.android.gms
# GMail
pm disable com.google.android.gm
# Google Maps
pm disable com.google.android.apps.maps
# Youtube app
pm disable com.google.android.youtube
# Play Store
pm disable com.android.vending
# Web pages view used in other apps
pm disable com.google.android.webview
# Google Service Framework
pm disable com.google.android.gsf
pm disable com.google.android.gsf.login
# Google Search desktop widget
pm disable com.google.android.googlequicksearchbox
# Google Play Videos
pm disable com.google.android.videos
# Google Play Books
pm disable com.google.android.apps.books
# Google Play Games
pm disable com.google.android.play.games
# Google Play Kiosk
pm disable com.google.android.apps.magazines
# Google Photos
pm disable com.google.android.apps.photos
# Google Drive (yes, drive is named docs..)
pm disable com.google.android.apps.docs
```
ad 3.
I cleared data and cache of all these apps. Note that this means google accounts are disconnected, gmail is no longer configured, you are not logged in to YT etc. If you allowed google to move your contacts to their service, all the contacts will disappear as well - a lesson to not allow moving your contacts anywhere in the future.
```
pm clear com.google.android.gms
pm clear com.google.android.gm
pm clear com.google.android.apps.maps
pm clear com.google.android.youtube
pm clear com.android.vending
pm clear com.google.android.webview
pm clear com.google.android.gsf
pm clear com.google.android.gsf.login
pm clear com.google.android.googlequicksearchbox
pm clear com.google.android.videos
pm clear com.google.android.apps.books
pm clear com.google.android.play.games
pm clear com.google.android.apps.magazines
pm clear com.google.android.apps.photos
pm clear com.google.android.apps.docs
```
ad 4.
At this point I was able to re-enable GMS without any crash:
```
pm enable com.google.android.gms
```
Then I re-enabled the apps, only ones which I really use. The rest will stay disabled for ever - there is no need to bloat the phone with unused processing. So my enable list was:
```
pm enable com.google.android.gm
pm enable com.google.android.apps.maps
pm enable com.google.android.youtube
pm enable com.android.vending
pm enable com.google.android.webview
pm enable com.google.android.gsf
pm enable com.google.android.gsf.login
pm enable com.google.android.googlequicksearchbox
pm enable com.google.android.apps.docs
```
Conclusion: I've seen several people here telling GMS is cancer. This is fully true.
Click to expand...
Click to collapse
That didnt work either.
N910T 2014-Date said:
I thought I was going crazy. Same going on here.
N910T with N935T Rom by Maximum OvrDrive. If I open various apps, they just open, then close to the home screen. I too had to disable GPlayS. Now I'm left scratching my head. Older versions of Play Services just trigger notifications.
After performing all the typical cache clearing, nothing worked. So I formatted, TWRPd my ROM from scratch, I immediately had the same problem!
Click to expand...
Click to collapse
Sorry to hear that, but finally I am sure that it is a global issue a bug by Google or a trap for rooted Note 4 devices??? I guess we will hopefully know in a few ....
N910T 2014-Date said:
I thought I was going crazy. Same going on here.
N910T with N935T Rom by Maximum OvrDrive. If I open various apps, they just open, then close to the home screen. I too had to disable GPlayS. Now I'm left scratching my head. Older versions of Play Services just trigger notifications.
After performing all the typical cache clearing, nothing worked. So I formatted, TWRPd my ROM from scratch, I immediately had the same problem!
Click to expand...
Click to collapse
I am waiting for the new version of Google Play Services to see if they would fix this. Till that time I used Lucky Patcher and/or Uninstaller Pro to freeze Google Play Services even uninstalled some GAppz & installed alternative applications for my normal daily activities like Blue Mail instead of Gmail, Sygic instead of Google Maps ... If this continues I guess I will be better off to finally escape the grip of Google. There is always an alternative!!!
The Alternative
[GUIDE] DeGoogle any device and install MicroG
This guide explains how to deGoogle any android by removing most of google invasive crap. (yes, GPlay services is also removed). Play store, Google app and other crap is also removed from system, so if you want to use them, install them as user...
forum.xda-developers.com
And SUCCESS
What u need is a Rooted Note 4 + Xposed Module or Magisk follow the instructions from the link above install FakeGApps [MODULE] in Xposed if you have SU or Smali Patcher [MODULE] if you have Magisk
Signature Spoofing
Free implementation of Play Services. Contribute to microg/GmsCore development by creating an account on GitHub.
github.com
[INDEX] How to get Signature Spoofing support
Beware, you are about to enter a dangerous zone! I N T R O D U C T I O N Signature Spoofing is a feature that allow apps to impersonate themselves as other apps. It works by faking the package signature of an app as the one that the app is...
forum.xda-developers.com
[INDEX] How to get Signature Spoofing support
Beware, you are about to enter a dangerous zone! I N T R O D U C T I O N Signature Spoofing is a feature that allow apps to impersonate themselves as other apps. It works by faking the package signature of an app as the one that the app is...
forum.xda-developers.com
then install microG required Appz from here:
Download - microG Project
et Voila You can run any Google App u need
Thanks XDA
xero4zero said:
And SUCCESS
Click to expand...
Click to collapse
After re-flashing my ROM, I immediately re-installed XPosed as usual. One of my two versions of XPrivacyLUA couldn't load the module it needed, so I uninstalled XPosed intending to reinstall. I restarted without reinstalling, and everything now works again. I'm curious if you use XPLUA, because if you do, perhaps GPlay no longer recognizes spoofed information.
I don't know. I'll definitely take your microG route if this thing acts up again. I'd prefer to keep my XPLUA actively spoofing, but for now I'm just too damn lazy.
xero4zero said:
And SUCCESS
What u need is a Rooted Note 4 + Xposed Module or Magisk follow the instructions from the link above install FakeGApps [MODULE] in Xposed if you have SU or Smali Patcher [MODULE] if you have Magisk
Click to expand...
Click to collapse
For Magisk you can also use NanoDroid Patcher
https://downloads.nanolx.org/NanoDroid/Stable/NanoDroid-patcher-23.1.2.20210117.zip
Signature Spoofing
Free implementation of Play Services. Contribute to microg/GmsCore development by creating an account on GitHub.
github.com
I had another round of fighting the same issue. And the solutions proposed by @xero4zero seem to be best (even though they might be not trivial to apply).
I decided to use Magisk+NanoDroid. Here is some explanation, and my steps with some notes of the issues I stumbled upon:
-1. what are those strange names
Magisk is a rooting tool, with additional features - it allows more control over boot process and allows hooking (adding custom code) in many places within the system. When Magisk is installed, you can make use of its features by installing Magisk Modules. We need it because it provides root, but it also makes it easier for NanoDroid to run - NanoDroid is able to use these hooks.
NanoDroid in a pack of tools which make it easier to install free alternatives for Google Services. There is a package which patches the Android to allow these tools to run (NanoDroid-patcher), and the actual microG package (NanoDroid-microG). NanoDroid also integrates F-Droid, which is an alternative store (you can install F-Droid independently on any device, it's just an app store).
TWRP is a very good replacement of Android Recovery partition, which allows you to do a lot of things interactively (standard recovery just shows you a picture and expects you to control it from PC). TWRP has a lot of features and became a de facto standard starting point for any modifications to stock Android images.
0. starting point
For me it was Note 4 with stock Android 6.0.1 image marked "MMB29M". It had TWRP already installed (so install it first if you want to follow the steps below).
If you're seeing the "Unfortunately, Google Play Services has stopped" message and that is preventing you from doing anything, connect your Note 4 to a PC and do:
```
adb shell
su
pm disable com.google.android.gms
```
(That's assuming you have rooted device, ADB enabled in Android settings, and a client on PC. If not - search the web for details or use another method of disabling the GMS.)
1. install Magisk
Other roots (ie SuperSU) need to be uninstalled before installing Magisk!
Rename APK to ZIP, then install inside TWRP (`Select Storage`, `Install Zip`).
Read the linked howto for details.
2. Run the Magisk app
If it doesn't start, uninstall and re-install APK only, without going to TWRP:
```
adb uninstall com.topjohnwu.magisk
adb install Magisk-v24.2.apk
```
3. Go back to TWRP, install NanoDroid patcher
This is the most complex part, if it won't work out of the box. But try the easy route first:
Select the file `NanoDroid-patcher-*.zip` and `Install Zip` again.
In my case, the tool was unable to De-odex the Android image so that signature spoofing can be installed
on top of that. I suspect that's because this operation requires considerable amount of RAM. I had to
carefully read instructions, and do that change on PC.
So if you have such issue, make sure you have some time to focus, read that carefully and to what it says.
Below are the specific command I used. But these are specific to my setup, so don't rely on it - use the instructions link above.
When de-odexing the `services.jar` on PC, you may notice the size of that file increased multiple times. That is expected, it's not a sign of issue.
Spoiler: the specific commands I used for de-odex on PC
```
# De-odex the Android image so that signature spoofing can be added
# Get files from mobile to PC
adb pull /system/framework framework
# Make backup of the file we modify
cp framework/services.jar services.jar-backup
# Decompile the .jar file to smali assembly, and patch it
C:\Arduino\java\bin\java -Xmx1024m -jar baksmali.jar x framework/oat/arm/services.odex -d framework/arm -d framework/ -o services-new
# Re-compile smali assembly
C:\Arduino\java\bin\java -Xmx1024m -jar smali.jar a services-new -o classes.dex
# Re-pack updated files
zip -j framework/services.jar classes*.dex
# Copy to the phone, into a place where there is write access
adb push framework/services.jar /sdcard/TWRP/services.jar
# Log in as super user to the mobile, and move the .jar to correct folder
adb shell
su
mount -o rw,remount /system
mv /system/framework/services.jar /system/framework/services.jar.orig
mv /sdcard/TWRP/services.jar /system/framework/services.jar
chmod 0644 /system/framework/services.jar
chown root:root /system/framework/services.jar
# verify if the file is in place and has correct attributes
ls -l /system/framework/services.jar
```
After updating my `services.jar`, I tried installing NanoDroid again, and it worked.
While NanoDroid was installing , further modifications to `services.jar` took quite long - like 10 minutes. But succeeded in the end.
4. Verify spoofing
It is prudent to check whether the spoofing works, at this point. Later, migroG will tell you about spoofing status, but for now, you will want to install the small app "Signature Spoofing Checker". You know, so you won't start uninstalling Google without having the base for miniG to work properly.
5. Remove original Google services
Followthe general instructions from DeGoogle post to remove the Google Services.
I did that through ADB. First, I uninstalled all the apps.
You don't really have to uninstall all of them. Only:
- Play Store
- Service Framework
- Play services
.. or in other words, only the last few. The rest should be able to start working after microG takes place of the core services.
Spoiler: uninstall Google Apps through ADB
```
# GMail
adb shell pm uninstall --user 0 com.google.android.gm
# Google Maps
adb shell pm uninstall --user 0 com.google.android.apps.maps
# Youtube app
adb shell pm uninstall --user 0 com.google.android.youtube
# Google Play Videos
adb shell pm uninstall --user 0 com.google.android.videos
# Google Play Books
adb shell pm uninstall --user 0 com.google.android.apps.books
# Google Play Games
adb shell pm uninstall --user 0 com.google.android.play.games
# Google Play Kiosk
adb shell pm uninstall --user 0 com.google.android.apps.magazines
# Google Photos
adb shell pm uninstall --user 0 com.google.android.apps.photos
# Google Drive (yes, drive is named docs..)
adb shell pm uninstall --user 0 com.google.android.apps.docs
# Google Search desktop widget
adb shell pm uninstall --user 0 com.google.android.googlequicksearchbox
# Play Store
adb shell pm uninstall --user 0 com.android.vending
# Google Service Framework
adb shell pm uninstall --user 0 com.google.android.gsf
adb shell pm uninstall --user 0 com.google.android.gsf.login
# Google Play Services - the one which is crashing
adb shell pm uninstall --user 0 com.google.android.gms
```
Then I removed their folders, which the DeGoogle post listed.
Well I didn't really removed them, I moved them to a temporary folder, so that I can revert that in case of issues.
Spoiler: move Google Apps packages through ADB
```
# Log in as super user to the mobile, and move folders with stock services
adb shell
su
mount -o rw,remount /system
# Make a temp dir and move there all directories to be deleted
mkdir /system/priv-app-to-rm
mv /system/priv-app/GmsCore /system/priv-app-to-rm
mv /system/priv-app/GoogleBackupTransport /system/priv-app-to-rm
mv /system/priv-app/GoogleFeedback /system/priv-app-to-rm
mv /system/priv-app/GoogleLoginService /system/priv-app-to-rm
mv /system/priv-app/GoogleOneTimeInitializer /system/priv-app-to-rm
mv /system/priv-app/GooglePartnerSetup /system/priv-app-to-rm
mv /system/priv-app/GoogleServicesFramework /system/priv-app-to-rm
mv /system/priv-app/Phonesky /system/priv-app-to-rm
mv /system/priv-app/SetupWizard /system/priv-app-to-rm
mv /system/priv-app/Velvet /system/priv-app-to-rm
```
And that's it. Your mobile will now run without any Google services. Normally Note 4 doesn't have any software which would make them mandatory to start the device, so you should be able to reboot and basic stuff will work properly.
6. Install microG services
The easiest way is to install "NanoDroid-microG" package. Download it somewhere to your mobile.
By default, "NanoDroid-microG" will not install Play Store - it will install Aurora instead. If you want to use a modded Play store instead, you need to prepare a modified ".nanodroid-setup" - find the default file, and do modifications based on comments inside the file. See NanoDroid documentation for details.
When ready, use `Install` inside TWRP, select the file `NanoDroid-migroG-*.zip` and swipe in `Install Zip`.
Reboot, and you have microG installed. Now configure it, using instructions from NanoDroid documentation.
Done.
Well, I found a solution, and it was very simple. This was indeed a major Google Services update bug. I could repoduce it. It is an update from the Play Services that was malfunctionning.
The fix was simple :
- Remove Google Play services (warning, this will remove your Google Accounts, so don't forget to note your latest passwords and phone numbers)
- Install an older Google Play services (you can very easily find one on an APK sharing site or here, do this at your own risk). The working versions for me was one all back to the 18.0.0 (can't remember the exact version, but if I used the one like 18.0.1, well it wouldn't work anymore, had to be the exact 18.0.0)
- Finnally, you BLOCK all the Google Play services updates servers, simply put in the phone Host file the line to block play.google.com or use a custom Android VPN like Adaway (not free)
I could again use the phone for 4-5 months, so I skipped the bad Google Play services updates (all the versions from 18.0.1 to 22.0.0, from the top of my y head, were buggy, I suppose there was another Google app that caused the bug, but could find it, as I can remember the older versions of the Play Service never bugged until this day), then now I removed the "fix" and there is 0 problem. Running the fixed 22.0.0+ without issues.

Categories

Resources