├── .gitattributes ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── common ├── post-fs-data.sh ├── service.sh └── system.prop ├── config.sh ├── envvar.sh ├── extracmd.sh ├── install.sh ├── module.prop ├── patch └── files go in here ├── script └── scripts_sample.sh ├── system └── placeholder └── tools ├── zip └── zipalign /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | META-INF/** text eol=lf 3 | *.prop text eol=lf 4 | *.sh text eol=lf 5 | *.md text eol=lf 6 | 7 | # Denote all files that are truly binary and should not be modified. 8 | system/** binary 9 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | TMPDIR=/dev/tmp 4 | MOUNTPATH=/dev/magisk_img 5 | 6 | # Default permissions 7 | umask 022 8 | 9 | # Initial cleanup 10 | rm -rf $TMPDIR 2>/dev/null 11 | mkdir -p $TMPDIR 12 | 13 | # echo before loading util_functions 14 | ui_print() { echo "$1"; } 15 | 16 | require_new_magisk() { 17 | ui_print "***********************************" 18 | ui_print " Please install the latest Magisk! " 19 | ui_print "***********************************" 20 | exit 1 21 | } 22 | 23 | imageless_magisk() { 24 | [ $MAGISK_VER_CODE -gt 18100 ] 25 | return $? 26 | } 27 | 28 | ########################################################################################## 29 | # Environment 30 | 31 | show_progress() { echo "progress $1 $2" > $OUTFD; } 32 | set_progress() { echo "set_progress $1" > $OUTFD; } 33 | abort() { ui_print " "; ui_print "$*"; exit 1; } 34 | 35 | ########################################################################################## 36 | 37 | OUTFD=$2 38 | ZIPFILE=$3 39 | 40 | mount /data 2>/dev/null 41 | 42 | # Load utility functions 43 | if [ -f /data/adb/magisk/util_functions.sh ]; then 44 | . /data/adb/magisk/util_functions.sh 45 | NVBASE=/data/adb 46 | else 47 | require_new_magisk 48 | fi 49 | 50 | # Preperation for flashable zips 51 | setup_flashable 52 | 53 | # Mount partitions 54 | mount_partitions 55 | 56 | # Detect version and architecture 57 | api_level_arch_detect 58 | 59 | # Setup busybox and binaries 60 | $BOOTMODE && boot_actions || recovery_actions 61 | 62 | ########################################################################################## 63 | # Preparation 64 | ########################################################################################## 65 | 66 | # Extract common files 67 | unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2 68 | 69 | [ ! -f $TMPDIR/install.sh ] && abort "! Unable to extract zip file!" 70 | # Load install script 71 | . $TMPDIR/install.sh 72 | 73 | if imageless_magisk; then 74 | $BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules 75 | MODULEROOT=$NVBASE/$MODDIRNAME 76 | else 77 | $BOOTMODE && IMGNAME=magisk_merge.img || IMGNAME=magisk.img 78 | IMG=$NVBASE/$IMGNAME 79 | request_zip_size_check "$ZIPFILE" 80 | mount_magisk_img 81 | MODULEROOT=$MOUNTPATH 82 | fi 83 | 84 | MODID=`grep_prop id $TMPDIR/module.prop` 85 | MODPATH=$MODULEROOT/$MODID 86 | 87 | print_modname 88 | 89 | ui_print "******************************" 90 | ui_print "Powered by Magisk (@topjohnwu)" 91 | ui_print "and APK-Patcher Lite (@djb77)" 92 | ui_print "******************************" 93 | 94 | ########################################################################################## 95 | # Install 96 | ########################################################################################## 97 | 98 | # Create mod paths 99 | rm -rf $MODPATH 2>/dev/null 100 | mkdir -p $MODPATH 101 | 102 | # Remove placeholder 103 | rm -f $MODPATH/system/placeholder 2>/dev/null 104 | 105 | ########################################################################################## 106 | # APK-Patcher Lite Main 107 | ########################################################################################## 108 | 109 | magiskdir=$PWD 110 | 111 | # working directory variables 112 | ap=$TMPDIR/apkpatcher 113 | bin=$ap/tools 114 | patch=$ap/patch 115 | script=$ap/script 116 | 117 | show_progress 1.34 0 118 | 119 | # extract apkpatcher 120 | mkdir -p $ap 121 | cd $ap 122 | ui_print "- Extracting Files for APK-Patcher Lite" 123 | unzip -o "$ZIP" envvar.sh extracmd.sh 'patch/*' 'script/*' 'tools/*' -d $ap >&2 124 | 125 | # set up extracted files and directories 126 | chmod -R 755 $bin $script $ap/*.sh 127 | 128 | # import variables 129 | . $ap/envvar.sh 130 | 131 | ui_print "- Patching Files" 132 | amount=$((100 / `echo $apklist | wc -w`)) 133 | subamt=$(awk -v num=$amount 'BEGIN { print num / 10}') 134 | for apkp_target in $apklist; do 135 | ui_print " " 136 | ui_print "- $apkp_target" 137 | apkname=$(basename $apkp_target .apk) 138 | 139 | # copy in apkp_target system file to patch 140 | sysfile=`find /system -mindepth 2 -name $apkp_target` 141 | cp -fp $sysfile $ap 142 | progress=$((progress + subamt)) 143 | set_progress $(awk -v num=$progress 'BEGIN { print num / 100}') 144 | 145 | # make a backup if set 146 | if [ "$backup" == 1 ]; then 147 | ui_print " Backup APK" 148 | mkdir -p $apkbak 149 | cp -fp $sysfile $apkbak 150 | fi 151 | progress=$((progress + subamt)) 152 | set_progress $(awk -v num=$progress 'BEGIN { print num / 100}') 153 | 154 | # file patches 155 | if [ -d $patch/$apkname ]; then 156 | mv $ap/$apkname.apk $ap/$apkname.zip 157 | 158 | # delete unwanted files 159 | if [ -f $script/$apkname.sh ]; then 160 | ui_print " Remove files" 161 | . $script/$apkname.sh 162 | for remove in $fileremove; do 163 | $bin/zip -d $ap/$apkname.zip $remove 164 | done 165 | fi 166 | 167 | # continue patching 168 | ui_print " Inject files" 169 | cd $patch/$apkname 170 | $bin/zip -r -9 $ap/$apkname.zip * 171 | if [ -f resources.arsc ]; then 172 | $bin/zip -r -0 $ap/$apkname.zip resources.arsc 173 | fi 174 | cd $ap 175 | mv $ap/$apkname.zip $ap/$apkname.apk 176 | fi 177 | progress=$((progress + subamt)) 178 | set_progress $(awk -v num=$progress 'BEGIN { print num / 100}') 179 | 180 | # zipalign updated file 181 | ui_print " Zipaligning APK" 182 | cp -f $apkp_target $apkname-preopt.apk 183 | rm $apkp_target 184 | $bin/zipalign -p 4 $apkname-preopt.apk $apkp_target 185 | progress=$((progress + subamt)) 186 | set_progress $(awk -v num=$progress 'BEGIN { print num / 100}') 187 | 188 | # copy patched file back to system 189 | ui_print " Copy APK to Magisk Module" 190 | mkdir -p $MODPATH$sysfile 191 | cd $MODPATH$sysfile 192 | cd .. 193 | rm -rf * 194 | magiskcopy=$PWD 195 | cd $ap 196 | cp -fp $apkp_target $magiskcopy 197 | progress=$((progress + subamt)) 198 | set_progress $(awk -v num=$progress 'BEGIN { print num / 100}') 199 | 200 | # remove temp files if cleanup is set 201 | if [ "$cleanup" == 1 ]; then 202 | ui_print " Clean up work area" 203 | rm -rf $apkp_target $apkname-preopt.apk 204 | fi; 205 | progress=$((progress + subamt)) 206 | set_progress $(awk -v num=$progress 'BEGIN { print num / 100}') 207 | done; 208 | 209 | # extra required non-patch changes 210 | ui_print " " 211 | ui_print "- Run extra commands" 212 | . $ap/extracmd.sh 213 | set_progress 1.2 214 | 215 | # cleanup as necessary 216 | if [ "$cleanup" == 1 ]; then 217 | ui_print "- Cleaning up..." 218 | rm -rf $ap 219 | fi 220 | 221 | ui_print " " 222 | 223 | ########################################################################################## 224 | # Back to Magisk 225 | ########################################################################################## 226 | 227 | # Custom uninstaller 228 | [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh 229 | 230 | # Auto Mount 231 | if imageless_magisk; then 232 | $SKIPMOUNT && touch $MODPATH/skip_mount 233 | else 234 | $SKIPMOUNT || touch $MODPATH/auto_mount 235 | fi 236 | 237 | # prop files 238 | $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop 239 | 240 | # Module info 241 | cp -af $TMPDIR/module.prop $MODPATH/module.prop 242 | if $BOOTMODE; then 243 | # Update info for Magisk Manager 244 | if imageless_magisk; then 245 | mktouch $NVBASE/modules/$MODID/update 246 | cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop 247 | else 248 | mktouch /sbin/.magisk/img/$MODID/update 249 | cp -af $TMPDIR/module.prop /sbin/.magisk/img/$MODID/module.prop 250 | fi 251 | fi 252 | 253 | # post-fs-data mode scripts 254 | $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh 255 | 256 | # service mode scripts 257 | $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh 258 | 259 | on_install 260 | 261 | # Handle replace folders 262 | for TARGET in $REPLACE; do 263 | mktouch $MODPATH$TARGET/.replace 264 | done 265 | 266 | ui_print "- Setting permissions" 267 | set_permissions 268 | 269 | ########################################################################################## 270 | # Finalizing 271 | ########################################################################################## 272 | 273 | cd / 274 | imageless_magisk || unmount_magisk_img 275 | $BOOTMODE || recovery_cleanup 276 | rm -rf $TMPDIR $MOUNTPATH 277 | 278 | ui_print "- Done" 279 | exit 0 280 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # APK-Patcher Lite for Magisk 2 | 3 | Flashable Zip Template for Modifying System APKs On-Device 4 | 5 | Based on [APK-Patcher](https://github.com/osm0sis/APK-Patcher) by osm0sis @ xda-developers 6 | 7 | **Update `README.md` if you want to submit your module to the online repo!** 8 | 9 | For more information about how to use this module installer, please refer to [documentations](https://topjohnwu.github.io/Magisk/guides.html) 10 | 11 | If you are not familiar with the Markdown syntax, you can start by experimenting on GitHub's online Markdown editor, which will let you preview before publishing. If you need more help, the [Markdown Cheat Sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) will be handy. 12 | 13 | 14 | ## Information 15 | 16 | This is a modified version of APK-Patcher that will delete / inject files into System APK files instead of using a baksmali / apktool method. 17 | 18 | The method used here is a similar method used in my ROMs to patch files, where instead of having to have like for example 4 SystemUI files, I only needed to keep the actual files that were changed. This method could also be used quite easily to apply OTA updates or addons on already pre-modified APK files. 19 | 20 | 21 | ## Usage 22 | 23 | * Copy your pre-compiled resource files (including .dex files) to the patch folder, removing the .apk part of the filename (ie: SystemUI) 24 | 25 | * Create a file in scripts with the same name (ie: SystemUI.sh) if you want to delete any existing files from the APK 26 | 27 | * Make edits to envvar.sh, and also to extracmd.sh if needed 28 | 29 | 30 | ### Properties / Variables (envvar.sh) 31 | 32 | * banner=""; 33 | * apklist=""; 34 | * apkbak=/data/media/0/APK-Backup; 35 | * backup=1; 36 | * cleanup=1; 37 | 38 | **banner** is the name of your patch zip, usually suggestive of what it does, to be displayed at the beginning of the zip flash. You should include your name/handle here like "by osm0sis @ xda-developers" for credit purposes. 39 | 40 | **apklist** is a string containing the list of APKs to be patched included in the patch zip, separated by spaces between the quotes. Each APK is automatically found recursively in /system, then copied to the working directory to be decompiled and acted on, then copied back to /system. 41 | 42 | **apkbak** is the location to place backups of the untouched APKs in apklist if backup=1 is set. 43 | 44 | **backup=1** will store backups of the untouched APKs in the location specified in apkbak. 45 | 46 | **cleanup=0** will keep the zip from removing it's working directory in /tmp/apkpatcher - this can be useful if trying to debug in adb shell whether the patches worked correctly. cleanup=1 is necessary on multi-APK patching zips, so it's recommended each APK to be patched be tested on their own with cleanup=0 before combining into a single zip. 47 | 48 | 49 | ### envvar.sh 50 | 51 | Modify the envvar.sh to add your banner, apklist, backup and cleanup options 52 | 53 | Multiple files can be patched, put a space between the filenames (ie: apklist="file1.apk file2.apk";) 54 | 55 | 56 | ### extracmd.sh 57 | 58 | Modify the extracmd.sh to add any additional commands to be performed at the end of the patching process that aren't patch-related (/data file changes, 59 | 60 | 61 | ### scripts/$apkname.sh 62 | 63 | * fileremove=""; 64 | 65 | $apkname is the name of the folder that you put your resources files in. Copy scripts_sample.sh and rename it to your APK (ie: SystemUI.sh) 66 | 67 | Multiple files can be deleted, put a space between the paths (ie: fileremove="/res/drawable/file1.png /res/drawable/file1.png";) 68 | 69 | 70 | -------------------------------------------------------------------------------- /common/post-fs-data.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Do NOT assume where your module will be located. 3 | # ALWAYS use $MODDIR if you need to know where this script 4 | # and module is placed. 5 | # This will make sure your module will still work 6 | # if Magisk change its mount point in the future 7 | MODDIR=${0%/*} 8 | 9 | # This script will be executed in post-fs-data mode 10 | -------------------------------------------------------------------------------- /common/service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Do NOT assume where your module will be located. 3 | # ALWAYS use $MODDIR if you need to know where this script 4 | # and module is placed. 5 | # This will make sure your module will still work 6 | # if Magisk change its mount point in the future 7 | MODDIR=${0%/*} 8 | 9 | # This script will be executed in late_start service mode 10 | -------------------------------------------------------------------------------- /common/system.prop: -------------------------------------------------------------------------------- 1 | # This file will be read by resetprop 2 | # Example: Change dpi 3 | # ro.sf.lcd_density=320 4 | -------------------------------------------------------------------------------- /config.sh: -------------------------------------------------------------------------------- 1 | ########################################################################################## 2 | # 3 | # Magisk Module Template Config Script 4 | # by topjohnwu 5 | # 6 | ########################################################################################## 7 | ########################################################################################## 8 | # 9 | # Instructions: 10 | # 11 | # 1. Place your files into system folder (delete the placeholder file) 12 | # 2. Fill in your module's info into module.prop 13 | # 3. Configure the settings in this file (config.sh) 14 | # 4. If you need boot scripts, add them into common/post-fs-data.sh or common/service.sh 15 | # 5. Add your additional or modified system properties into common/system.prop 16 | # 17 | ########################################################################################## 18 | 19 | ########################################################################################## 20 | # Configs 21 | ########################################################################################## 22 | 23 | # Set to true if you need to enable Magic Mount 24 | # Most mods would like it to be enabled 25 | AUTOMOUNT=true 26 | 27 | # Set to true if you need to load system.prop 28 | PROPFILE=false 29 | 30 | # Set to true if you need post-fs-data script 31 | POSTFSDATA=false 32 | 33 | # Set to true if you need late_start service script 34 | LATESTARTSERVICE=false 35 | 36 | ########################################################################################## 37 | # Installation Message 38 | ########################################################################################## 39 | 40 | # Set what you want to show when installing your mod 41 | 42 | print_modname() { 43 | ui_print "*******************************" 44 | ui_print " Magisk Module Template " 45 | ui_print "*******************************" 46 | } 47 | 48 | ########################################################################################## 49 | # Replace list 50 | ########################################################################################## 51 | 52 | # List all directories you want to directly replace in the system 53 | # Check the documentations for more info about how Magic Mount works, and why you need this 54 | 55 | # This is an example 56 | REPLACE=" 57 | /system/app/Youtube 58 | /system/priv-app/SystemUI 59 | /system/priv-app/Settings 60 | /system/framework 61 | " 62 | 63 | # Construct your own list here, it will override the example above 64 | # !DO NOT! remove this if you don't need to replace anything, leave it empty as it is now 65 | REPLACE=" 66 | " 67 | 68 | ########################################################################################## 69 | # Permissions 70 | ########################################################################################## 71 | 72 | set_permissions() { 73 | # Only some special files require specific permissions 74 | # The default permissions should be good enough for most cases 75 | 76 | # Here are some examples for the set_perm functions: 77 | 78 | # set_perm_recursive (default: u:object_r:system_file:s0) 79 | # set_perm_recursive $MODPATH/system/lib 0 0 0755 0644 80 | 81 | # set_perm (default: u:object_r:system_file:s0) 82 | # set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0 83 | # set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0 84 | # set_perm $MODPATH/system/lib/libart.so 0 0 0644 85 | 86 | # The following is default permissions, DO NOT remove 87 | set_perm_recursive $MODPATH 0 0 0755 0644 88 | } 89 | 90 | ########################################################################################## 91 | # Custom Functions 92 | ########################################################################################## 93 | 94 | # This file (config.sh) will be sourced by the main flash script after util_functions.sh 95 | # If you need custom logic, please add them here as functions, and call these functions in 96 | # update-binary. Refrain from adding code directly into update-binary, as it will make it 97 | # difficult for you to migrate your modules to newer template versions. 98 | # Make update-binary as clean as possible, try to only do function calls in it. 99 | 100 | -------------------------------------------------------------------------------- /envvar.sh: -------------------------------------------------------------------------------- 1 | apklist=""; 2 | apkbak=/data/media/0//APK-Backup; 3 | backup=1; 4 | cleanup=1; 5 | -------------------------------------------------------------------------------- /extracmd.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djb77/APK-Patcher-Lite_Magisk/7c110638ff9f39523500cfa405531191e91fae93/extracmd.sh -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | ########################################################################################## 2 | # 3 | # Magisk Module Installer Script 4 | # 5 | ########################################################################################## 6 | ########################################################################################## 7 | # 8 | # Instructions: 9 | # 10 | # 1. Place your files into system folder (delete the placeholder file) 11 | # 2. Fill in your module's info into module.prop 12 | # 3. Configure and implement callbacks in this file 13 | # 4. If you need boot scripts, add them into common/post-fs-data.sh or common/service.sh 14 | # 5. Add your additional or modified system properties into common/system.prop 15 | # 16 | ########################################################################################## 17 | 18 | ########################################################################################## 19 | # Config Flags 20 | ########################################################################################## 21 | 22 | # Set to true if you do *NOT* want Magisk to mount 23 | # any files for you. Most modules would NOT want 24 | # to set this flag to true 25 | SKIPMOUNT=false 26 | 27 | # Set to true if you need to load system.prop 28 | PROPFILE=false 29 | 30 | # Set to true if you need post-fs-data script 31 | POSTFSDATA=false 32 | 33 | # Set to true if you need late_start service script 34 | LATESTARTSERVICE=false 35 | 36 | ########################################################################################## 37 | # Replace list 38 | ########################################################################################## 39 | 40 | # List all directories you want to directly replace in the system 41 | # Check the documentations for more info why you would need this 42 | 43 | # Construct your list in the following format 44 | # This is an example 45 | REPLACE_EXAMPLE=" 46 | /system/app/Youtube 47 | /system/priv-app/SystemUI 48 | /system/priv-app/Settings 49 | /system/framework 50 | " 51 | 52 | # Construct your own list here 53 | REPLACE=" 54 | " 55 | 56 | ########################################################################################## 57 | # 58 | # Function Callbacks 59 | # 60 | # The following functions will be called by the installation framework. 61 | # You do not have the ability to modify update-binary, the only way you can customize 62 | # installation is through implementing these functions. 63 | # 64 | # When running your callbacks, the installation framework will make sure the Magisk 65 | # internal busybox path is *PREPENDED* to PATH, so all common commands shall exist. 66 | # Also, it will make sure /data, /system, and /vendor is properly mounted. 67 | # 68 | ########################################################################################## 69 | ########################################################################################## 70 | # 71 | # The installation framework will export some variables and functions. 72 | # You should use these variables and functions for installation. 73 | # 74 | # ! DO NOT use any Magisk internal paths as those are NOT public API. 75 | # ! DO NOT use other functions in util_functions.sh as they are NOT public API. 76 | # ! Non public APIs are not guranteed to maintain compatibility between releases. 77 | # 78 | # Available variables: 79 | # 80 | # MAGISK_VER (string): the version string of current installed Magisk 81 | # MAGISK_VER_CODE (int): the version code of current installed Magisk 82 | # BOOTMODE (bool): true if the module is currently installing in Magisk Manager 83 | # MODPATH (path): the path where your module files should be installed 84 | # TMPDIR (path): a place where you can temporarily store files 85 | # ZIPFILE (path): your module's installation zip 86 | # ARCH (string): the architecture of the device. Value is either arm, arm64, x86, or x64 87 | # IS64BIT (bool): true if $ARCH is either arm64 or x64 88 | # API (int): the API level (Android version) of the device 89 | # 90 | # Availible functions: 91 | # 92 | # ui_print 93 | # print to console 94 | # Avoid using 'echo' as it will not display in custom recovery's console 95 | # 96 | # abort 97 | # print error message to console and terminate installation 98 | # Avoid using 'exit' as it will skip the termination cleanup steps 99 | # 100 | # set_perm [context] 101 | # if [context] is empty, it will default to "u:object_r:system_file:s0" 102 | # this function is a shorthand for the following commands 103 | # chown owner.group target 104 | # chmod permission target 105 | # chcon context target 106 | # 107 | # set_perm_recursive [context] 108 | # if [context] is empty, it will default to "u:object_r:system_file:s0" 109 | # for all files in , it will call: 110 | # set_perm file owner group filepermission context 111 | # for all directories in (including itself), it will call: 112 | # set_perm dir owner group dirpermission context 113 | # 114 | ########################################################################################## 115 | ########################################################################################## 116 | # If you need boot scripts, DO NOT use general boot scripts (post-fs-data.d/service.d) 117 | # ONLY use module scripts as it respects the module status (remove/disable) and is 118 | # guaranteed to maintain the same behavior in future Magisk releases. 119 | # Enable boot scripts by setting the flags in the config section above. 120 | ########################################################################################## 121 | 122 | # Set what you want to display when installing your module 123 | 124 | print_modname() { 125 | ui_print "*******************************" 126 | ui_print " Magisk Module Template " 127 | ui_print "*******************************" 128 | } 129 | 130 | # Copy/extract your module files into $MODPATH in on_install. 131 | 132 | on_install() { 133 | # The following is the default implementation: extract $ZIPFILE/system to $MODPATH 134 | # Extend/change the logic to whatever you want 135 | ui_print "- Extracting module files" 136 | unzip -o "$ZIPFILE" 'system/*' -d $MODPATH >&2 137 | } 138 | 139 | # Only some special files require specific permissions 140 | # This function will be called after on_install is done 141 | # The default permissions should be good enough for most cases 142 | 143 | set_permissions() { 144 | # The following is the default rule, DO NOT remove 145 | set_perm_recursive $MODPATH 0 0 0755 0644 146 | 147 | # Here are some examples: 148 | # set_perm_recursive $MODPATH/system/lib 0 0 0755 0644 149 | # set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0 150 | # set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0 151 | # set_perm $MODPATH/system/lib/libart.so 0 0 0644 152 | } 153 | 154 | # You can add more functions to assist your custom script code 155 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=template 2 | name=Template Module 3 | version=v1 4 | versionCode=1 5 | author=topjohnwu 6 | description=A short description 7 | -------------------------------------------------------------------------------- /patch/files go in here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djb77/APK-Patcher-Lite_Magisk/7c110638ff9f39523500cfa405531191e91fae93/patch/files go in here -------------------------------------------------------------------------------- /script/scripts_sample.sh: -------------------------------------------------------------------------------- 1 | fileremove=""; 2 | 3 | -------------------------------------------------------------------------------- /system/placeholder: -------------------------------------------------------------------------------- 1 | This file will be deleted in Magisk Manager, it is only a placeholder for git 2 | -------------------------------------------------------------------------------- /tools/zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djb77/APK-Patcher-Lite_Magisk/7c110638ff9f39523500cfa405531191e91fae93/tools/zip -------------------------------------------------------------------------------- /tools/zipalign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djb77/APK-Patcher-Lite_Magisk/7c110638ff9f39523500cfa405531191e91fae93/tools/zipalign --------------------------------------------------------------------------------