[SHELL][SCRIPT][10/10/15] SPR Disabler

Search This thread

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
Hello world,

Welcome to SPRs thread page!

What is SPR Disabler?
SPR stands for Services, Providers and Receivers Disabler. This is a standard shell script that will disable unwanted services, receivers and providers from Google Play Services.

What is the difference between this and other conventional methods?
With this method you don't need to install an extra APP that runs in background. This script allows you to disable stuff you do not want, at boot. The only thing you need for this to work, is a ROM with su and /etc/init.d/ support so you can run the script.

How many SPRs does this disables?
231 as of 10/10/15.

For what version of Google Play Services was this compiled?
Google Play Service v8.1.15.

Do you intend to update this script regularly?
I intend to update this script as time permits.

Will there be a problem with my phone if I use this?
I took extra care to verify the logcat after trying the script on my own phone. The only major problem found right now is that the network location service throws an error:
Code:
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): Exception
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): java.lang.SecurityException: need INSTALL_LOCATION_PROVIDER permission, or UID of a currently bound location provider
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Parcel.readException(Parcel.java:1546)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Parcel.readException(Parcel.java:1499)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.location.ILocationManager$Stub$Proxy.reportLocation(ILocationManager.java:1232)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at com.android.location.provider.LocationProviderBase.reportLocation(LocationProviderBase.java:136)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at com.google.android.location.network.NetworkLocationService.onHandleIntent(SourceFile:107)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Handler.dispatchMessage(Handler.java:102)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Looper.loop(Looper.java:135)
10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.HandlerThread.run(HandlerThread.java:61)
This error DOES NOT render your phone useless in the sense that the location of your phone will still work without problems (tested with MAPS, WiFI and Data, GPS on also with GPS Test).
The other issue is related to Gmail - when you enter the app, there will be an error from GPS, but don't worry because the app will still work.

How to install this on my phone?
You will need a custom rom with su and init.d support.
1. Place SPRDisabler.sh in your /etc/init.d/ folder and set the correct permissions (Read: Owner, Group and Other / Write: Owner / Execute: Owner, Group and Other)
2. Launch Terminal Emulator (if you do not have this installed on your phone, install it from Play Store)
3. When Terminal is opened, type:
Code:
su
./etc/init.d/SPRDisabler.sh

!Please note that those are 2 lines of code that need to be entered in Emulator. The first one is to acquire su permissions and the other one is to run the script!
4. Script will now run!

How to revert back if I don't like it?
There is a shell script in the zip that will revert back all the disabled SPRs. Just use the same install method to install the Revert script.

