├── .github └── FUNDING.yml ├── LICENSE ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── action.sh ├── cleaner.sh ├── customize.sh ├── function.sh ├── module.prop ├── package.txt ├── post-fs-data.sh ├── sepolicy.rule ├── service.sh ├── system.prop ├── system ├── app │ └── MotoSignatureApp │ │ └── MotoSignatureApp.apk ├── etc │ ├── permissions │ │ ├── com.motorola.frameworks.core.addon.xml │ │ ├── com.motorola.motosignature.xml │ │ ├── moto-checkin.xml │ │ ├── moto-core_services.xml │ │ ├── moto-settings.xml │ │ ├── moto.xml │ │ └── privapp-com.motorola.android.providers.settings.xml │ └── sysconfig │ │ ├── config-com.motorola.android.providers.settings.xml │ │ └── config-com.motorola.motosignature.app.xml ├── framework │ ├── com.motorola.frameworks.core.addon.jar │ ├── com.motorola.motosignature.jar │ ├── moto-checkin.jar │ ├── moto-core_services.jar │ ├── moto-settings.jar │ └── moto.jar └── priv-app │ └── MotorolaSettingsProvider │ └── MotorolaSettingsProvider.apk └── uninstall.sh /.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) 2023 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 | # Moto Core Magisk Module 2 | 3 | ## DISCLAIMER 4 | - Motorola apps and blobs are owned by Motorola™. 5 | - The MIT license specified here is for the Magisk Module only, not for Motorola apps and blobs. 6 | 7 | ## Descriptions 8 | - System core framework library of Motorola ROM ported from Motorola XT2125 (nio) as a dependency of any Moto Magisk Modules 9 | 10 | ## For Moto App Porter 11 | - You need to declare this line bellow in your app AndroidManifest.xml at `` if you want to load classes from this Moto Core: 12 | 13 | `` 14 | 15 | - Do not do above if your app has it's own library! 16 | - Do not white list the library with your own Magisk Module /system/etc/permissions/ because there might be a conflict. 17 | 18 | ## Sources 19 | - https://dumps.tadiphone.dev/dumps/motorola/nio msi-user-11-RRTS31.Q1-20-24-2-42a7c-release-keys 20 | - libmagiskpolicy.so: Kitsune Mask R6687BB53 21 | 22 | ## Requirements 23 | - Not in Motorola ROM 24 | - Android 6 (SDK 23) and up 25 | - Magisk or KernelSU installed 26 | 27 | ## Installation Guide & Download Link 28 | - Install this module https://www.pling.com/p/1978575/ via Magisk app or KernelSU app or Recovery if Magisk installed 29 | - Install any Moto Magisk Module which depends on this module 30 | - If you are using KernelSU, you need to disable Unmount Modules by Default in KernelSU app settings 31 | - Reboot 32 | - 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 33 | 34 | ## Optionals 35 | - Global: https://t.me/ryukinotes/35 36 | 37 | ## Troubleshootings 38 | - Global: https://t.me/ryukinotes/34 39 | 40 | ## Support & Bug Report 41 | - https://t.me/ryukinotes/54 42 | - If you don't do above, issues will be closed immediately 43 | 44 | ## Credits and Contributors 45 | - https://t.me/androidryukimodsdiscussions 46 | - You can contribute ideas about this Magisk Module here: https://t.me/androidappsportdevelopment 47 | 48 | ## Sponsors 49 | - https://t.me/ryukinotes/25 50 | 51 | 52 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | else 50 | ui_print " MagiskVersion=$MAGISK_VER" 51 | ui_print " MagiskVersionCode=$MAGISK_VER_CODE" 52 | fi 53 | ui_print " " 54 | 55 | # sdk 56 | NUM=23 57 | if [ "$API" -lt $NUM ]; then 58 | ui_print "! Unsupported SDK $API. You have to upgrade your" 59 | ui_print " Android version at least SDK $NUM to use this module." 60 | abort 61 | else 62 | ui_print "- SDK $API" 63 | ui_print " " 64 | fi 65 | 66 | # recovery 67 | mount_partitions_in_recovery 68 | 69 | # magisk 70 | magisk_setup 71 | 72 | # path 73 | SYSTEM=`realpath $MIRROR/system` 74 | VENDOR=`realpath $MIRROR/vendor` 75 | PRODUCT=`realpath $MIRROR/product` 76 | SYSTEM_EXT=`realpath $MIRROR/system_ext` 77 | ODM=`realpath $MIRROR/odm` 78 | MY_PRODUCT=`realpath $MIRROR/my_product` 79 | 80 | # cleaning 81 | ui_print "- Cleaning..." 82 | PKGS=`cat $MODPATH/package.txt` 83 | if [ "$BOOTMODE" == true ]; then 84 | for PKG in $PKGS; do 85 | FILE=`find /data/app -name *$PKG*` 86 | if [ "$FILE" ]; then 87 | RES=`pm uninstall $PKG 2>/dev/null` 88 | fi 89 | done 90 | fi 91 | rm -rf $MODPATH/unused 92 | remove_sepolicy_rule 93 | ui_print " " 94 | 95 | # function 96 | cleanup() { 97 | if [ -f $DIR/uninstall.sh ]; then 98 | sh $DIR/uninstall.sh 99 | fi 100 | DIR=/data/adb/modules_update/$MODID 101 | if [ -f $DIR/uninstall.sh ]; then 102 | sh $DIR/uninstall.sh 103 | fi 104 | } 105 | 106 | # cleanup 107 | DIR=/data/adb/modules/$MODID 108 | FILE=$DIR/module.prop 109 | PREVMODNAME=`grep_prop name $FILE` 110 | if [ "`grep_prop data.cleanup $OPTIONALS`" == 1 ]; then 111 | sed -i 's|^data.cleanup=1|data.cleanup=0|g' $OPTIONALS 112 | ui_print "- Cleaning-up $MODID data..." 113 | cleanup 114 | ui_print " " 115 | elif [ -d $DIR ]\ 116 | && [ "$PREVMODNAME" != "$MODNAME" ]; then 117 | ui_print "- Different module name is detected" 118 | ui_print " Cleaning-up $MODID data..." 119 | cleanup 120 | ui_print " " 121 | fi 122 | 123 | # function 124 | file_check_system() { 125 | for FILE in $FILES; do 126 | DESS="$SYSTEM$FILE $SYSTEM_EXT$FILE" 127 | for DES in $DESS; do 128 | if [ -f $DES ]; then 129 | ui_print "- Detected" 130 | ui_print "$DES" 131 | rm -f $MODPATH/system*$FILE 132 | ui_print " " 133 | fi 134 | done 135 | done 136 | } 137 | 138 | # check 139 | FILES="/*/MotoSignatureApp/MotoSignatureApp.apk 140 | /*/MotorolaSettingsProvider/MotorolaSettingsProvider.apk 141 | /framework/com.motorola.frameworks.core.addon.jar 142 | /framework/com.motorola.motosignature.jar 143 | /framework/moto-checkin.jar 144 | /framework/moto-settings.jar 145 | /framework/moto.jar" 146 | file_check_system 147 | 148 | # function 149 | hide_oat() { 150 | for APP in $APPS; do 151 | REPLACE="$REPLACE 152 | `find $MODPATH/system -type d -name $APP | sed "s|$MODPATH||g"`/oat" 153 | done 154 | } 155 | 156 | # hide 157 | APPS="`ls $MODPATH/system/priv-app` 158 | `ls $MODPATH/system/app`" 159 | hide_oat 160 | 161 | # unmount 162 | unmount_mirror 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /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 | mount_partitions_in_recovery() { 12 | if [ "$BOOTMODE" != true ]; then 13 | BLOCK=/dev/block/bootdevice/by-name 14 | BLOCK2=/dev/block/mapper 15 | ui_print "- Recommended to mount all partitions first" 16 | ui_print " before installing this module" 17 | ui_print " " 18 | DIR=/vendor 19 | if [ -d $DIR ] && ! is_mounted $DIR; then 20 | mount -o rw -t auto $BLOCK$DIR$SLOT $DIR\ 21 | || mount -o rw -t auto $BLOCK2$DIR$SLOT $DIR\ 22 | || mount -o rw -t auto $BLOCK/cust $DIR\ 23 | || mount -o rw -t auto $BLOCK2/cust $DIR 24 | fi 25 | DIR=/product 26 | if [ -d $DIR ] && ! is_mounted $DIR; then 27 | mount -o rw -t auto $BLOCK$DIR$SLOT $DIR\ 28 | || mount -o rw -t auto $BLOCK2$DIR$SLOT $DIR 29 | fi 30 | DIR=/system_ext 31 | if [ -d $DIR ] && ! is_mounted $DIR; then 32 | mount -o rw -t auto $BLOCK$DIR$SLOT $DIR\ 33 | || mount -o rw -t auto $BLOCK2$DIR$SLOT $DIR 34 | fi 35 | DIR=/odm 36 | if [ -d $DIR ] && ! is_mounted $DIR; then 37 | mount -o rw -t auto $BLOCK$DIR$SLOT $DIR\ 38 | || mount -o rw -t auto $BLOCK2$DIR$SLOT $DIR 39 | fi 40 | DIR=/my_product 41 | if [ -d $DIR ] && ! is_mounted $DIR; then 42 | mount -o rw -t auto $BLOCK$DIR $DIR\ 43 | || mount -o rw -t auto $BLOCK2$DIR $DIR 44 | fi 45 | DIR=/data 46 | if [ -d $DIR ] && ! is_mounted $DIR; then 47 | mount -o rw -t auto $BLOCK/userdata $DIR\ 48 | || mount -o rw -t auto $BLOCK2/userdata $DIR 49 | fi 50 | DIR=/cache 51 | if [ -d $DIR ] && ! is_mounted $DIR; then 52 | mount -o rw -t auto $BLOCK$DIR $DIR\ 53 | || mount -o rw -t auto $BLOCK2$DIR $DIR 54 | fi 55 | DIR=/persist 56 | if [ -d $DIR ] && ! is_mounted $DIR; then 57 | mount -o rw -t auto $BLOCK$DIR $DIR\ 58 | || mount -o rw -t auto $BLOCK2$DIR $DIR 59 | fi 60 | DIR=/metadata 61 | if [ -d $DIR ] && ! is_mounted $DIR; then 62 | mount -o rw -t auto $BLOCK$DIR $DIR\ 63 | || mount -o rw -t auto $BLOCK2$DIR $DIR 64 | fi 65 | DIR=/cust 66 | if [ -d $DIR ] && ! is_mounted $DIR; then 67 | mount -o rw -t auto $BLOCK$DIR $DIR\ 68 | || mount -o rw -t auto $BLOCK2$DIR $DIR 69 | fi 70 | fi 71 | } 72 | get_device() { 73 | DEV="`cat /proc/self/mountinfo | awk '{ if ( $5 == "'$1'" ) print $3 }' | head -1 | sed 's/:/ /g'`" 74 | } 75 | mount_mirror() { 76 | RAN="`head -c6 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9'`" 77 | while [ -e /dev/$RAN ]; do 78 | RAN="`head -c6 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9'`" 79 | done 80 | mknod /dev/$RAN b `get_device "$1"; echo $DEV` 81 | if mount -t ext4 -o ro /dev/$RAN "$2"\ 82 | || mount -t erofs -o ro /dev/$RAN "$2"\ 83 | || mount -t f2fs -o ro /dev/$RAN "$2"\ 84 | || mount -t auto -o ro /dev/$RAN "$2"; then 85 | blockdev --setrw /dev/$RAN 86 | rm -f /dev/$RAN 87 | return 0 88 | fi 89 | rm -f /dev/$RAN 90 | return 1 91 | } 92 | unmount_mirror() { 93 | if [ "$BOOTMODE" == true ]\ 94 | && [ "$HASMIRROR" == false ]; then 95 | FOLDS="$MIRROR/* $MIRROR" 96 | for FOLD in $FOLDS; do 97 | umount $FOLD 98 | done 99 | rm -rf $MIRROR/* 100 | fi 101 | } 102 | remount_partitions() { 103 | PARS="/ /system /vendor /product /system_ext /odm /my_product" 104 | for PAR in $PARS; do 105 | mount -o ro,remount $PAR 106 | done 107 | } 108 | mount_system_to_mirror() { 109 | DIR=/system 110 | if [ ! -d $MIRROR$DIR ]; then 111 | HASMIRROR=false 112 | remount_partitions 113 | unmount_mirror 114 | ui_print "- Mounting $MIRROR$DIR..." 115 | if [ "$SYSTEM_ROOT" == true ]\ 116 | || [ "$SYSTEM_AS_ROOT" == true ]; then 117 | mkdir -p $MIRROR/system_root 118 | if mount_mirror / $MIRROR/system_root; then 119 | rm -rf $MIRROR$DIR 120 | ln -sf $MIRROR/system_root$DIR $MIRROR 121 | else 122 | ui_print " ! Failed" 123 | rm -rf $MIRROR/system_root 124 | fi 125 | else 126 | mkdir -p $MIRROR$DIR 127 | if ! mount_mirror $DIR $MIRROR$DIR; then 128 | ui_print " ! Failed" 129 | rm -rf $MIRROR$DIR 130 | fi 131 | fi 132 | ui_print " " 133 | else 134 | HASMIRROR=true 135 | fi 136 | } 137 | mount_vendor_to_mirror() { 138 | DIR=/vendor 139 | if [ -d $DIR ] && [ ! -d $MIRROR$DIR ]; then 140 | ui_print "- Mounting $MIRROR$DIR..." 141 | mkdir -p $MIRROR$DIR 142 | if ! mount_mirror $DIR $MIRROR$DIR; then 143 | ui_print " Creating symlink instead" 144 | rm -rf $MIRROR$DIR 145 | if [ -d $MIRROR/system$DIR ]; then 146 | ln -sf $MIRROR/system$DIR $MIRROR 147 | fi 148 | fi 149 | ui_print " " 150 | fi 151 | } 152 | mount_product_to_mirror() { 153 | DIR=/product 154 | if [ -d $DIR ] && [ ! -d $MIRROR$DIR ]; then 155 | ui_print "- Mounting $MIRROR$DIR..." 156 | mkdir -p $MIRROR$DIR 157 | if ! mount_mirror $DIR $MIRROR$DIR; then 158 | ui_print " Creating symlink instead" 159 | rm -rf $MIRROR$DIR 160 | if [ -d $MIRROR/system$DIR ]; then 161 | ln -sf $MIRROR/system$DIR $MIRROR 162 | fi 163 | fi 164 | ui_print " " 165 | fi 166 | } 167 | mount_system_ext_to_mirror() { 168 | DIR=/system_ext 169 | if [ -d $DIR ] && [ ! -d $MIRROR$DIR ]; then 170 | ui_print "- Mounting $MIRROR$DIR..." 171 | mkdir -p $MIRROR$DIR 172 | if ! mount_mirror $DIR $MIRROR$DIR; then 173 | ui_print " Creating symlink instead" 174 | rm -rf $MIRROR$DIR 175 | if [ -d $MIRROR/system$DIR ]; then 176 | ln -sf $MIRROR/system$DIR $MIRROR 177 | fi 178 | fi 179 | ui_print " " 180 | fi 181 | } 182 | mount_odm_to_mirror() { 183 | DIR=/odm 184 | if [ -d $DIR ] && [ ! -d $MIRROR$DIR ]; then 185 | ui_print "- Mounting $MIRROR$DIR..." 186 | mkdir -p $MIRROR$DIR 187 | if ! mount_mirror $DIR $MIRROR$DIR; then 188 | ui_print " Creating symlink instead" 189 | rm -rf $MIRROR$DIR 190 | if [ -d $MIRROR/system_root$DIR ]; then 191 | ln -sf $MIRROR/system_root$DIR $MIRROR 192 | elif [ -d $MIRROR/vendor$DIR ]; then 193 | ln -sf $MIRROR/vendor$DIR $MIRROR 194 | elif [ -d $MIRROR/system/vendor$DIR ]; then 195 | ln -sf $MIRROR/system/vendor$DIR $MIRROR 196 | fi 197 | fi 198 | ui_print " " 199 | fi 200 | } 201 | mount_my_product_to_mirror() { 202 | DIR=/my_product 203 | if [ -d $DIR ] && [ ! -d $MIRROR$DIR ]; then 204 | ui_print "- Mounting $MIRROR$DIR..." 205 | mkdir -p $MIRROR$DIR 206 | if ! mount_mirror $DIR $MIRROR$DIR; then 207 | ui_print " Creating symlink instead" 208 | rm -rf $MIRROR$DIR 209 | if [ -d $MIRROR/system_root$DIR ]; then 210 | ln -sf $MIRROR/system_root$DIR $MIRROR 211 | fi 212 | fi 213 | ui_print " " 214 | fi 215 | } 216 | mount_partitions_to_mirror() { 217 | mount_system_to_mirror 218 | mount_vendor_to_mirror 219 | mount_product_to_mirror 220 | mount_system_ext_to_mirror 221 | mount_odm_to_mirror 222 | mount_my_product_to_mirror 223 | } 224 | magisk_setup() { 225 | MAGISKTMP=`magisk --path` 226 | if [ "$BOOTMODE" == true ]; then 227 | if [ "$MAGISKTMP" ]; then 228 | mount -o rw,remount $MAGISKTMP 229 | INTERNALDIR=$MAGISKTMP/.magisk 230 | MIRROR=$INTERNALDIR/mirror 231 | else 232 | INTERNALDIR=/mnt 233 | mount -o rw,remount $INTERNALDIR 234 | MIRROR=$INTERNALDIR/mirror 235 | fi 236 | mount_partitions_to_mirror 237 | fi 238 | } 239 | remove_sepolicy_rule() { 240 | rm -rf /metadata/magisk/"$MODID"\ 241 | /mnt/vendor/persist/magisk/"$MODID"\ 242 | /persist/magisk/"$MODID"\ 243 | /data/unencrypted/magisk/"$MODID"\ 244 | /cache/magisk/"$MODID"\ 245 | /cust/magisk/"$MODID" 246 | } 247 | 248 | 249 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=MotoCore 2 | name=Moto Core 3 | version=v1.2 4 | versionCode=12 5 | author=Rei Ryuki the Fixer 6 | description=System core framework library of Motorola ROM ported from Motorola XT2125 (nio) as a dependency of any Moto Magisk Module for any Android 6 (SDK 23) and up non-Motorola ROM. 7 | 8 | 9 | -------------------------------------------------------------------------------- /package.txt: -------------------------------------------------------------------------------- 1 | com.motorola.android.providers.settings 2 | com.motorola.motosignature.app 3 | -------------------------------------------------------------------------------- /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 | # conflict 12 | rm -f /data/adb/modules/*/system/app/MotoSignatureApp/.replace 13 | 14 | # cleaning 15 | FILE=$MODPATH/cleaner.sh 16 | if [ -f $FILE ]; then 17 | . $FILE 18 | mv -f $FILE $FILE.txt 19 | fi 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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 | 10 | -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | MODPATH=${0%/*} 2 | 3 | # log 4 | exec 2>$MODPATH/debug.log 5 | set -x 6 | 7 | # wait 8 | until [ "`getprop sys.boot_completed`" == 1 ]; do 9 | sleep 10 10 | done 11 | 12 | # list 13 | PKGS=`cat $MODPATH/package.txt` 14 | for PKG in $PKGS; do 15 | magisk --denylist rm $PKG 2>/dev/null 16 | magisk --sulist add $PKG 2>/dev/null 17 | done 18 | if magisk magiskhide sulist; then 19 | for PKG in $PKGS; do 20 | magisk magiskhide add $PKG 21 | done 22 | else 23 | for PKG in $PKGS; do 24 | magisk magiskhide rm $PKG 25 | done 26 | fi 27 | 28 | # allow 29 | PKG=com.motorola.android.providers.settings 30 | if appops get $PKG > /dev/null 2>&1; then 31 | appops set $PKG WRITE_SETTINGS allow 32 | PKGOPS=`appops get $PKG` 33 | UID=`dumpsys package $PKG 2>/dev/null | grep -m 1 Id= | sed -e 's| userId=||g' -e 's| appId=||g'` 34 | if [ "$UID" ] && [ "$UID" -gt 9999 ]; then 35 | UIDOPS=`appops get --uid "$UID"` 36 | fi 37 | fi 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # prevent bootloop 2 | ro.control_privapp_permissions=log 3 | -------------------------------------------------------------------------------- /system/app/MotoSignatureApp/MotoSignatureApp.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/app/MotoSignatureApp/MotoSignatureApp.apk -------------------------------------------------------------------------------- /system/etc/permissions/com.motorola.frameworks.core.addon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /system/etc/permissions/com.motorola.motosignature.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /system/etc/permissions/moto-checkin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /system/etc/permissions/moto-core_services.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /system/etc/permissions/moto-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /system/etc/permissions/moto.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /system/etc/permissions/privapp-com.motorola.android.providers.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /system/etc/sysconfig/config-com.motorola.android.providers.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /system/etc/sysconfig/config-com.motorola.motosignature.app.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /system/framework/com.motorola.frameworks.core.addon.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/framework/com.motorola.frameworks.core.addon.jar -------------------------------------------------------------------------------- /system/framework/com.motorola.motosignature.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/framework/com.motorola.motosignature.jar -------------------------------------------------------------------------------- /system/framework/moto-checkin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/framework/moto-checkin.jar -------------------------------------------------------------------------------- /system/framework/moto-core_services.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/framework/moto-core_services.jar -------------------------------------------------------------------------------- /system/framework/moto-settings.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/framework/moto-settings.jar -------------------------------------------------------------------------------- /system/framework/moto.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/framework/moto.jar -------------------------------------------------------------------------------- /system/priv-app/MotorolaSettingsProvider/MotorolaSettingsProvider.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reiryuki/Moto-Core-Magisk-Module/d909ee2b3124ebadd6fc29aaa0483791201e6c3f/system/priv-app/MotorolaSettingsProvider/MotorolaSettingsProvider.apk -------------------------------------------------------------------------------- /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 | PKGS=`cat $MODPATH/package.txt` 17 | for PKG in $PKGS; do 18 | rm -rf /data/user*/"$UID"/$PKG 19 | done 20 | remove_sepolicy_rule 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | --------------------------------------------------------------------------------