Skip to content

Commit ed78400

Browse files
committed
Unified 3.2.7
Changelog: - Integrated custom recovery installation - Restricted minimum installation starting from API 21 - Updated hosts to 3.2.7 - Updated template (dropped MMT-Extended) Signed-off-by: Gloeyisk <[email protected]>
1 parent 968a0a9 commit ed78400

File tree

11 files changed

+1122
-838
lines changed

11 files changed

+1122
-838
lines changed

.gitattributes

Lines changed: 0 additions & 9 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

META-INF/com/google/android/update-binary

Lines changed: 6 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -6,168 +6,28 @@
66

77
umask 022
88

9-
# Global vars
10-
TMPDIR=/dev/tmp
11-
PERSISTDIR=/sbin/.magisk/mirror/persist
12-
13-
rm -rf $TMPDIR 2>/dev/null
14-
mkdir -p $TMPDIR
15-
169
# echo before loading util_functions
1710
ui_print() { echo "$1"; }
1811

1912
require_new_magisk() {
2013
ui_print "*******************************"
21-
ui_print " Please install Magisk v19.0+! "
14+
ui_print " Please install Magisk v20.4+! "
2215
ui_print "*******************************"
2316
exit 1
2417
}
2518

26-
is_legacy_script() {
27-
unzip -l "$ZIPFILE" install.sh | grep -q install.sh
28-
return $?
29-
}
30-
31-
print_modname() {
32-
local len
33-
len=`echo -n $MODNAME | wc -c`
34-
len=$((len + 2))
35-
local pounds=`printf "%${len}s" | tr ' ' '*'`
36-
ui_print "$pounds"
37-
ui_print " $MODNAME "
38-
ui_print "$pounds"
39-
ui_print "*******************"
40-
ui_print " Powered by Magisk "
41-
ui_print "*******************"
42-
}
43-
44-
##############
45-
# Environment
46-
##############
19+
#########################
20+
# Load util_functions.sh
21+
#########################
4722

4823
OUTFD=$2
4924
ZIPFILE=$3
5025

5126
mount /data 2>/dev/null
5227

53-
# Load utility functions
5428
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
5529
. /data/adb/magisk/util_functions.sh
56-
[ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk
57-
58-
# Preperation for flashable zips
59-
setup_flashable
60-
61-
# Mount partitions
62-
mount_partitions
63-
64-
# Detect version and architecture
65-
api_level_arch_detect
66-
67-
# Setup busybox and binaries
68-
$BOOTMODE && boot_actions || recovery_actions
69-
70-
##############
71-
# Preparation
72-
##############
73-
74-
# Extract prop file
75-
unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2
76-
[ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!"
77-
78-
$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
79-
MODULEROOT=$NVBASE/$MODDIRNAME
80-
MODID=`grep_prop id $TMPDIR/module.prop`
81-
MODPATH=$MODULEROOT/$MODID
82-
MODNAME=`grep_prop name $TMPDIR/module.prop`
83-
84-
# Create mod paths
85-
rm -rf $MODPATH 2>/dev/null
86-
mkdir -p $MODPATH
87-
88-
##########
89-
# Install
90-
##########
91-
92-
if is_legacy_script; then
93-
unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2
94-
95-
# Load install script
96-
. $TMPDIR/install.sh
97-
98-
# Callbacks
99-
print_modname
100-
on_install
101-
102-
# Custom uninstaller
103-
[ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh
104-
105-
# Skip mount
106-
$SKIPMOUNT && touch $MODPATH/skip_mount
107-
108-
# prop file
109-
$PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop
110-
111-
# Module info
112-
cp -af $TMPDIR/module.prop $MODPATH/module.prop
113-
114-
# post-fs-data scripts
115-
$POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh
116-
117-
# service scripts
118-
$LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh
119-
120-
ui_print "- Setting permissions"
121-
set_permissions
122-
else
123-
print_modname
124-
125-
unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2
126-
127-
if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then
128-
ui_print "- Extracting module files"
129-
unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2
130-
131-
# Default permissions
132-
set_perm_recursive $MODPATH 0 0 0755 0644
133-
fi
134-
135-
# Load customization script
136-
[ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh
137-
fi
138-
139-
# Handle replace folders
140-
for TARGET in $REPLACE; do
141-
ui_print "- Replace target: $TARGET"
142-
mktouch $MODPATH$TARGET/.replace
143-
done
144-
145-
if $BOOTMODE; then
146-
# Update info for Magisk Manager
147-
mktouch $NVBASE/modules/$MODID/update
148-
cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop
149-
fi
150-
151-
# Copy over custom sepolicy rules
152-
if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then
153-
ui_print "- Installing custom sepolicy patch"
154-
PERSISTMOD=$PERSISTDIR/magisk/$MODID
155-
mkdir -p $PERSISTMOD
156-
cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule
157-
fi
158-
159-
# Remove stuffs that don't belong to modules
160-
rm -rf \
161-
$MODPATH/system/placeholder $MODPATH/customize.sh \
162-
$MODPATH/README.md $MODPATH/.git* 2>/dev/null
163-
164-
##############
165-
# Finalizing
166-
##############
167-
168-
cd /
169-
$BOOTMODE || recovery_cleanup
170-
rm -rf $TMPDIR
30+
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
17131

172-
ui_print "- Done"
32+
install_module
17333
exit 0

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
## Overview:
44
- Essential repack for latest Unified hosts, with 3 additional extensions.
5-
- Built upon Unified Release by **@StevenBlack**.
65
- Patching process is handled by a command script, which detects default hosts file location.
7-
- Currently support live install only.
6+
- Support API 21 or later.
7+
- Support Magisk Live or Custom Recovery installations.
88

99
## Contents:
1010
- Base extensions
11-
hosts: 3.2.6 (1123)
12-
module: 14.3 (1123)
13-
code: 143
11+
hosts: 3.2.7 (1126)
12+
module: 14.4 (1126)
13+
code: 144
1414

1515
## Credits:
1616
- [@topjohnwu](https://github.com/topjohnwu) / Magisk - Magisk Module Template
17-
- [@Zackptg5](https://github.com/Zackptg5) / MMT-Extended
1817
- [@StevenBlack](https://github.com/StevenBlack) / Hosts
1918
- [@JumbomanXDA](https://github.com/JumbomanXDA) / Custom installation script
2019

common/addon/placeholder

Whitespace-only changes.

0 commit comments

Comments
 (0)