├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── customize.sh ├── helper.sh ├── module.prop ├── service.sh └── uninstall.sh /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 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TrickyStore Helper 2 | 3 | For adding more files to target.txt automatically on device boot. 4 | 5 | All files are stored in `/data/adb/tricky_store/helper` folder. 6 | 7 | Inside that folder, there are 4 files: 8 | 9 | ## config.txt 10 | This is where you can modify the default configuration options for the module. 11 |
12 | Defaults 13 | 14 | #### *FORCE_LEAF_HACK (default value "false")* 15 | - This adds "?" to either all package names, or ones defined in "force.txt" 16 | 17 | #### *FORCE_CERT_GEN (default value "false")* 18 | - This adds "!" to either all package names, or ones defined in "force.txt" 19 | 20 | #### *USE_DEFAULT_EXCLUSIONS (default value "true")* 21 | - This excludes a predefined default list of packages for target.txt, which should be irrelevant for spoofing a locked bootloader 22 | 23 | #### *CUSTOM_LOGLEVEL (not included by default)* 24 | - This allows adding debug logging to be logged to logcat, with the tag "TSHelper". This may be helpful if there is an issue booting the device. 25 |
26 | 27 | ## exclude.txt 28 | This file contains a list of packages that you want excluded from target.txt. This may be useful if some app is having issues because of spoofing. If no packages need to be excluded, then this file should remain empty. 29 | 30 | ## force.txt 31 | This file contains a list of specific packages that you want either the leaf hack or certificate generation applied to. For this list to be applied, either of those force options will need to be set to true (but not both). If you want to globally apply either, then this list should remain empty. 32 | 33 | ## TSHelper.log 34 | Log file for the module. ALL logging will appear in this file, regardless of the log level that is set. 35 | -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | TS_FOLDER="/data/adb/tricky_store" 2 | TS_MODULE_FOLDER="/data/adb/modules/tricky_store" 3 | 4 | # Check for TrickyStore installation before we proceed 5 | { [ -d "$TS_FOLDER" ] && [ -d "$TS_MODULE_FOLDER" ]; } || abort "- Please install TrickyStore before installing this module." 6 | 7 | TS_HELPER="$TS_FOLDER/helper" 8 | CONFIG_FILE="$TS_HELPER/config.txt" 9 | EXCLUDE_FILE="$TS_HELPER/exclude.txt" 10 | FORCE_FILE="$TS_HELPER/force.txt" 11 | 12 | # Clean up old module remnant 13 | rm -rf "$TS_FOLDER/helper-log.txt" 14 | 15 | # Prepare the helper folder 16 | if [ ! -d "$TS_HELPER" ] 17 | then 18 | mkdir "$TS_HELPER" 19 | fi 20 | if [ ! -f "$CONFIG_FILE" ] 21 | then 22 | echo "FORCE_LEAF_HACK=false">"$TS_HELPER/config.txt" 23 | echo "FORCE_CERT_GEN=false">>"$TS_HELPER/config.txt" 24 | echo "USE_DEFAULT_EXCLUSIONS=true">>"$TS_HELPER/config.txt" 25 | fi 26 | if [ ! -f "$EXCLUDE_FILE" ] 27 | then 28 | touch "$TS_HELPER/exclude.txt" 29 | fi 30 | if [ -f "$TS_FOLDER/force.txt" ] 31 | then 32 | mv "$TS_FOLDER/force.txt" "$TS_HELPER/force.txt" 33 | fi 34 | if [ ! -f "$FORCE_FILE" ] 35 | then 36 | touch "$TS_HELPER/force.txt" 37 | fi 38 | -------------------------------------------------------------------------------- /helper.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | MODDIR=${0%/*} 4 | # 5 | # TrickyStore Helper Script by Captain_Throwback 6 | # 7 | # Add all installed packages to target.txt at boot 8 | # 9 | # 10 | # The below variable shouldn't need to be changed 11 | # unless you want to call the log/tag something else 12 | SCRIPTNAME="TSHelper" 13 | 14 | # Module files 15 | TS_FOLDER="/data/adb/tricky_store" 16 | TS_HELPER="$TS_FOLDER/helper" 17 | CONFIG_FILE="$TS_HELPER/config.txt" 18 | EXCLUDE_FILE="$TS_HELPER/exclude.txt" 19 | FORCE_FILE="$TS_HELPER/force.txt" 20 | LOG_FILE="$TS_HELPER/$SCRIPTNAME.log" 21 | 22 | # Prepare the folders 23 | if [ -d "$TS_FOLDER" ] 24 | then 25 | mkdir -p "$TS_HELPER" 26 | else 27 | FATAL_ERROR="TrickyStore folder not found. Please install TrickyStore to use this module." 28 | log -p "F" -t "$SCRIPTNAME" "$FATAL_ERROR" 29 | echo "$FATAL_ERROR" 30 | exit 1 31 | fi 32 | 33 | # Set default log level 34 | DEFAULT_LOGLEVEL=3 35 | # 0 No logs printed 36 | # 1 Fatal only 37 | # 2 Fatal and Errors 38 | # 3 Fatal, Errors, and Warnings 39 | # 4 Fatal, Errors, Warnings, and Information 40 | # 5 Fatal, Errors, Warnings, Information, and Debugging 41 | # 6 All logs printed 42 | if [ -f "$CONFIG_FILE" ] 43 | then 44 | CUSTOM_LOGLEVEL=$(grep '^CUSTOM_LOGLEVEL=' $CONFIG_FILE | cut -d '=' -f 2) 45 | fi 46 | if [ -n "$CUSTOM_LOGLEVEL" ] 47 | then 48 | __VERBOSE="$CUSTOM_LOGLEVEL" 49 | else 50 | __VERBOSE="$DEFAULT_LOGLEVEL" 51 | fi 52 | 53 | # Exit codes: 54 | # 0 Success 55 | # 1 TrickyStore folder missing 56 | # 2 Leaf Hack & Cert Gen both set to true 57 | 58 | # Function for logging to logcat and log file 59 | log_print() 60 | { 61 | case $1 in 62 | 0) 63 | # S: Silent (highest priority, where nothing is ever printed) 64 | LOG_LEVEL="S" 65 | ;; 66 | 1) 67 | # F: Fatal 68 | LOG_LEVEL="F" 69 | ;; 70 | 2) 71 | # E: Error 72 | LOG_LEVEL="E" 73 | ;; 74 | 3) 75 | # W: Warning 76 | LOG_LEVEL="W" 77 | ;; 78 | 4) 79 | # I: Info 80 | LOG_LEVEL="I" 81 | ;; 82 | 5) 83 | # D: Debug 84 | LOG_LEVEL="D" 85 | ;; 86 | 6) 87 | # V: Verbose (lowest priority) 88 | LOG_LEVEL="V" 89 | ;; 90 | esac 91 | if [ "$__VERBOSE" -ge "$1" ] 92 | then 93 | log -p "$LOG_LEVEL" -t "$SCRIPTNAME" "$2" 94 | fi 95 | echo "$(date '+%m-%d %T.%3N') $LOG_LEVEL $SCRIPTNAME: $2" >> "$LOG_FILE" 96 | } 97 | 98 | # Clear old files 99 | rm -rf "$LOG_FILE" 100 | rm -rf "$TARGET_TMP" 101 | rm -rf "$TARGET_FILE" 102 | 103 | # DEBUG: Base Logging 104 | log_print 5 "LOGLEVEL=$__VERBOSE" 105 | 106 | # NOTE: Only ONE of the below options can be set to true! 107 | # Leaving both options set to false will use auto mode, 108 | # which is suitable for most devices and packages 109 | # 110 | # If any packages require manual leaf cert hack 111 | # then set below flag to "true" (adds "?" to end of package name) 112 | # If all packages should use option, then leave FORCE_LIST blank 113 | # and make sure /data/adb/tricky_store/helper/force.txt is not present 114 | # (more info below) 115 | if [ -f "$CONFIG_FILE" ] 116 | then 117 | FORCE_LEAF_HACK=$(grep '^FORCE_LEAF_HACK=' "$CONFIG_FILE" | cut -d '=' -f 2) 118 | fi 119 | if [ -z "$FORCE_LEAF_HACK" ] 120 | then 121 | FORCE_LEAF_HACK=false 122 | fi 123 | # DEBUG: Base Logging 124 | log_print 5 "FORCE_LEAF_HACK=$FORCE_LEAF_HACK" 125 | 126 | # If any packages require manual certificate generation 127 | # then set below flag to "true" (adds "!" to end of package name) 128 | # If all packages should use option, then leave FORCE_LIST blank 129 | # and make sure /data/adb/tricky_store/helper/force.txt is not present 130 | # (more info below) 131 | if [ -f "$CONFIG_FILE" ] 132 | then 133 | FORCE_CERT_GEN=$(grep '^FORCE_CERT_GEN=' "$CONFIG_FILE" | cut -d '=' -f 2) 134 | fi 135 | if [ -z "$FORCE_CERT_GEN" ] 136 | then 137 | FORCE_CERT_GEN=false 138 | fi 139 | # DEBUG: Base Logging 140 | log_print 5 "FORCE_CERT_GEN=$FORCE_CERT_GEN" 141 | 142 | if $FORCE_LEAF_HACK && $FORCE_CERT_GEN 143 | then 144 | log_print 1 "Leaf hack and Certificate generation both set to true." 145 | log_print 1 "Set one or both to false to run properly. Script exiting." 146 | exit 2 147 | fi 148 | 149 | add_to_list() { 150 | if [ -f "$1" ] 151 | then 152 | PACKAGE_LIST=() 153 | while IFS='' read -r package || [ -n "$package" ] 154 | do 155 | PACKAGE_LIST+=("$package") 156 | done < "$1" 157 | case "$2" in 158 | "EXCLUDE_LIST") 159 | EXCLUDE_LIST=("${PACKAGE_LIST[@]}") 160 | ;; 161 | "FORCE_LIST") 162 | FORCE_LIST=("${PACKAGE_LIST[@]}") 163 | ;; 164 | esac 165 | fi 166 | } 167 | 168 | process_package_list() { 169 | while read package 170 | do 171 | case "$1" in 172 | "EXCLUDE_LIST") 173 | PACKAGE_LIST=("${EXCLUDE_LIST[@]}") 174 | ;; 175 | "FORCE_LIST") 176 | PACKAGE_LIST=("${FORCE_LIST[@]}") 177 | ;; 178 | esac 179 | for list_item in "${PACKAGE_LIST[@]}" 180 | do 181 | EXISTS=0 182 | if [ "$list_item" = "$package" ] 183 | then 184 | EXISTS=1 185 | break 186 | fi 187 | done 188 | case "$1" in 189 | "EXCLUDE_LIST") 190 | if [ "$EXISTS" -eq 1 ] 191 | then 192 | sed -i "/^$package$/d" "$TARGET_FILE" 193 | fi 194 | ;; 195 | "FORCE_LIST") 196 | if [ "$EXISTS" -eq 1 ] 197 | then 198 | if $FORCE_LEAF_HACK && (( ${#FORCE_LIST[@]} != 0 )) 199 | then 200 | sed -i s/"$package"$/"$package"\?/ "$TARGET_FILE" 201 | fi 202 | if $FORCE_CERT_GEN && (( ${#FORCE_LIST[@]} != 0 )) 203 | then 204 | sed -i s/"$package"$/"$package"\!/ "$TARGET_FILE" 205 | fi 206 | fi 207 | ;; 208 | esac 209 | done < "$TARGET_FILE" 210 | } 211 | 212 | finish_success() { 213 | log_print 4 "Script complete." 214 | exit 0 215 | } 216 | 217 | # If specific packages need to be excluded from the target list, 218 | # add them to /data/adb/tricky_store/helper/exclude.txt 219 | # Use the above flags to choose which manual mode should be used 220 | add_to_list "$EXCLUDE_FILE" "EXCLUDE_LIST" 221 | 222 | # Default exclusions 223 | DEFAULT_EXCLUSIONS=( 224 | "^android" 225 | "^com.android" 226 | "com.google.android.apps.nexuslauncher" 227 | "overlay" 228 | "systemui" 229 | "webview" 230 | ) 231 | if [ -f "$CONFIG_FILE" ] 232 | then 233 | USE_DEFAULT_EXCLUSIONS=$(grep '^USE_DEFAULT_EXCLUSIONS=' "$CONFIG_FILE" | cut -d '=' -f 2) 234 | fi 235 | if [ -z "$USE_DEFAULT_EXCLUSIONS" ] 236 | then 237 | USE_DEFAULT_EXCLUSIONS=true 238 | fi 239 | if [ "$USE_DEFAULT_EXCLUSIONS" = "true" ] 240 | then 241 | DEFAULT_EXCLUSIONS_LIST=$(printf '%s|' "${DEFAULT_EXCLUSIONS[@]}") 242 | fi 243 | 244 | # DEBUG: Base Logging 245 | log_print 5 "USE_DEFAULT_EXCLUSIONS=$USE_DEFAULT_EXCLUSIONS" 246 | 247 | # If only specific packages require one of the above options, 248 | # add them to /data/adb/tricky_store/helper/force.txt 249 | # Use the above flags to choose which manual mode should be used 250 | add_to_list "$FORCE_FILE" "FORCE_LIST" 251 | 252 | # Script processing start 253 | log_print 4 "$SCRIPTNAME script start" 254 | log_print 4 "Boot complete. $SCRIPTNAME processing " 255 | 256 | # Location of TrickyStore files 257 | TARGET_FILE="$TS_FOLDER/target.txt" 258 | 259 | # Add ALL the packages to target.txt 260 | if [ -n "$DEFAULT_EXCLUSIONS_LIST" ] 261 | then 262 | pm list packages | cut -d ":" -f 2 | grep -Ev "${DEFAULT_EXCLUSIONS_LIST%?}" | sort > "$TARGET_FILE" 263 | else 264 | pm list packages | cut -d ":" -f 2 | sort > "$TARGET_FILE" 265 | fi 266 | 267 | # Remove excluded packages 268 | if (( ${#EXCLUDE_LIST[@]} != 0 )) 269 | then 270 | process_package_list "EXCLUDE_LIST" 271 | fi 272 | 273 | # Tag force packages 274 | if (( ${#FORCE_LIST[@]} == 0 )) 275 | then 276 | if $FORCE_LEAF_HACK 277 | then 278 | log_print 4 "FORCE_LEAF_HACK set. Appending '?' to all package names..." 279 | sed -i s/$/\?/ "$TARGET_FILE" 280 | finish_success 281 | elif $FORCE_CERT_GEN 282 | then 283 | log_print 4 "FORCE_CERT_GEN set. Appending '!' to all package names..." 284 | sed -i s/$/\!/ "$TARGET_FILE" 285 | finish_success 286 | else 287 | finish_success 288 | fi 289 | else 290 | if $FORCE_LEAF_HACK || $FORCE_CERT_GEN 291 | then 292 | process_package_list "FORCE_LIST" 293 | fi 294 | fi 295 | 296 | finish_success 297 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=trickystorehelper 2 | name=Tricky Store Helper 3 | version=v0.2.1 4 | versionCode=0000210 5 | author=Captain_Throwback 6 | description=Add all installed packages to target.txt 7 | -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | MODDIR=${0%/*} 4 | 5 | # Wait for boot_completed 6 | resetprop -w sys.boot_completed 0 > /dev/null 2>&1 7 | 8 | # Run helper script using system sh 9 | /system/bin/sh "$MODDIR/helper.sh" 10 | -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | TS_FOLDER="/data/adb/tricky_store" 2 | TS_HELPER="$TS_FOLDER/helper" 3 | 4 | # Remove module files 5 | rm -rf "$TS_HELPER" 6 | --------------------------------------------------------------------------------