mirror of
https://github.com/kdrag0n/safetynet-fix.git
synced 2024-10-06 06:39:49 +00:00
7a732dc9e2
This allows the module to keep working after major system upgrades.
23 lines
503 B
Bash
Executable File
23 lines
503 B
Bash
Executable File
#!/system/bin/sh
|
|
|
|
MODPATH="/data/adb/modules/safetynet-fix"
|
|
|
|
# Get runtime version
|
|
sdk="$(getprop ro.build.version.sdk)"
|
|
version="$(getprop ro.vendor.build.version.release)"
|
|
if getprop ro.build.id | grep -q SPB2; then
|
|
sdk=31-b2
|
|
version="12 Beta 2"
|
|
fi
|
|
|
|
# Prepare to update version
|
|
rm -fr "$MODPATH/system"
|
|
|
|
# Make sure version is supported
|
|
if [[ ! -d "$MODPATH/system_sdk$sdk" ]]; then
|
|
exit
|
|
fi
|
|
|
|
# Symlink results in the wrong SELinux context
|
|
cp -r "$MODPATH/system_sdk$sdk" "$MODPATH/system"
|