Skip to content

Commit

Permalink
Update ATVServices.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Astu04 authored Mar 5, 2024
1 parent 6ae32ed commit fcec3c9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions custom/ATVServices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,19 @@ if [ "$(magisk -V)" -le 23000 ]; then
fi
done
else
if [ "$policy" != 2 ]; then
log -p i -t eMagiskATVService "$package current policy is $policy. Adding root permissions..."
for package in "$MITMPKG" com.android.shell; do
packageUID=$(dumpsys package "$package" | grep userId | head -n1 | cut -d= -f2)
sqlite3 /data/adb/magisk.db "INSERT INTO policies (uid, policy, until, logging, notification) VALUES ($packageUID, 2, 0, 1, 1)"
else
log -p i -t eMagiskATVService "Root permissions for $package are OK!"
fi
policy=$(sqlite3 /data/adb/magisk.db "select policy from policies where package_name='$package'")
if [ "$policy" != 2 ]; then
log -p i -t eMagiskATVService "$package current policy is $policy. Adding root permissions..."
if ! sqlite3 /data/adb/magisk.db "DELETE from policies WHERE package_name='$package'" ||
! sqlite3 /data/adb/magisk.db "INSERT INTO policies (uid, policy, until, logging, notification) VALUES ($packageUID, 2, 0, 1, 1)"; then
log -p i -t eMagiskATVService "ERROR: Could not add $package (UID: $packageUID) to Magisk's DB."
fi
else
log -p i -t eMagiskATVService "Root permissions for $package are OK!"
fi
done
fi

# Set mitm mock location permission as ignore
Expand Down

0 comments on commit fcec3c9

Please sign in to comment.