What exactly is disabled?
Code:
Chrome Sync
Google OTA updates (you're not a nexus, lol)
Google WiFi Gatherers
Google Usage Reporting
Google CAST feature (to 'share' your screen on TVs or Smart TVs)
Google Pseudonymous
Google Photos backup
Google Phenotype
Google Nearby
Google Kids
Google Help
Google feedback
Google Car (do you own an Android Car?)
Google Fitness
Google Location Reporting
Google ConfigFetch
Google CheckIn
Google Analytics
Google Ads
Google Location Copresence
Google Location Geofencer

What do I actually get afterwards?
You get a slimmed memory footprint for Google Play Services.

Proof?
Google Play Services on a fresh install ROM:
attachment.php

Google Play Services on a fresh install ROM, script applied:
attachment.php


OK, I want it!


Pics in the wild

attachment.php

attachment.php

attachment.php


That's it. I hope you enjoy using this script!
 

Attachments

  • Screenshot_2015-10-10-14-29-12-01-01.jpeg
    Screenshot_2015-10-10-14-29-12-01-01.jpeg
    57.6 KB · Views: 6,566
  • Screenshot_2015-10-10-15-16-12-01.jpeg
    Screenshot_2015-10-10-15-16-12-01.jpeg
    53 KB · Views: 6,494
  • 1st.png
    1st.png
    78.2 KB · Views: 6,461
  • 2nd.png
    2nd.png
    214.6 KB · Views: 6,455
  • 3rd.png
    3rd.png
    197.5 KB · Views: 6,470

itslels

Senior Member
Oct 21, 2012
1,140
464
Excuse my ignorance, but what benefits does this give us? Battery life? More free memory?

Sent from my A0001 using Tapatalk
 

GXGOW

Senior Member
Apr 4, 2012
1,120
489
East Flanders Best Flanders
Looks promising! I'll try this out on my device and report back the results. Does this mean that I don't need Amplify anymore to limit the Play Services? Will this script also work on other devices?
 

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
Looks promising! I'll try this out on my device and report back the results. Does this mean that I don't need Amplify anymore to limit the Play Services? Will this script also work on other devices?
The disabled ones won't be visible in Amplify. You can still use it while you use this script. It should work on any Android phone that has Google play services and root.

Sent from my A0001 using Tapatalk
 
  • Like
Reactions: prozack1983

GXGOW

Senior Member
Apr 4, 2012
1,120
489
East Flanders Best Flanders
The disabled ones won't be visible in Amplify. You can still use it while you use this script. It should work on any Android phone that has Google play services and root.

Sent from my A0001 using Tapatalk

Alright, thanks for the answer. I ran the script, but it looks like there are exceptions all over the place!

Screenshot_2015-10-10-18-17-48.png


I've come across them in every phase of the script, so I don't think that's a good sign.
The script still tells me the services are disabled with success, though.
 

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
Alright, thanks for the answer. I ran the script, but it looks like there are exceptions all over the place!

Screenshot_2015-10-10-18-17-48.png


I've come across them in every phase of the script, so I don't think that's a good sign.
The script still tells me the services are disabled with success, though.
Please give correct permissions to the file. The script is denied because permissions are not correctly given. Refer to the OP for more info.

Sent from my A0001 using Tapatalk
 

GXGOW

Senior Member
Apr 4, 2012
1,120
489
East Flanders Best Flanders
Please give correct permissions to the file. The script is denied because permissions are not correctly given. Refer to the OP for more info.

Sent from my A0001 using Tapatalk

The permissions are correct, but apparently there was an issue with the Terminal app I was using gaining root access. It's working now! I've also successfully applied it on my G Pad 8.3 and so far, the memory footprint of GPS has shrunk enormously! Will report back on battery life later.

Thanks for creating this script!
 
  • Like
Reactions: 1ceb0x

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
The permissions are correct, but apparently there was an issue with the Terminal app I was using gaining root access. It's working now! I've also successfully applied it on my G Pad 8.3 and so far, the memory footprint of GPS has shrunk enormously! Will report back on battery life later.

Thanks for creating this script!
Can you please check if your location still works properly? Mine still works and it shows my location but I need second thoughts. Thanks!

Sent from my A0001 using Tapatalk
 

GXGOW

Senior Member
Apr 4, 2012
1,120
489
East Flanders Best Flanders
Can you please check if your location still works properly? Mine still works and it shows my location but I need second thoughts. Thanks!

Sent from my A0001 using Tapatalk

Apps like Maps and Swarm can still acquire my current location without any problems. Smart Lock doesn't work anymore, unfortunately, but that's self-explanatory why it doesn't.
 
  • Like
Reactions: 1ceb0x

PlayingPoise

Senior Member
May 7, 2013
419
154
Wolcott
This looks great, thanks for making it! One sorta dumb question, it seemingly disables cast, will that make it so I can't use chromecast? Or is this a totally different kind of cast? Thanks in advance.
 

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
This looks great, thanks for making it! One sorta dumb question, it seemingly disables cast, will that make it so I can't use chromecast? Or is this a totally different kind of cast? Thanks in advance.
It is chromecast. If you want it enabled just change "disable" with "enable" in the script for all the services that have in their name ".cast.", save it and then run it. This will disable anything else but leave cast enabled.

Sent from my A0001 using Tapatalk
 

The Dork Knight Rises

Senior Member
Mar 20, 2014
1,189
1,126
Mumbai
samriddhabasu.github.io
Thanks for this. Will test for a couple days.
One thing though- any way to get rid of that error dialog in Gmail? It bugs me somehow...
(I'd even be willing to enable a couple of services; 228 services disabled instead of 230 doesn't sound too bad either right? :p)
 
Last edited:
  • Like
Reactions: 1ceb0x

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
Thanks for this. Will test for a couple days.
One thing though- any way to get rid of that error dialog in Gmail? It bugs me somehow...
(I'd even be willing to enable a couple of services; 228 services disabled instead of 230 doesn't sound too bad either right? [emoji14])
I will be working on it tomorrow hopefully. Right now i have no idea why that happens. I know it throws an error regarding the version of the email provider or something like that but I'm not sure which needs to be enabled for now.

Sent from my A0001 using Tapatalk
 

skyred5

Senior Member
Feb 9, 2013
293
29
Hello! This looks interesting. My friend and I have been in the midst of optimizing our device's battery by doing all sorts of tweaking. Initially have done disabling services manually from another thread. Your script is the answer to the tedious method of disabling 148 services!

One thing to ask, does your script allow the option of enabling some services? Let's say for example, if I really do own an android car, can I enable it? :confused:
 

1ceb0x

Senior Member
Jun 25, 2010
5,666
6,332
The Earth
It's not looking too good at the moment, unfortunately. GPS is having a great impact on my battery life.

http://imgur.com/oVORSxL
http://imgur.com/D2tEk3O

Sent from my OPO running Sultanxda's CM 12.1
Can you narrow down the problem using bbs or wld? I do not see this behavior on my phone.

Hello! This looks interesting. My friend and I have been in the midst of optimizing our device's battery by doing all sorts of tweaking. Initially have done disabling services manually from another thread. Your script is the answer to the tedious method of disabling 148 services!

One thing to ask, does your script allow the option of enabling some services? Let's say for example, if I really do own an android car, can I enable it? :confused:

The script is pretty explanatory. Each line has a "pm disable" in front of it. If you want some services from the script to be left enabled, just change "pm disable" with "pm enable" inside the script for each line you want, then save it and execute it.

Sent from my A0001 using Tapatalk
 
  • Like
Reactions: skyred5
Oct 10, 2015
23
3
I use Google analytics and Google adsense. Can I get it without these being turned off?

Nvm after I completely read the entire thread. I got my answer.
Sent from my BLU STUDIO 7.0 II using Tapatalk
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Hello world,

    Welcome to SPRs thread page!

    What is SPR Disabler?
    SPR stands for Services, Providers and Receivers Disabler. This is a standard shell script that will disable unwanted services, receivers and providers from Google Play Services.

    What is the difference between this and other conventional methods?
    With this method you don't need to install an extra APP that runs in background. This script allows you to disable stuff you do not want, at boot. The only thing you need for this to work, is a ROM with su and /etc/init.d/ support so you can run the script.

    How many SPRs does this disables?
    231 as of 10/10/15.

    For what version of Google Play Services was this compiled?
    Google Play Service v8.1.15.

    Do you intend to update this script regularly?
    I intend to update this script as time permits.

    Will there be a problem with my phone if I use this?
    I took extra care to verify the logcat after trying the script on my own phone. The only major problem found right now is that the network location service throws an error:
    Code:
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): Exception
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): java.lang.SecurityException: need INSTALL_LOCATION_PROVIDER permission, or UID of a currently bound location provider
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Parcel.readException(Parcel.java:1546)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Parcel.readException(Parcel.java:1499)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.location.ILocationManager$Stub$Proxy.reportLocation(ILocationManager.java:1232)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at com.android.location.provider.LocationProviderBase.reportLocation(LocationProviderBase.java:136)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at com.google.android.location.network.NetworkLocationService.onHandleIntent(SourceFile:107)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Handler.dispatchMessage(Handler.java:102)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.Looper.loop(Looper.java:135)
    10-09 12:00:09.817: E/GmsNetworkLocationProvi(1960): 	at android.os.HandlerThread.run(HandlerThread.java:61)
    This error DOES NOT render your phone useless in the sense that the location of your phone will still work without problems (tested with MAPS, WiFI and Data, GPS on also with GPS Test).
    The other issue is related to Gmail - when you enter the app, there will be an error from GPS, but don't worry because the app will still work.

    How to install this on my phone?
    You will need a custom rom with su and init.d support.
    1. Place SPRDisabler.sh in your /etc/init.d/ folder and set the correct permissions (Read: Owner, Group and Other / Write: Owner / Execute: Owner, Group and Other)
    2. Launch Terminal Emulator (if you do not have this installed on your phone, install it from Play Store)
    3. When Terminal is opened, type:
    Code:
    su
    ./etc/init.d/SPRDisabler.sh
    
    !Please note that those are 2 lines of code that need to be entered in Emulator. The first one is to acquire su permissions and the other one is to run the script!
    4. Script will now run!

    How to revert back if I don't like it?
    There is a shell script in the zip that will revert back all the disabled SPRs. Just use the same install method to install the Revert script.

    What exactly is disabled?
    Code:
    Chrome Sync
    Google OTA updates (you're not a nexus, lol)
    Google WiFi Gatherers
    Google Usage Reporting
    Google CAST feature (to 'share' your screen on TVs or Smart TVs)
    Google Pseudonymous
    Google Photos backup
    Google Phenotype
    Google Nearby
    Google Kids
    Google Help
    Google feedback
    Google Car (do you own an Android Car?)
    Google Fitness
    Google Location Reporting
    Google ConfigFetch
    Google CheckIn
    Google Analytics
    Google Ads
    Google Location Copresence
    Google Location Geofencer

    What do I actually get afterwards?
    You get a slimmed memory footprint for Google Play Services.

    Proof?
    Google Play Services on a fresh install ROM:
    attachment.php

    Google Play Services on a fresh install ROM, script applied:
    attachment.php


    OK, I want it!


    Pics in the wild

    attachment.php

    attachment.php

    attachment.php


    That's it. I hope you enjoy using this script!
    4
    @1ceb0x
    Hi.. could you updates your script to support the latest ver google play service 10.2.98? It seems outdated.. and i want to apply it on Nougat, my phone is xiaomi mi5, is it safe? Thanks

    not safe anymore (unless you are on MM) due to many new/changed services within Play services. I would have to find some time and space to see whether I can even update this for the latest/nougat.
    No promises though but will try to take a look!
    4
    @1ceb0x can you make a new script ?
    and do we need to enable the script with terminal everytime after a restart?
    yes, i'm working on a new version that would be released this weekend.
    no, you don't need to enable the script every time you restart. but I keep it in /system/etc/init.d just to make sure it gets executed at boot (safety).

    I'm vegan, but i love bacon!
    2
    ... Edit: Gmail working again re-enabling the Feedback stuff in Google Play Services

    Thank you @1ceb0x for this awesome script, and thank you @broke86 for this bit of information. Now to find out specifically which feedback is needed to fix gmail.
    Unplugged my phone last night before I went to bed, woke up 7 hours later, and only dropped 1%. I used to use MyAndroidTools Pro to disable some of those things and now I only need it to disable stuff in my downloaded apps. Your script, those LocationManager apps, and Assertive Display have reduced my setup time on a clean flash to under 10 minutes.