module/autopif: use root manager provided tmpfs

This commit is contained in:
backslashxx 2024-12-24 17:12:29 +08:00
parent c35983269f
commit 47d700eee1

View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
PATH=/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH PATH=/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH
MODDIR=/data/adb/modules/playintegrityfix
download() { download() {
if command -v curl > /dev/null 2>&1; then if command -v curl > /dev/null 2>&1; then
@ -20,9 +21,12 @@ set_random_beta() {
DEVICE=$(echo "$PRODUCT" | sed 's/_beta//') DEVICE=$(echo "$PRODUCT" | sed 's/_beta//')
} }
DIR="$MODPATH/autopif" # lets use tmpfs for processing
mkdir -p "$DIR" TEMPDIR="$MODDIR/autopif"
cd "$DIR" [ -w /sbin ] && TEMPDIR="/sbin/autopif"
[ -w /debug_ramdisk ] && TEMPDIR="/debug_ramdisk/autopif"
mkdir -p "$TEMPDIR"
cd "$TEMPDIR"
download https://developer.android.com/topic/generic-system-image/releases > PIXEL_GSI_HTML || { download https://developer.android.com/topic/generic-system-image/releases > PIXEL_GSI_HTML || {
echo "download failed!" echo "download failed!"
@ -73,12 +77,12 @@ cat <<EOF | tee pif.json
} }
EOF EOF
cp "$DIR/pif.json" "/data/adb/pif.json" cp "$TEMPDIR/pif.json" "/data/adb/pif.json"
echo "- new pif.json saved to /data/adb/pif.json" echo "- new pif.json saved to /data/adb/pif.json"
cd "$MODPATH" cd "$MODPATH"
echo "- Cleaning up ..." echo "- Cleaning up ..."
rm -rf "$DIR" rm -rf "$TEMPDIR"
su -c killall com.google.android.gms.unstable || echo "" su -c killall com.google.android.gms.unstable || echo ""