├── .github └── FUNDING.yml ├── LICENSE ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── action.sh ├── arm64-v8a └── libmagiskpolicy.so ├── armeabi-v7a └── libmagiskpolicy.so ├── cleaner.sh ├── customize.sh ├── function.sh ├── module.prop ├── package.txt ├── post-fs-data.sh ├── sepolicy.rule ├── service.sh ├── system.prop ├── system ├── etc │ ├── default-permissions │ │ └── default-com.myprog.hexedit.xml │ ├── permissions │ │ └── privapp-com.myprog.hexedit.xml │ └── sysconfig │ │ └── config-com.myprog.hexedit.xml └── priv-app │ └── HEXEditor │ ├── HEXEditor.apk │ └── extract ├── uninstall.sh ├── x86 └── libmagiskpolicy.so └── x86_64 └── libmagiskpolicy.so /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: reiryuki # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: reiryuki # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: reiryuki # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: https://www.paypal.me/reiryuki # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Rei Ryuki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | require_new_magisk() { 13 | ui_print "*******************************" 14 | ui_print " Please install Magisk v20.4+! " 15 | ui_print "*******************************" 16 | exit 1 17 | } 18 | 19 | ######################### 20 | # Load util_functions.sh 21 | ######################### 22 | 23 | OUTFD=$2 24 | ZIPFILE=$3 25 | 26 | mount /data 2>/dev/null 27 | 28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 29 | . /data/adb/magisk/util_functions.sh 30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk 31 | 32 | install_module 33 | exit 0 34 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HEX Editor Magisk Module 2 | 3 | ## Descriptions 4 | - Bypasses security restrictions of HEX Editor app, so we don't need to turn our device to Permissive state to access all of directories. 5 | - What app is this? Tap here: https://play.google.com/store/apps/details?id=com.myprog.hexedit. Tap the "About this app" there. 6 | 7 | ## Requirements 8 | - Android 4.3 (SDK 18) and up 9 | - Magisk or KernelSU installed 10 | 11 | ## Installation Guide & Download Link 12 | - Install this module https://www.pling.com/p/1545144/ via Magisk app or KernelSU app only 13 | - If you are using KernelSU, you need to disable Unmount Modules by Default in KernelSU app settings 14 | - Reboot 15 | - If you are using KernelSU, you need to allow superuser list manually all package name listed in package.txt (and your home launcher app also) (enable show system apps) and reboot afterwards 16 | - If you are using SUList, you need to allow list manually your home launcher app (enable show system apps) and reboot afterwards 17 | 18 | ## Optionals 19 | - Global: https://t.me/ryukinotes/35 20 | 21 | ## Troubleshootings 22 | - Global: https://t.me/ryukinotes/34 23 | 24 | ## Support & Bug Report 25 | - https://t.me/ryukinotes/54 26 | - If you don't do above, issues will be closed immediately. 27 | 28 | ## Credits and Contributors 29 | - https://t.me/androidryukimodsdiscussions 30 | - You can contribute ideas about this Magisk Module here: https://t.me/androidappsportdevelopment 31 | 32 | ## Sponsors 33 | - https://t.me/ryukinotes/25 34 | 35 | 36 | -------------------------------------------------------------------------------- /action.sh: -------------------------------------------------------------------------------- 1 | MODPATH=${0%/*} 2 | 3 | # info 4 | echo "- Apps caches from this module will be re-cleaned" 5 | echo " at the next boot." 6 | echo " " 7 | 8 | # rename 9 | FILE=$MODPATH/cleaner.sh 10 | if [ -f $FILE.txt ]; then 11 | mv -f $FILE.txt $FILE 12 | fi 13 | 14 | 15 | -------------------------------------------------------------------------------- /arm64-v8a/libmagiskpolicy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/HEX-Editor-Magisk-Module/48546210c75eab1743b55405eeaa0c0d2fe55f85/arm64-v8a/libmagiskpolicy.so -------------------------------------------------------------------------------- /armeabi-v7a/libmagiskpolicy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/HEX-Editor-Magisk-Module/48546210c75eab1743b55405eeaa0c0d2fe55f85/armeabi-v7a/libmagiskpolicy.so -------------------------------------------------------------------------------- /cleaner.sh: -------------------------------------------------------------------------------- 1 | [ ! "$MODPATH" ] && MODPATH=${0%/*} 2 | UID=`id -u` 3 | 4 | # run 5 | . $MODPATH/function.sh 6 | 7 | # cleaning 8 | remove_cache 9 | PKGS=`cat $MODPATH/package.txt` 10 | for PKG in $PKGS; do 11 | rm -rf /data/user*/"$UID"/$PKG/cache/* 12 | done 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | # space 2 | ui_print " " 3 | 4 | # var 5 | UID=`id -u` 6 | [ ! "$UID" ] && UID=0 7 | 8 | # log 9 | if [ "$BOOTMODE" != true ]; then 10 | FILE=/data/media/"$UID"/$MODID\_recovery.log 11 | ui_print "- Log will be saved at $FILE" 12 | exec 2>$FILE 13 | ui_print " " 14 | fi 15 | 16 | # optionals 17 | OPTIONALS=/data/media/"$UID"/optionals.prop 18 | if [ ! -f $OPTIONALS ]; then 19 | touch $OPTIONALS 20 | fi 21 | 22 | # debug 23 | if [ "`grep_prop debug.log $OPTIONALS`" == 1 ]; then 24 | ui_print "- The install log will contain detailed information" 25 | set -x 26 | ui_print " " 27 | fi 28 | 29 | # recovery 30 | if [ "$BOOTMODE" != true ]; then 31 | MODPATH_UPDATE=`echo $MODPATH | sed 's|modules/|modules_update/|g'` 32 | rm -f $MODPATH/update 33 | rm -rf $MODPATH_UPDATE 34 | fi 35 | 36 | # run 37 | . $MODPATH/function.sh 38 | 39 | # info 40 | MODVER=`grep_prop version $MODPATH/module.prop` 41 | MODVERCODE=`grep_prop versionCode $MODPATH/module.prop` 42 | ui_print " ID=$MODID" 43 | ui_print " Version=$MODVER" 44 | ui_print " VersionCode=$MODVERCODE" 45 | if [ "$KSU" == true ]; then 46 | ui_print " KSUVersion=$KSU_VER" 47 | ui_print " KSUVersionCode=$KSU_VER_CODE" 48 | ui_print " KSUKernelVersionCode=$KSU_KERNEL_VER_CODE" 49 | sed -i 's|#k||g' $MODPATH/post-fs-data.sh 50 | else 51 | ui_print " MagiskVersion=$MAGISK_VER" 52 | ui_print " MagiskVersionCode=$MAGISK_VER_CODE" 53 | fi 54 | ui_print " " 55 | 56 | # sdk 57 | NUM=18 58 | if [ "$API" -lt $NUM ]; then 59 | ui_print "! Unsupported SDK $API." 60 | ui_print " You have to upgrade your Android version" 61 | ui_print " at least SDK $NUM to use this module." 62 | abort 63 | else 64 | ui_print "- SDK $API" 65 | ui_print " " 66 | fi 67 | 68 | # sepolicy 69 | FILE=$MODPATH/sepolicy.rule 70 | DES=$MODPATH/sepolicy.pfsd 71 | if [ "`grep_prop sepolicy.sh $OPTIONALS`" == 1 ]\ 72 | && [ -f $FILE ]; then 73 | mv -f $FILE $DES 74 | fi 75 | 76 | # cleaning 77 | ui_print "- Cleaning..." 78 | remove_sepolicy_rule 79 | ui_print " " 80 | 81 | # function 82 | permissive_2() { 83 | sed -i 's|#2||g' $MODPATH/post-fs-data.sh 84 | } 85 | permissive() { 86 | FILE=/sys/fs/selinux/enforce 87 | FILE2=/sys/fs/selinux/policy 88 | if [ "`toybox cat $FILE`" = 1 ]; then 89 | chmod 640 $FILE 90 | chmod 440 $FILE2 91 | echo 0 > $FILE 92 | if [ "`toybox cat $FILE`" = 1 ]; then 93 | ui_print " Your device can't be turned to Permissive state." 94 | ui_print " Using Magisk Permissive mode instead." 95 | permissive_2 96 | else 97 | echo 1 > $FILE 98 | sed -i 's|#1||g' $MODPATH/post-fs-data.sh 99 | fi 100 | else 101 | sed -i 's|#1||g' $MODPATH/post-fs-data.sh 102 | fi 103 | } 104 | 105 | # permissive 106 | if [ "`grep_prop permissive.mode $OPTIONALS`" == 1 ]; then 107 | ui_print "- Using device Permissive mode." 108 | rm -f $MODPATH/sepolicy.rule 109 | permissive 110 | ui_print " " 111 | elif [ "`grep_prop permissive.mode $OPTIONALS`" == 2 ]; then 112 | ui_print "- Using Magisk Permissive mode." 113 | rm -f $MODPATH/sepolicy.rule 114 | permissive_2 115 | ui_print " " 116 | fi 117 | 118 | # /priv-app 119 | if [ "$API" -le 18 ]; then 120 | ui_print "- /system/priv-app is not supported in SDK 18 and bellow" 121 | ui_print " Using /system/app instead" 122 | mv -f $MODPATH/system/priv-app $MODPATH/system/app 123 | ui_print " " 124 | fi 125 | 126 | # function 127 | extract_lib() { 128 | for APP in $APPS; do 129 | FILE=`find $MODPATH/system -type f -name $APP.apk` 130 | if [ -f `dirname $FILE`/extract ]; then 131 | ui_print "- Extracting..." 132 | DIR=`dirname $FILE`/lib/"$ARCHLIB" 133 | mkdir -p $DIR 134 | rm -rf $TMPDIR/* 135 | DES=lib/"$ABILIB"/* 136 | unzip -d $TMPDIR -o $FILE $DES 137 | cp -f $TMPDIR/$DES $DIR 138 | chmod 0755 $DIR/* 139 | ui_print " " 140 | fi 141 | done 142 | } 143 | 144 | # extract 145 | APPS="`ls $MODPATH/system/priv-app` 146 | `ls $MODPATH/system/app`" 147 | ARCHLIB=arm64 148 | ABILIB=arm64-v8a 149 | extract_lib 150 | ARCHLIB=arm 151 | ABILIB=armeabi 152 | extract_lib 153 | ARCHLIB=x64 154 | ABILIB=x86_64 155 | extract_lib 156 | ARCHLIB=x86 157 | ABILIB=x86 158 | extract_lib 159 | rm -f `find $MODPATH/system -type f -name extract` 160 | 161 | # function 162 | copy_odex() { 163 | DIR=`find /data/adb/modules/"$MODID"/system -type d -name "$APP"` 164 | ui_print "- Current app versionCode: $CURRENT" 165 | ui_print " New app versionCode: $NEW" 166 | if [ "$CURRENT" == "$NEW" ]; then 167 | if [ -f $DIR/oat/$APP.odex ]; then 168 | ui_print " Copying oat..." 169 | cp -rf $DIR/oat $MODPATH/$DIR 170 | elif [ -f $DIR/odex/$APP.odex ]; then 171 | ui_print " Copying odex..." 172 | cp -rf $DIR/odex $MODPATH/$DIR 173 | elif [ -f $DIR/$APP.odex ]; then 174 | ui_print " Copying odex..." 175 | cp -f $DIR/$APP.odex $MODPATH/$DIR 176 | fi 177 | fi 178 | ui_print " " 179 | } 180 | 181 | # install 182 | APP=HEXEditor 183 | PKG=com.myprog.hexedit 184 | NEW=120 185 | if [ "$BOOTMODE" == true ]; then 186 | CURRENT=`pm list packages --show-versioncode | grep $PKG | sed "s|package:$PKG versionCode:||g"` 187 | copy_odex 188 | fi 189 | 190 | # power save 191 | PKGS=`cat $MODPATH/package.txt` 192 | FILE=$MODPATH/system/etc/sysconfig/* 193 | if [ "`grep_prop power.save $OPTIONALS`" == 1 ]; then 194 | ui_print "- $MODNAME will not be allowed in power save." 195 | ui_print " It may save your battery but decreasing $MODNAME performance." 196 | for PKG in $PKGS; do 197 | sed -i "s|||g" $FILE 198 | sed -i "s|||g" $FILE 199 | done 200 | ui_print " " 201 | fi 202 | 203 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /function.sh: -------------------------------------------------------------------------------- 1 | # function 2 | remove_cache() { 3 | FILES=`find $MODPATH -type f -name *.apk | sed 's|.apk||g'` 4 | APPS=`for FILE in $FILES; do basename $FILE; done` 5 | for APP in $APPS; do 6 | rm -f `find /data/system/package_cache\ 7 | /data/dalvik-cache /data/resource-cache\ 8 | -type f -name *$APP*` 9 | done 10 | } 11 | remove_sepolicy_rule() { 12 | rm -rf /metadata/magisk/"$MODID"\ 13 | /mnt/vendor/persist/magisk/"$MODID"\ 14 | /persist/magisk/"$MODID"\ 15 | /data/unencrypted/magisk/"$MODID"\ 16 | /cache/magisk/"$MODID"\ 17 | /cust/magisk/"$MODID" 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=HEXEditor 2 | name=HEX Editor 3 | version=v1.14 4 | versionCode=14 5 | author=Rei Ryuki the Fixer 6 | description=Bypasses security restrictions for HEX Editor app. 7 | 8 | 9 | -------------------------------------------------------------------------------- /package.txt: -------------------------------------------------------------------------------- 1 | com.myprog.hexedit 2 | -------------------------------------------------------------------------------- /post-fs-data.sh: -------------------------------------------------------------------------------- 1 | mount -o rw,remount /data 2 | MODPATH=${0%/*} 3 | 4 | # log 5 | exec 2>$MODPATH/debug-pfsd.log 6 | set -x 7 | 8 | # var 9 | ABI=`getprop ro.product.cpu.abi` 10 | 11 | # function 12 | permissive() { 13 | if [ "`toybox cat $FILE`" = 1 ]; then 14 | chmod 640 $FILE 15 | chmod 440 $FILE2 16 | echo 0 > $FILE 17 | fi 18 | } 19 | magisk_permissive() { 20 | if [ "`toybox cat $FILE`" = 1 ]; then 21 | if [ -x "`command -v magiskpolicy`" ]; then 22 | magiskpolicy --live "permissive *" 23 | else 24 | $MODPATH/$ABI/libmagiskpolicy.so --live "permissive *" 25 | fi 26 | fi 27 | } 28 | sepolicy_sh() { 29 | if [ -f $FILE ]; then 30 | if [ -x "`command -v magiskpolicy`" ]; then 31 | magiskpolicy --live --apply $FILE 2>/dev/null 32 | else 33 | $MODPATH/$ABI/libmagiskpolicy.so --live --apply $FILE 2>/dev/null 34 | fi 35 | fi 36 | } 37 | 38 | # selinux 39 | FILE=/sys/fs/selinux/enforce 40 | FILE2=/sys/fs/selinux/policy 41 | #1permissive 42 | chmod 0755 $MODPATH/*/libmagiskpolicy.so 43 | #2magisk_permissive 44 | FILE=$MODPATH/sepolicy.rule 45 | #ksepolicy_sh 46 | FILE=$MODPATH/sepolicy.pfsd 47 | sepolicy_sh 48 | 49 | # cleaning 50 | FILE=$MODPATH/cleaner.sh 51 | if [ -f $FILE ]; then 52 | . $FILE 53 | mv -f $FILE $FILE.txt 54 | fi 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /sepolicy.rule: -------------------------------------------------------------------------------- 1 | # debug 2 | allow system_server system_file file write 3 | 4 | # context 5 | create { system_lib_file vendor_file vendor_configs_file } 6 | allow { system_file system_lib_file vendor_file vendor_configs_file } labeledfs filesystem associate 7 | allow init { system_file system_lib_file vendor_file vendor_configs_file } { dir file } relabelfrom 8 | 9 | # file 10 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { proc_tty_drivers serialno_prop qemu_hw_prop vendor_file hal_perf_default_exec hal_power_default_exec } file { read open } 11 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } * file getattr 12 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } qemu_sf_lcd_density_prop file { read open map } 13 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { dirac_prop qemu_hw_prop serialno_prop } file map 14 | allow system_server system_file file ioctl 15 | 16 | # fifo_file 17 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { privapp_data_file app_data_file } fifo_file { create read getattr write unlink open } 18 | 19 | # lnk_file 20 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { mnt_vendor_file init_exec } lnk_file read 21 | 22 | # chr_file 23 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } * chr_file getattr 24 | 25 | # dir 26 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } * dir getattr 27 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { cgroup rootfs } dir { read open } 28 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { apex_mnt_dir configfs debugfs adsprpcd_file system_data_file shell_data_file device } dir read 29 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { device sysfs } dir open 30 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } { mnt_vendor_file shell_test_data_file block_device system_bootstrap_lib_file } dir search 31 | allow dexoptanalyzer privapp_data_file dir search 32 | 33 | # filesystem 34 | allow { system_app priv_app platform_app untrusted_app_29 untrusted_app_27 untrusted_app } firmware_file filesystem getattr 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | MODPATH=${0%/*} 2 | 3 | # log 4 | exec 2>$MODPATH/debug.log 5 | set -x 6 | 7 | # var 8 | API=`getprop ro.build.version.sdk` 9 | 10 | # wait 11 | until [ "`getprop sys.boot_completed`" == 1 ]; do 12 | sleep 10 13 | done 14 | 15 | # list 16 | PKGS=`cat $MODPATH/package.txt` 17 | for PKG in $PKGS; do 18 | magisk --denylist rm $PKG 2>/dev/null 19 | magisk --sulist add $PKG 2>/dev/null 20 | done 21 | if magisk magiskhide sulist; then 22 | for PKG in $PKGS; do 23 | magisk magiskhide add $PKG 24 | done 25 | else 26 | for PKG in $PKGS; do 27 | magisk magiskhide rm $PKG 28 | done 29 | fi 30 | 31 | # grant 32 | PKG=com.myprog.hexedit 33 | if appops get $PKG > /dev/null 2>&1; then 34 | pm grant --all-permissions $PKG 35 | appops set $PKG LEGACY_STORAGE allow 36 | appops set $PKG READ_EXTERNAL_STORAGE allow 37 | appops set $PKG WRITE_EXTERNAL_STORAGE allow 38 | appops set $PKG READ_MEDIA_AUDIO allow 39 | appops set $PKG READ_MEDIA_VIDEO allow 40 | appops set $PKG READ_MEDIA_IMAGES allow 41 | appops set $PKG WRITE_MEDIA_AUDIO allow 42 | appops set $PKG WRITE_MEDIA_VIDEO allow 43 | appops set $PKG WRITE_MEDIA_IMAGES allow 44 | if [ "$API" -ge 29 ]; then 45 | appops set $PKG ACCESS_MEDIA_LOCATION allow 46 | fi 47 | if [ "$API" -ge 30 ]; then 48 | appops set $PKG MANAGE_EXTERNAL_STORAGE allow 49 | appops set $PKG NO_ISOLATED_STORAGE allow 50 | appops set $PKG AUTO_REVOKE_PERMISSIONS_IF_UNUSED ignore 51 | fi 52 | if [ "$API" -ge 31 ]; then 53 | appops set $PKG MANAGE_MEDIA allow 54 | fi 55 | if [ "$API" -ge 33 ]; then 56 | appops set $PKG ACCESS_RESTRICTED_SETTINGS allow 57 | fi 58 | if [ "$API" -ge 34 ]; then 59 | appops set $PKG READ_MEDIA_VISUAL_USER_SELECTED allow 60 | fi 61 | appops set $PKG SYSTEM_ALERT_WINDOW allow 62 | UID=`dumpsys package $PKG 2>/dev/null | grep -m 1 Id= | sed -e 's| userId=||g' -e 's| appId=||g'` 63 | if [ "$UID" ] && [ "$UID" -gt 9999 ]; then 64 | appops set --uid "$UID" LEGACY_STORAGE allow 65 | appops set --uid "$UID" READ_EXTERNAL_STORAGE allow 66 | appops set --uid "$UID" WRITE_EXTERNAL_STORAGE allow 67 | if [ "$API" -ge 29 ]; then 68 | appops set --uid "$UID" ACCESS_MEDIA_LOCATION allow 69 | fi 70 | if [ "$API" -ge 34 ]; then 71 | appops set --uid "$UID" READ_MEDIA_VISUAL_USER_SELECTED allow 72 | fi 73 | fi 74 | APP=HEXEditor 75 | NAME=android.permission.WRITE_EXTERNAL_STORAGE 76 | if ! dumpsys package $PKG | grep "$NAME: granted=true"; then 77 | FILE=`find $MODPATH/system -type f -name $APP.apk` 78 | pm install -g -i com.android.vending $FILE 79 | pm uninstall -k $PKG 80 | fi 81 | PKGOPS=`appops get $PKG` 82 | if [ "$UID" ] && [ "$UID" -gt 9999 ]; then 83 | UIDOPS=`appops get --uid "$UID"` 84 | fi 85 | pm disable $PKG/com.startapp.android.publish.ads.list3d.List3DActivity 86 | pm disable $PKG/com.startapp.android.publish.adsCommon.activities.FullScreenActivity 87 | pm disable $PKG/com.startapp.android.publish.adsCommon.activities.OverlayActivity 88 | pm disable $PKG/com.smaato.soma.interstitial.InterstitialActivity 89 | fi 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # prevent bootloop 2 | ro.control_privapp_permissions=log 3 | -------------------------------------------------------------------------------- /system/etc/default-permissions/default-com.myprog.hexedit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /system/etc/permissions/privapp-com.myprog.hexedit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /system/etc/sysconfig/config-com.myprog.hexedit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /system/priv-app/HEXEditor/HEXEditor.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/HEX-Editor-Magisk-Module/48546210c75eab1743b55405eeaa0c0d2fe55f85/system/priv-app/HEXEditor/HEXEditor.apk -------------------------------------------------------------------------------- /system/priv-app/HEXEditor/extract: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/HEX-Editor-Magisk-Module/48546210c75eab1743b55405eeaa0c0d2fe55f85/system/priv-app/HEXEditor/extract -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | mount -o rw,remount /data 2 | [ ! "$MODPATH" ] && MODPATH=${0%/*} 3 | [ ! "$MODID" ] && MODID=`basename "$MODPATH"` 4 | UID=`id -u` 5 | [ ! "$UID" ] && UID=0 6 | 7 | # log 8 | exec 2>/data/adb/$MODID\_uninstall.log 9 | set -x 10 | 11 | # run 12 | . $MODPATH/function.sh 13 | 14 | # cleaning 15 | remove_cache 16 | remove_sepolicy_rule 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /x86/libmagiskpolicy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/HEX-Editor-Magisk-Module/48546210c75eab1743b55405eeaa0c0d2fe55f85/x86/libmagiskpolicy.so -------------------------------------------------------------------------------- /x86_64/libmagiskpolicy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/HEX-Editor-Magisk-Module/48546210c75eab1743b55405eeaa0c0d2fe55f85/x86_64/libmagiskpolicy.so --------------------------------------------------------------------------------