Skip to content

Commit 95476fe

Browse files
committed
Initial commit
1 parent 3894bd3 commit 95476fe

6 files changed

Lines changed: 107 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#################
2+
# Initialization
3+
#################
4+
5+
umask 022
6+
7+
# echo before loading util_functions
8+
ui_print() { echo "$1"; }
9+
10+
require_new_magisk() {
11+
ui_print "*******************************"
12+
ui_print " Please install Magisk v20.4+! "
13+
ui_print "*******************************"
14+
exit 1
15+
}
16+
17+
#########################
18+
# Load util_functions.sh
19+
#########################
20+
21+
OUTFD=$2
22+
ZIPFILE=$3
23+
24+
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
25+
. /data/adb/magisk/util_functions.sh
26+
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
27+
28+
install_module
29+
exit 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#MAGISK

customize.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# shellcheck disable=SC2034
2+
SKIPUNZIP=1
3+
4+
enforce_install_from_app() {
5+
if $BOOTMODE; then
6+
ui_print "- Installing from Magisk / KernelSU app"
7+
else
8+
ui_print "*********************************************************"
9+
ui_print "! Install from recovery is NOT supported"
10+
ui_print "! Recovery sucks"
11+
ui_print "! Please install from Magisk / KernelSU app"
12+
abort "*********************************************************"
13+
fi
14+
}
15+
16+
VERSION=$(grep_prop version "${TMPDIR}/module.prop")
17+
ui_print "- Factory Props version ${VERSION}"
18+
19+
unzip -o "$ZIPFILE" 'module.prop' -d "$MODPATH" >&2
20+
unzip -o "$ZIPFILE" 'service.sh' -d "$MODPATH" >&2
21+
unzip -o "$ZIPFILE" 'uninstall.sh' -d "$MODPATH" >&2
22+
23+
set_perm_recursive $MODPATH 0 0 0755 0644

module.prop

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
id=factory_props
2+
name=FactoryProps
3+
version=v0.1.1
4+
versionCode=11
5+
author=mhmrdd
6+
description=Utilizes shamiko's bootloader spoofing properties.

service.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/system/bin/sh
2+
3+
check_reset_prop() {
4+
local NAME=$1
5+
local EXPECTED=$2
6+
local VALUE=$(resetprop $NAME)
7+
[ -z $VALUE ] || [ $VALUE = $EXPECTED ] || resetprop $NAME $EXPECTED
8+
}
9+
10+
contains_reset_prop() {
11+
local NAME=$1
12+
local CONTAINS=$2
13+
local NEWVAL=$3
14+
[[ "$(resetprop $NAME)" = *"$CONTAINS"* ]] && resetprop $NAME $NEWVAL
15+
}
16+
17+
resetprop -w sys.boot_completed 0
18+
19+
check_reset_prop "ro.boot.vbmeta.device_state" "locked"
20+
check_reset_prop "ro.boot.verifiedbootstate" "green"
21+
check_reset_prop "ro.boot.flash.locked" "1"
22+
check_reset_prop "ro.boot.veritymode" "enforcing"
23+
check_reset_prop "ro.boot.warranty_bit" "0"
24+
check_reset_prop "ro.warranty_bit" "0"
25+
check_reset_prop "ro.debuggable" "0"
26+
check_reset_prop "ro.force.debuggable" "0"
27+
check_reset_prop "ro.secure" "1"
28+
check_reset_prop "ro.adb.secure" "1"
29+
check_reset_prop "ro.build.type" "user"
30+
check_reset_prop "ro.build.tags" "release-keys"
31+
check_reset_prop "ro.vendor.boot.warranty_bit" "0"
32+
check_reset_prop "ro.vendor.warranty_bit" "0"
33+
check_reset_prop "vendor.boot.vbmeta.device_state" "locked"
34+
check_reset_prop "vendor.boot.verifiedbootstate" "green"
35+
check_reset_prop "sys.oem_unlock_allowed" "0"
36+
37+
# MIUI specific
38+
check_reset_prop "ro.secureboot.lockstate" "locked"
39+
40+
# Realme specific
41+
check_reset_prop "ro.boot.realmebootstate" "green"
42+
check_reset_prop "ro.boot.realme.lockstate" "1"
43+
44+
# Hide that we booted from recovery when magisk is in recovery mode
45+
contains_reset_prop "ro.bootmode" "recovery" "unknown"
46+
contains_reset_prop "ro.boot.bootmode" "recovery" "unknown"
47+
contains_reset_prop "vendor.boot.bootmode" "recovery" "unknown"

uninstall.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rm -rf /data/adb/factory_props

0 commit comments

Comments
 (0)