From 695f09e954c10c32283b713f7091265842f6b499 Mon Sep 17 00:00:00 2001 From: Yervant7 <71306082+Yervant7@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:51:32 -0300 Subject: [PATCH] fix conflicts? --- module/template/credits | 2 +- module/template/customize.sh | 2 - module/template/hide.prop | 16 ------- module/template/service.sh | 82 ------------------------------------ 4 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 module/template/hide.prop delete mode 100644 module/template/service.sh diff --git a/module/template/credits b/module/template/credits index ed68ab7..546d5fd 100644 --- a/module/template/credits +++ b/module/template/credits @@ -1 +1 @@ -riru-momohider huskydgfor some codes, playintegrity fork osm0sis for resetprop and samurai for boot-completed \ No newline at end of file +samurai for boot-completed \ No newline at end of file diff --git a/module/template/customize.sh b/module/template/customize.sh index 5c31446..3de5b62 100644 --- a/module/template/customize.sh +++ b/module/template/customize.sh @@ -30,9 +30,7 @@ extract "$ZIPFILE" 'verify.sh' "$TMPDIR/.vunzip" ui_print "- Extracting module files" extract "$ZIPFILE" 'module.prop' "$MODPATH" extract "$ZIPFILE" "credits" "$MODPATH" -extract "$ZIPFILE" "service.sh" "$MODPATH" extract "$ZIPFILE" "boot-completed.sh" "$MODPATH" -extract "$ZIPFILE" "hide.prop" "$MODPATH" chmod -R 755 "$MODPATH/*" diff --git a/module/template/hide.prop b/module/template/hide.prop deleted file mode 100644 index 91053ed..0000000 --- a/module/template/hide.prop +++ /dev/null @@ -1,16 +0,0 @@ -ro.boot.vbmeta.device_state=locked -ro.boot.verifiedbootstate=green -ro.boot.flash.locked=1 -ro.boot.veritymode=enforcing -ro.boot.warranty_bit=0 -ro.warranty_bit=0 -ro.debuggable=0 -ro.secure=1 -ro.adb.secure=1 -ro.build.type=user -ro.build.tags=release-keys -ro.vendor.boot.warranty_bit=0 -ro.vendor.warranty_bit=0 -vendor.boot.vbmeta.device_state=locked -vendor.boot.verifiedbootstate=green -ro.secureboot.lockstate=locked \ No newline at end of file diff --git a/module/template/service.sh b/module/template/service.sh deleted file mode 100644 index e22c387..0000000 --- a/module/template/service.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/system/bin/sh - -MODDIR="${0%/*}" - -alias resetprop="/data/adb/ap/bin/resetprop" - -# resetprop_hexpatch [-f|--force] -resetprop_hexpatch() { - case "$1" in - -f|--force) local FORCE=1; shift;; - esac - - local NAME="$1" - local NEWVALUE="$2" - local CURVALUE="$(resetprop "$NAME")" - - [ ! "$NEWVALUE" -o ! "$CURVALUE" ] && return 1 - [ "$NEWVALUE" = "$CURVALUE" -a ! "$FORCE" ] && return 1 - - local NEWLEN=${#NEWVALUE} - if [ -f /dev/__properties__ ]; then - local PROPFILE=/dev/__properties__ - else - local PROPFILE="/dev/__properties__/$(resetprop -Z "$NAME")" - fi - local NAMEOFFSET=$(echo $(strings -t d "$PROPFILE" | grep "$NAME") | cut -d ' ' -f 1) - - # - local NEWHEX="$(printf '%02x' "$NEWLEN")$(printf "$NEWVALUE" | od -A n -t x1 -v | tr -d ' \n')$(printf "%$((92-NEWLEN))s" | sed 's/ /00/g')" - - printf "Patch '$NAME' to '$NEWVALUE' in '$PROPFILE' @ 0x%08x -> \n[0000??$NEWHEX]\n" $((NAMEOFFSET-96)) - - echo -ne "\x00\x00" \ - | dd obs=1 count=2 seek=$((NAMEOFFSET-96)) conv=notrunc of="$PROPFILE" - echo -ne "$(printf "$NEWHEX" | sed -e 's/.\{2\}/&\\x/g' -e 's/^/\\x/' -e 's/\\x$//')" \ - | dd obs=1 count=93 seek=$((NAMEOFFSET-93)) conv=notrunc of="$PROPFILE" -} - -# resetprop_if_diff -resetprop_if_diff() { - local NAME="$1" - local EXPECTED="$2" - local CURRENT="$(resetprop "$NAME")" - - [ -z "$CURRENT" ] || [ "$CURRENT" == "$EXPECTED" ] || resetprop_hexpatch "$NAME" "$EXPECTED" -} - -# resetprop_if_match -resetprop_if_match() { - local NAME="$1" - local CONTAINS="$2" - local VALUE="$3" - - [[ "$(resetprop "$NAME")" == *"$CONTAINS"* ]] && resetprop_hexpatch "$NAME" "$VALUE" -} - -{ - # Reset props after boot completed to avoid breaking some weird devices/ROMs... - while [ "$(getprop sys.boot_completed)" != "1" ] - do - sleep 1 - done - - # Xiaomi cross region flash... - # See https://github.com/topjohnwu/Magisk/pull/2470 - resetprop_if_match ro.boot.hwc CN GLOBAL - resetprop_if_match ro.boot.hwcountry China GLOBAL - - # some stupid banking apps check this prop - resetprop_if_diff sys.oem_unlock_allowed 0 - - # Load MagiskHide props - resetprop -n --file "$MODDIR/hide.prop" - - # Hide that we booted from recovery when magisk is in recovery mode - resetprop_if_match "ro.bootmode" "recovery" "unknown" - resetprop_if_match "ro.boot.bootmode" "recovery" "unknown" - resetprop_if_match "vendor.boot.bootmode" "recovery" "unknown" - - resetprop --delete ro.build.selinux - -}& \ No newline at end of file