Hi,
On tasker v5.0b9, when I run action "Run shell", while NOT selecting "run as root", *SOME* commands returns weird error for no reason:
- am force-stop --user 0 PACKAGE_NAME
- pm uninstall --user 0 -k PACKAGE_NAME
The errors are ( as output of the commands above, accordingly ):
- java.lang.SecurityException: Permission Denial:
forceStopPackage() from pid=15910, uid=10162 requires android.permission.FORCE_STOP_PACKAGES
at android.os.Parcel.readException(Parcel.java:1684)
at android.os.Parcel.readException(Parcel.java:1637)
at android.app.ActivityManagerProxy.forceStopPackage(ActivityManagerNative.java:5255)
at com.android.commands.am.Am.runForceStop(Am.java:752)
at com.android.commands.am.Am.onRun(Am.java:400)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
at com.android.commands.am.Am.main(Am.java:124)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:264)
- Exception occurred while dumping:
java.lang.NullPointerException
at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:94)
at com.android.server.AppOpsService.checkPackage(AppOpsService.java:1073)
at android.app.AppOpsManager.checkPackage(AppOpsManager.java:1937)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:874)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
at android.os.ShellCommand.exec(ShellCommand.java:94)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18565)
at android.os.Binder.shellCommand(Binder.java:468)
at android.os.Binder.onTransact(Binder.jav
When I run the these command in terminal emulator on the same phone or by using adb (WITHOUT su !), they exec and work, with NO error whatsoever.
Please note that I MUST use the "--user 0" since I wish to run these command on phones W/O root, those the need to run them as "current/local user", i.e user number "0".
I also tried to put these command in some "sh" script file on /sdcard then ran "Shell command" action of
"sh /sdcard/script.sh" -> but I get the SAME errors.
again, using terminal emulator or ADB ( W/O root/su ) - it exec and work without any issue or error.
I hope you can solve this bug.
Thanks,
GPS.