בעיה | הסרת הרשאת אינטרנט מאפליקציה
-
מכשיר F21pro עם root מנסה להסיר הרשאות אינטרנט מ google messages וgboard
מה שניסיתי זהadb shell
sailfish:/ $ su
sailfish:/ # pm revoke com.google.android.inputmethod.latin android.permission.INTERNETException occurred while executing 'revoke':
java.lang.SecurityException: Permission android.permission.INTERNET requested by com.google.android.inputmethod.latin is not a changeable permission type
at com.android.server.pm.permission.BasePermission.enforceDeclaredUsedAndRuntimeOrDevelopment(BasePermission.java:432)
at com.android.server.pm.permission.PermissionManagerService.revokeRuntimePermissionInternal(PermissionManagerService.java:1637)
at com.android.server.pm.permission.PermissionManagerService.revokeRuntimePermission(PermissionManagerService.java:1592)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2306)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:251)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21777)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4603)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4381)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
255|sailfish:/ # pm revoke com.google.android.apps.messaging android.permission.INTERNETException occurred while executing 'revoke':
java.lang.SecurityException: Permission android.permission.INTERNET requested by com.google.android.apps.messaging is not a changeable permission type
at com.android.server.pm.permission.BasePermission.enforceDeclaredUsedAndRuntimeOrDevelopment(BasePermission.java:432)
at com.android.server.pm.permission.PermissionManagerService.revokeRuntimePermissionInternal(PermissionManagerService.java:1637)
at com.android.server.pm.permission.PermissionManagerService.revokeRuntimePermission(PermissionManagerService.java:1592)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2306)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:251)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21777)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4603)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4381)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
255|sailfish:/ #כאן https://stackoverflow.com/questions/52079343/how-can-i-use-adb-to-grant-permission-without-root
ובעוד מקומות ראיתי שצריך גם לשנות את ההגדרה "Developer Options" / "Disable Permission Monitoring"
ולא מצאתי אותה באפשרויות מפתח אצלי.אשמח לעזרה, תודה מראש!
-
-
-
-
@ata מתברר שהשינויים של AFwall+ אמנם לא נמחקים אחרי מחיקת האפליקציה אבל כן נמחקים אחרי הפעלה מחדש.
שינויים שיגבילו אינטרנט לאפליקציה וישמרו לתמיד גם אחרי הפעלה מחדש עוד לא מצאתי דרך.
מ"מ ניסיתי לעשות סקריפט שיעשה אותו דבר, אבל לא הצלחתי לעשות שהוא ירוץ מחדש אחרי כל הפעלה מחדש.
זה הכי רחוק שהגעתי עד עכשיו. (זה עדיין לא מושלם כי צריך הרשאות רוט ואם מגיסק יוגבל אז מן הסתם הפקודות הבאות לא יעבדו)
sailfish:/ # cat /system/myfolder/Fscript.sh
#!/system/bin/sh #Check if the argument passed is -b or -R if [ "$1" != "-b" ] && [ "$1" != "-R" ]; then echo "Usage: $0 -b <package_name> # Block internet access for a package" echo " $0 -R # Reset changes" exit 1 fi #Function to block internet access for a package block_package() { package_name="$1" # Check if the package exists if ! pm list packages | grep -q "^package:$package_name$"; then echo "Package '$package_name' not found." exit 1 fi #Get the UID of the package owner uid=$(dumpsys package "$package_name" | grep -E 'userId=[0-9]+' | grep -oE '[0-9]+') #Block internet access for the package using iptables su -c iptables -A OUTPUT -m owner --uid-owner "$uid" -j DROP echo "Internet access blocked for package: $package_name" } #Function to reset changes reset_changes() { # Flush iptables rules su -c iptables -F OUTPUT echo "Changes reset successfully." } #Main script logic if [ "$1" == "-b" ]; then # Check if the package name is provided if [ -z "$2" ]; then echo "Please provide the package name." echo "Usage: $0 -b <package_name>" exit 1 fi block_package "$2" elif [ "$1" == "-R" ]; then reset_changes fi
sailfish:/ # cat /system/myfolder/blockapp.sh
#!/system/bin/sh package_name="$1" if [ -z "$package_name" ]; then echo "Usage: $0 package" exit 1 fi # Monitor loop while true; do # Check if the package is running if pidof "$package_name" >/dev/null; then # Package is running, block its internet access /system/myfolder/Fscript.sh -b "$package_name" break fi # Wait for some time before checking again (adjust as needed) sleep 5 done