3

I'm trying to run an init.d script when my rom boots to disable system services, and they aren't running.

The script is as follows

#!/system/bin/sh
su -c pm disable com.google.android.gms/.update.SystemupdateService
su -c pm disable com.google.android.gms/.update.SystemUpdateGcmTaskService

I can confirm that normal pm disable commands work to disable non system applications. So I suspect I'm not doing something right to su privileges.

  • Did you set the right permissions (0755, rwxr-xr-x) on the script? – Andy Yan Dec 8 '16 at 1:08
  • Yes the kitchen applies the appropriate permissions or if not the kitchen the rom itself when it boots. I can try to make one from scratch and test on my dd. I'm running multirom but I'm at work so I can't make a new build atm. – user199849 Dec 8 '16 at 1:13
  • If you think the script itself isn't executing, try adding a line where it creates a file or echos something in logcat, so as to eliminate this factor. – Andy Yan Dec 8 '16 at 1:18
  • So somthing like mkdir /system/test – user199849 Dec 8 '16 at 1:24
  • In /data if you want to know if the script itself runs, and in /system if you want to know if su works well in the script. – Andy Yan Dec 8 '16 at 1:26
0

If you didn't done this way then try it: Put this script in file and save it in system/bin/ (let's say you name it script1) and set permissions to 755, than make file in system/etc/init.d/ (name it whatever you want) and in file write:

#!/system/bin/sh
script1

And also set permissions to 755. Reboot and see if it has any effect. Also you can try enabling su during boot, you have that option in super su.

  • Would that be my original script that I put in system/bin? Also would I need the #!/system/bin/sh header? – user199849 Dec 8 '16 at 2:42
  • Yes, this what you written in your question. Yes you need that. – Једноруки Крстивоје Dec 8 '16 at 2:47
  • Didn't work either. Is there a log I could check to try to find out why it isn't working? I've never had to check a log before so idk where they are or the adb command to pull it up. – user199849 Dec 8 '16 at 6:38
  • Don't know about that, but obviously somthing is wrong with init.d, so use some emulator from google play. Or assembly kernel again. – Једноруки Крстивоје Dec 8 '16 at 12:18
  • So I'm trying the same thing with su.d support in my rom. But pm disable isn't workthing there either. Is there any other command to use to disable packages/services with a script? – user199849 Dec 9 '16 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.