add x86
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE := ksigam
|
LOCAL_MODULE := magisk
|
||||||
LOCAL_SRC_FILES := magisk.apk
|
LOCAL_SRC_FILES := magisk.apk
|
||||||
LOCAL_MODULE_CLASS := APPS
|
LOCAL_MODULE_CLASS := APPS
|
||||||
LOCAL_CERTIFICATE := platform
|
LOCAL_CERTIFICATE := platform
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
magisk
|
||||||
|
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
vendor/magisk/magisk.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk.rc \
|
||||||
|
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/magisk,$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk) \
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
magisk
|
||||||
|
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
vendor/magisk/magisk.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk.rc \
|
||||||
|
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/magisk,$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk) \
|
||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
ksigam
|
magisk
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
vendor/magisk/magisk.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/ksigam.rc \
|
vendor/magisk/magisk.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk.rc \
|
||||||
$(call find-copy-subdir-files,*,vendor/magisk/rootfs/vendor/etc/init,$(TARGET_COPY_OUT_VENDOR)/etc/init) \
|
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/magisk,$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk) \
|
||||||
|
|
||||||
|
|||||||
+59
-8
@@ -11,33 +11,84 @@ def main():
|
|||||||
current_path = os.path.dirname(os.path.abspath(__file__))
|
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
apk_path = os.path.join(current_path, "magisk.apk")
|
apk_path = os.path.join(current_path, "magisk.apk")
|
||||||
unzip_path = os.path.join(current_path, "temp")
|
unzip_path = os.path.join(current_path, "temp")
|
||||||
overlay_path = os.path.join(current_path, "rootfs")
|
|
||||||
overlay_magisk_path = os.path.join(overlay_path, "vendor", "etc", "init", "ksigam")
|
|
||||||
overlay_init_path = os.path.join(overlay_path, "vendor", "etc", "init", "ksigam.rc")
|
|
||||||
|
|
||||||
shutil.rmtree(unzip_path, ignore_errors=True)
|
shutil.rmtree(unzip_path, ignore_errors=True)
|
||||||
os.makedirs(unzip_path, exist_ok=True)
|
os.makedirs(unzip_path, exist_ok=True)
|
||||||
atexit.register(shutil.rmtree, unzip_path, ignore_errors=True)
|
atexit.register(shutil.rmtree, unzip_path, ignore_errors=True)
|
||||||
|
|
||||||
print("==> Extracting archive...")
|
print("==> Extracting archive ...")
|
||||||
with zipfile.ZipFile(apk_path) as z:
|
with zipfile.ZipFile(apk_path) as z:
|
||||||
z.extractall(unzip_path)
|
z.extractall(unzip_path)
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
########################################################
|
||||||
|
print("==> Installing magisk(arm64) now ...")
|
||||||
|
overlay_path = os.path.join(current_path, "arm64", "magisk")
|
||||||
shutil.rmtree(overlay_path, ignore_errors=True)
|
shutil.rmtree(overlay_path, ignore_errors=True)
|
||||||
os.makedirs(overlay_magisk_path, exist_ok=True)
|
os.makedirs(overlay_path, exist_ok=True)
|
||||||
|
|
||||||
print("==> Installing magisk now ...")
|
|
||||||
lib64_path = os.path.join(unzip_path, "lib", "arm64-v8a")
|
lib64_path = os.path.join(unzip_path, "lib", "arm64-v8a")
|
||||||
for parent, dirnames, filenames in os.walk(lib64_path):
|
for parent, dirnames, filenames in os.walk(lib64_path):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
so_path = os.path.join(lib64_path, filename)
|
so_path = os.path.join(lib64_path, filename)
|
||||||
so_name = re.search(r"lib(.*)\.so", filename)
|
so_name = re.search(r"lib(.*)\.so", filename)
|
||||||
target_path = os.path.join(overlay_magisk_path, so_name.group(1))
|
target_path = os.path.join(overlay_path, so_name.group(1))
|
||||||
shutil.copyfile(so_path, target_path)
|
shutil.copyfile(so_path, target_path)
|
||||||
subprocess.check_call(["chmod", "+x", target_path])
|
subprocess.check_call(["chmod", "+x", target_path])
|
||||||
|
|
||||||
lib32_path = os.path.join(unzip_path, "lib", "armeabi-v7a")
|
lib32_path = os.path.join(unzip_path, "lib", "armeabi-v7a")
|
||||||
shutil.copyfile(os.path.join(lib32_path, "libmagisk32.so"), os.path.join(overlay_magisk_path, "magisk32"))
|
shutil.copyfile(os.path.join(lib32_path, "libmagisk32.so"), os.path.join(overlay_path, "magisk32"))
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
########################################################
|
||||||
|
print("==> Installing magisk(arm64_only) now ...")
|
||||||
|
overlay_path = os.path.join(current_path, "arm64_only", "magisk")
|
||||||
|
shutil.rmtree(overlay_path, ignore_errors=True)
|
||||||
|
os.makedirs(overlay_path, exist_ok=True)
|
||||||
|
|
||||||
|
lib64_path = os.path.join(unzip_path, "lib", "arm64-v8a")
|
||||||
|
for parent, dirnames, filenames in os.walk(lib64_path):
|
||||||
|
for filename in filenames:
|
||||||
|
so_path = os.path.join(lib64_path, filename)
|
||||||
|
so_name = re.search(r"lib(.*)\.so", filename)
|
||||||
|
target_path = os.path.join(overlay_path, so_name.group(1))
|
||||||
|
shutil.copyfile(so_path, target_path)
|
||||||
|
subprocess.check_call(["chmod", "+x", target_path])
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
########################################################
|
||||||
|
print("==> Installing magisk(x86_64) now ...")
|
||||||
|
overlay_path = os.path.join(current_path, "x86_64", "magisk")
|
||||||
|
shutil.rmtree(overlay_path, ignore_errors=True)
|
||||||
|
os.makedirs(overlay_path, exist_ok=True)
|
||||||
|
|
||||||
|
lib64_path = os.path.join(unzip_path, "lib", "arm64-v8a")
|
||||||
|
for parent, dirnames, filenames in os.walk(lib64_path):
|
||||||
|
for filename in filenames:
|
||||||
|
so_path = os.path.join(lib64_path, filename)
|
||||||
|
so_name = re.search(r"lib(.*)\.so", filename)
|
||||||
|
target_path = os.path.join(overlay_path, so_name.group(1))
|
||||||
|
shutil.copyfile(so_path, target_path)
|
||||||
|
subprocess.check_call(["chmod", "+x", target_path])
|
||||||
|
|
||||||
|
lib32_path = os.path.join(unzip_path, "lib", "x86")
|
||||||
|
shutil.copyfile(os.path.join(lib32_path, "libmagisk32.so"), os.path.join(overlay_path, "magisk32"))
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
########################################################
|
||||||
|
print("==> Installing magisk(x86_64_only) now ...")
|
||||||
|
overlay_path = os.path.join(current_path, "x86_64_only", "magisk")
|
||||||
|
shutil.rmtree(overlay_path, ignore_errors=True)
|
||||||
|
os.makedirs(overlay_path, exist_ok=True)
|
||||||
|
|
||||||
|
lib64_path = os.path.join(unzip_path, "lib", "x86_64")
|
||||||
|
for parent, dirnames, filenames in os.walk(lib64_path):
|
||||||
|
for filename in filenames:
|
||||||
|
so_path = os.path.join(lib64_path, filename)
|
||||||
|
so_name = re.search(r"lib(.*)\.so", filename)
|
||||||
|
target_path = os.path.join(overlay_path, so_name.group(1))
|
||||||
|
shutil.copyfile(so_path, target_path)
|
||||||
|
subprocess.check_call(["chmod", "+x", target_path])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
on post-fs-data
|
on post-fs-data && property:ro.boot.redroid_magisk=1
|
||||||
start logd
|
start logd
|
||||||
chmod 0755 /vendor/etc/init/ksigam/magisk64
|
chmod 0755 /vendor/etc/init/magisk/magisk64
|
||||||
chmod 0755 /vendor/etc/init/ksigam/magiskpolicy
|
chmod 0755 /vendor/etc/init/magisk/magiskpolicy
|
||||||
exec u:r:su:s0 root root -- /vendor/etc/init/ksigam/magisk64 --auto-selinux --setup-sbin /vendor/etc/init/ksigam
|
exec u:r:su:s0 root root -- /vendor/etc/init/magisk/magisk64 --auto-selinux --setup-sbin /vendor/etc/init/magisk
|
||||||
exec u:r:su:s0 root root -- /vendor/etc/init/ksigam/magiskpolicy --live --magisk "allow * magisk_file lnk_file *"
|
exec u:r:su:s0 root root -- /vendor/etc/init/magisk/magiskpolicy --live --magisk "allow * magisk_file lnk_file *"
|
||||||
mkdir /sbin/.magisk 700
|
mkdir /sbin/.magisk 700
|
||||||
mkdir /sbin/.magisk/mirror 700
|
mkdir /sbin/.magisk/mirror 700
|
||||||
mkdir /sbin/.magisk/block 700
|
mkdir /sbin/.magisk/block 700
|
||||||
@@ -12,25 +12,27 @@ on post-fs-data
|
|||||||
start 7zKkuZ1ZhD
|
start 7zKkuZ1ZhD
|
||||||
wait /dev/.magisk_unblock 40
|
wait /dev/.magisk_unblock 40
|
||||||
rm /dev/.magisk_unblock
|
rm /dev/.magisk_unblock
|
||||||
|
start wHgGlkRCtMoIQw
|
||||||
|
|
||||||
service 7zKkuZ1ZhD /sbin/magisk --auto-selinux --post-fs-data
|
service 7zKkuZ1ZhD /sbin/magisk --auto-selinux --post-fs-data
|
||||||
user root
|
user root
|
||||||
seclabel u:r:su:s0
|
seclabel u:r:su:s0
|
||||||
oneshot
|
oneshot
|
||||||
|
disabled
|
||||||
|
|
||||||
service wHgGlkRCtMoIQw /sbin/magisk --auto-selinux --service
|
service wHgGlkRCtMoIQw /sbin/magisk --auto-selinux --service
|
||||||
class late_start
|
|
||||||
user root
|
user root
|
||||||
seclabel u:r:su:s0
|
seclabel u:r:su:s0
|
||||||
oneshot
|
oneshot
|
||||||
|
disabled
|
||||||
|
|
||||||
on property:sys.boot_completed=1
|
on property:sys.boot_completed=1 && property:ro.boot.redroid_magisk=1
|
||||||
mkdir /data/adb/magisk 755
|
mkdir /data/adb/magisk 755
|
||||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --boot-complete
|
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --boot-complete
|
||||||
exec -- /system/bin/sh -c "if [ ! -e /data/data/io.github.huskydg.magisk ] ; then pm install /vendor/etc/init/ksigam/ksigam.apk ; fi"
|
exec -- /system/bin/sh -c "if [ ! -e /data/data/io.github.huskydg.magisk ] ; then pm install /vendor/etc/init/magisk/magisk.apk ; fi"
|
||||||
|
|
||||||
on property:init.svc.zygote=restarting
|
on property:init.svc.zygote=restarting && property:ro.boot.redroid_magisk=1
|
||||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart
|
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart
|
||||||
|
|
||||||
on property:init.svc.zygote=stopped
|
on property:init.svc.zygote=stopped && property:ro.boot.redroid_magisk=1
|
||||||
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart
|
exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
magisk
|
||||||
|
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
vendor/magisk/magisk.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk.rc \
|
||||||
|
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/magisk,$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk) \
|
||||||
Executable
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
magisk
|
||||||
|
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
vendor/magisk/magisk.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk.rc \
|
||||||
|
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/magisk,$(TARGET_COPY_OUT_VENDOR)/etc/init/magisk) \
|
||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user