mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
No more sony init.real
tricks
Co-authored-by: canyie <a1364259@163.com> Co-authored-by: vvb2060 <vvb2060@gmail.com>
This commit is contained in:
parent
a8c2ae223a
commit
b6c24a3a8a
@ -97,7 +97,7 @@ Supported actions:
|
|||||||
test
|
test
|
||||||
Test the cpio's status
|
Test the cpio's status
|
||||||
Return value is 0 or bitwise or-ed of following values:
|
Return value is 0 or bitwise or-ed of following values:
|
||||||
0x1:Magisk 0x2:unsupported 0x4:Sony
|
0x1:Magisk 0x2:unsupported
|
||||||
patch
|
patch
|
||||||
Apply ramdisk patches
|
Apply ramdisk patches
|
||||||
Configure with env variables: KEEPVERITY KEEPFORCEENCRYPT
|
Configure with env variables: KEEPVERITY KEEPFORCEENCRYPT
|
||||||
|
@ -176,7 +176,7 @@ Supported commands:
|
|||||||
test
|
test
|
||||||
Test the cpio's status
|
Test the cpio's status
|
||||||
Return value is 0 or bitwise or-ed of following values:
|
Return value is 0 or bitwise or-ed of following values:
|
||||||
0x1:Magisk 0x2:unsupported 0x4:Sony
|
0x1:Magisk 0x2:unsupported
|
||||||
patch
|
patch
|
||||||
Apply ramdisk patches
|
Apply ramdisk patches
|
||||||
Configure with env variables: KEEPVERITY KEEPFORCEENCRYPT
|
Configure with env variables: KEEPVERITY KEEPFORCEENCRYPT
|
||||||
|
@ -18,7 +18,6 @@ pub trait MagiskCpio {
|
|||||||
|
|
||||||
const MAGISK_PATCHED: i32 = 1 << 0;
|
const MAGISK_PATCHED: i32 = 1 << 0;
|
||||||
const UNSUPPORTED_CPIO: i32 = 1 << 1;
|
const UNSUPPORTED_CPIO: i32 = 1 << 1;
|
||||||
const SONY_INIT: i32 = 1 << 2;
|
|
||||||
|
|
||||||
impl MagiskCpio for Cpio {
|
impl MagiskCpio for Cpio {
|
||||||
fn patch(&mut self) {
|
fn patch(&mut self) {
|
||||||
@ -78,9 +77,6 @@ impl MagiskCpio for Cpio {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if self.exists("init.real") {
|
|
||||||
ret |= SONY_INIT;
|
|
||||||
}
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,12 +228,6 @@ void unxz_init(const char *init_xz, const char *init) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *backup_init() {
|
const char *backup_init() {
|
||||||
if (access("/.backup/init.real", F_OK) == 0)
|
|
||||||
return "/.backup/init.real";
|
|
||||||
if (access("/.backup/init.real.xz", F_OK) == 0) {
|
|
||||||
unxz_init("/.backup/init.real.xz", "/.backup/init.real");
|
|
||||||
return "/.backup/init.real";
|
|
||||||
}
|
|
||||||
if (access("/.backup/init.xz", F_OK) == 0)
|
if (access("/.backup/init.xz", F_OK) == 0)
|
||||||
unxz_init("/.backup/init.xz", "/.backup/init");
|
unxz_init("/.backup/init.xz", "/.backup/init");
|
||||||
return "/.backup/init";
|
return "/.backup/init";
|
||||||
|
@ -139,12 +139,6 @@ case $((STATUS & 3)) in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Workaround custom legacy Sony /init -> /(s)bin/init_sony : /init.real setup
|
|
||||||
INIT=init
|
|
||||||
if [ $((STATUS & 4)) -ne 0 ]; then
|
|
||||||
INIT=init.real
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f config.orig ]; then
|
if [ -f config.orig ]; then
|
||||||
# Read existing configs
|
# Read existing configs
|
||||||
chmod 0644 config.orig
|
chmod 0644 config.orig
|
||||||
@ -187,7 +181,7 @@ fi
|
|||||||
[ -n "$SHA1" ] && echo "SHA1=$SHA1" >> config
|
[ -n "$SHA1" ] && echo "SHA1=$SHA1" >> config
|
||||||
|
|
||||||
./magiskboot cpio ramdisk.cpio \
|
./magiskboot cpio ramdisk.cpio \
|
||||||
"add 0750 $INIT magiskinit" \
|
"add 0750 init magiskinit" \
|
||||||
"mkdir 0750 overlay.d" \
|
"mkdir 0750 overlay.d" \
|
||||||
"mkdir 0750 overlay.d/sbin" \
|
"mkdir 0750 overlay.d/sbin" \
|
||||||
"$SKIP32 add 0644 overlay.d/sbin/magisk32.xz magisk32.xz" \
|
"$SKIP32 add 0644 overlay.d/sbin/magisk32.xz magisk32.xz" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user