This commit is contained in:
KOWX712
2024-10-16 05:03:20 +08:00
committed by GitHub
parent 13886dabd8
commit 565bbeb75f
15 changed files with 280 additions and 123 deletions

View File

@@ -1,40 +1,20 @@
<h1 align="center">Magisk Module Template Extended (MMT-Ex)</h1>
# **Tricky Addon: Update Target List**
<div align="center">
<!-- Version -->
<img src="https://img.shields.io/badge/Version-v3.7-blue.svg?longCache=true&style=popout-square"
alt="Version" />
<!-- Last Updated -->
<img src="https://img.shields.io/badge/Updated-April 24, 2024-green.svg?longCache=true&style=flat-square"
alt="_time_stamp_" />
<!-- Min Magisk -->
<img src="https://img.shields.io/badge/MinMagisk-20.4-red.svg?longCache=true&style=flat-square"
alt="_time_stamp_" />
<!-- Min KSU -->
<img src="https://img.shields.io/badge/MinKernelSU-0.6.6-red.svg?longCache=true&style=flat-square"
alt="_time_stamp_" /></div>
## Description
- Automated script to update tricky store target list.
- Custom config: ADDITION and EXCLUDE in /data/adb/tricky_store/target_list_config
<div align="center">
<strong>MMT Extended is the spiritual successor of Unity and makes magisk module creation easy. Instructions in the
<h3><a href="https://github.com/Zackptg5/MMT-Extended/wiki">Wiki</a></h3><h4>Also supports KSU</h4>
</div>
## Requirements
- Tricky store module installed
<div align="center">
<h3>
<a href="https://github.com/Zackptg5/MMT-Extended">
Source Code
</a>
<span> | </span>
<a href="https://github.com/Zackptg5/MMT-Extended-Addons">
Addons Repository
</a>
<span> | </span>
<a href="https://forum.xda-developers.com/apps/magisk/magisk-module-template-extended-mmt-ex-t4029819">
XDA
</a>
</h3>
</div>
## Instructions
- Module will update taget list on every boot.
### Usage
- [Follow the directions here (DO NOT FORK)](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template)
- Then follow instructions in [Wiki](https://github.com/Zackptg5/MMT-Extended/wiki)
- Action button method
If action button feature is available, use action button can update tricky store target list.
- Manual script method
If action button feature isn't avaliable, you can run UpdateTargetList.sh under /data/adb/tricky_store/ manually.
## Links
[Telegram channel](https://t.me/kowchannel)

View File

@@ -1,86 +1,15 @@
### v3.7 - 4.24.2024
* Magisk v27 fix
### Tricky Addon: Update Target List
Automated script to update tricky store target.txt
Requirement: Tricky Store module installed
Telegram channel: https://t.me/kowchannel
### v3.6 - 2.16.2024
* Update magisk delta support (now called kitsune)
* Add support for APatch
* Add support for magisk atomic mounting (in theory)
## Changelog
### v1.2
- Automated update target list on every boot
- Initial release
### v3.5 - 9.11.2023
* Define SERVICED, POSTFSDATAD, and SYSTEM_ROOT if not already defined - were removed or renamed in magisk 26.2 and 26.3 for no good reason :/
### v1.1
- Add exclution and addition list config, config directory: /data/adb/tricky_store/target_list_config (No release)
### v3.4 - 9.3.2023
* Bug fix for boot-completed scripts
### v3.3 - 8.13.2023
* Updates for KSU
* min ksu version now v0.6.6
* added support for boot-completed scripts
### v3.2 - 8.11.2023
* Bug fixes for custom partitions
### v3.1 - 7.25.2023
* Add override for extra partitions in event you have workaround for support for regular magisk installs
### v3.0 - 7.10.2023
* Add support for KSU modules
* Add support for magisk delta
* Add support for other partitions - note that you need magisk delta or ksu installed to use these
* Make debug default behavior, remove flag
* Fix uninstall script so it'll clean up files outside of module folder if user manually deletes module folder
### v2.1 - 5.24.2023
* Update variables for magisk 26
### v2.0 - 1.29.2022
* Update for magisk 24
* Added zygisk module support
* Misc fixes
### v1.8 - 11.21.2021
* Fix for magisk canary
* Minimum magisk version now 20.4
### v1.7 - 9.9.2021
* Small fix for magisk canary
### v1.6 - 9.12.2020
* Updates for latest magisk - minmagisk is 20 now
* Added back ro.build.product to device_check for older roms
* Moved credits so it'll work with latest magisk mod template
### v1.5 - 3.27.2020
* Have debug log be part of regular log, remove superfluous stuff, module dev can just add what they want
* Removed addon runtime confusion - all scripts are install.sh now
* Added manufacturer option to device_check
* Fixes for Magisk 20.4
### v1.4 - 2.20.2020
* Add more vendor perms
* Fixed uninstall.sh script install behavior - it'll install if there's files outside of modpath or if there's custom logic at the top of it
* Misc bug fixes
### v1.3 - 1.22.2020
* Move debug log to same location as magisk log - Download folder
* Add proper chcon for vendor files - fixes various issues with audioflinger and maybe more with android Q
* Remove empty folders after moving files for DYNLIB
* Fix api check bug
### v1.2 - 1.17.2020
* Fixed bug in debug log
* Fixed DYNLIB so it won't move empty files (replacements) to vendor
* Magisk manager only installs now - will automatically remove module if flashed in recovery
* Removed extra crap that was needed for recovery installs
* Removed common/uninstall and upgrade scripts, no need for them anymore
* Removed mount_part function - no need for it now since recovery is no longer supported - just remount partition as rw
* More in line with regular magisk module template now - flashing zip always installs/upgrades mod. To uninstall, use magisk manager
### v1.1 - 1.11.2020
* No longer use .core - it'll be deprecated soon
* Fix for uninstall
* Fix bug in debug function during uninstalls
* Misc fixes
### v1.0 - 1.4.2020
* Initial release
### v1.0
- Initial version (No release)

View File

@@ -0,0 +1,33 @@
#!/sbin/sh
#################
# Initialization
#################
umask 022
# echo before loading util_functions
ui_print() { echo "$1"; }
require_new_magisk() {
ui_print "*******************************"
ui_print " Please install Magisk v20.4+! "
ui_print "*******************************"
exit 1
}
#########################
# Load util_functions.sh
#########################
OUTFD=$2
ZIPFILE=$3
mount /data 2>/dev/null
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
install_module
exit 0

View File

@@ -0,0 +1 @@
#MAGISK

9
module/action.sh Normal file
View File

@@ -0,0 +1,9 @@
MODDIR=${0%/*}
echo "**********************************************"
echo "- Staring script..."
echo " "
sh "$MODDIR"/common/UpdateTargetList.sh || true
echo "**********************************************"
echo "\(__All set!__)/"

1
module/common/.keybox Normal file
View File

@@ -0,0 +1 @@
nothing here

9
module/common/ADDITION Normal file
View File

@@ -0,0 +1,9 @@
# This is the list of additional apps to include in the target file
# DO NOT remove the default app here
# You can add your custom addition app's package name here
# Each app package name should be on a new line
com.google.android.gms
io.github.vvb2060.keyattestation
io.github.vvb2060.mahoshojo
icu.nullptr.nativetest

9
module/common/EXCLUDE Normal file
View File

@@ -0,0 +1,9 @@
# This is the list of apps to exclude from the target file
# DO NOT remove the default app here
# You can add your custom exclusion app here
# Each app package name should be on a new line
oneplus
coloros
com.android.patch
me.bmax.apatch

View File

@@ -0,0 +1,58 @@
#!/bin/sh
# by KOW, telegram channel: https://t.me/kowchannel
# This script will put all non-system app into /data/adb/tricky_store/target.txt
# Using module to put normal app into system app may exclude corresponding app from this script too, please disable it if you found this script doesn't work.
# Define the mod path
MODDIR="/data/adb/tricky_store/target_list_config"
# Config file check
echo "- Checking config files..."
echo " "
if [ ! -f "$MODDIR/EXCLUDE" ]; then
echo "! Exclude list is missing!"
exit 1
else
echo "- Exclude config file found."
echo " "
fi
if [ ! -f "$MODDIR/ADDITION" ]; then
echo "! Addition list is missing"
exit 1
else
echo "- Addition config file found."
echo " "
fi
# Read exclution and addition config
EXCLUDE=$(grep -vE '^#|^$' "$MODDIR/EXCLUDE" | tr '\n' '|' | sed 's/|$//')
ADDITIONS=$(grep -vE '^#|^$' "$MODDIR/ADDITION")
# Create or overwrite the target.txt file
echo "- Overwritting target.txt"
echo " "
su -c > /data/adb/tricky_store/target.txt
# Add all non-system apps to the target file and remove exclusions
echo "- Adding apps into /data/adb/tricky_store/target.txt"
echo " "
su -c pm list packages -3 </dev/null 2>&1 | cat | awk -F: '{print $2}' | grep -Ev "$EXCLUDE" > /data/adb/tricky_store/target.txt
sleep 1
# Add additional apps to the target file if they are not already present
echo "- Adding addition app... "
echo " "
for app in $ADDITIONS; do
if ! grep -qx "$app" /data/adb/tricky_store/target.txt; then
echo "$app" >> /data/adb/tricky_store/target.txt
fi
done
# Force stop gms. Not necessary, you can add it if you want
#su -c killall com.google.android.gms
#su -c killall com.google.android.gms.unstable
echo "- target.txt updated successfully"
echo " "

View File

@@ -0,0 +1,3 @@
# To pass Minotaur native test Conventional Test (8), you can get your VerifiedBootHash from KeyAttestation app
# Put verifiedBootHash after 'ro.boot.vbmeta.digest=' and remove the '#' infront of it.
#ro.boot.vbmeta.digest=

91
module/customize.sh Normal file
View File

@@ -0,0 +1,91 @@
SKIPUNZIP=0
DEBUG=false
if [ "$(which magisk)" ]; then
BM="Magisk:$MAGISK_VER$MAGISK_VER_CODE"
elif [ "$KSU" ]; then
BM="KSU:$KSU_KERNEL_VER_CODE$KSU_VER_CODE"
elif [ "$APATCH" ]; then
BM="APatch:$APATCH_VER$APATCH_VER_CODE"
else
ui_print " ";
ui_print "! recovery is not supported";
abort " ";
fi
print_modname() {
ui_print "*******************************************************"
ui_print "Installing Tricky Addon: Update Target List"
ui_print "Author: KOWX712"
ui_print "*******************************************************"
}
if [ -d /data/adb/modules/tricky_store ]; then
echo "- Tricky store module installed"
else
echo "! Tricky store module is not installed"
exit 1
fi
key_check() {
while true; do
key_check=$(/system/bin/getevent -qlc 1)
key_event=$(echo "$key_check" | awk '{ print $3 }' | grep 'KEY_')
key_status=$(echo "$key_check" | awk '{ print $4 }')
if [[ "$key_event" == *"KEY_"* && "$key_status" == "DOWN" ]]; then
keycheck="$key_event"
break
fi
done
while true; do
key_check=$(/system/bin/getevent -qlc 1)
key_event=$(echo "$key_check" | awk '{ print $3 }' | grep 'KEY_')
key_status=$(echo "$key_check" | awk '{ print $4 }')
if [[ "$key_event" == *"KEY_"* && "$key_status" == "UP" ]]; then
break
fi
done
}
ui_print "- Installing..."
COMPATH="$MODPATH/common"
CONFIG_DIR="/data/adb/tricky_store/target_list_config"
SCRIPT_DIR="/data/adb/tricky_store"
cp "$MODPATH/module.prop" "$COMPATH/disabled"
sed -i 's/^description=.*/description=Tricky store is disabled/' "$COMPATH/disabled"
cp "$MODPATH/module.prop" "$COMPATH/ninstalled"
sed -i 's/^description=.*/description=Tricky store is not installed/' "$COMPATH/ninstalled"
cp "$MODPATH/module.prop" "$COMPATH/normal"
CONFIG_DIR="/data/adb/tricky_store/target_list_config"
SCRIPT_DIR="/data/adb/tricky_store"
mkdir -p "$CONFIG_DIR"
cp "$COMPATH/UpdateTargetList.sh" "$SCRIPT_DIR/UpdateTargetList.sh"
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
if [ ! -f "/data/adb/modules/TA_utl/system.prop" ]; then
mv "$COMPATH/system.prop" "$MODPATH/system.prop"
else
rm -f "$COMPATH/system.prop"
mv "/data/adb/modules/TA_utl/system.prop" "$MODPATH/system.prop"
fi
kb="$COMPATH/.keybox"
ui_print "*********************************************"
ui_print "- Do you want to replace tricky store keybox?"
ui_print " Volume up: YES"
ui_print " Volume up: NO"
ui_print "*********************************************"
key_check
if [[ "$keycheck" == "KEY_VOLUMEUP" ]]; then
ui_print "*********************************************"
ui_print "- Replacing keybox..."
ui_print "*********************************************"
mv "$SCRIPT_DIR/keybox.xml" "$COMPATH/origkeybox"
mv "$kb" "$SCRIPT_DIR/keybox.xml"
else
rm -f "$kb"
fi
ui_print " "
ui_print "- Installation completed successfully! "
ui_print " "

7
module/module.prop Normal file
View File

@@ -0,0 +1,7 @@
id=TA_utl
name=Tricky Addon: Update Target List
version=v1.2
versionCode=12
author=KOWX712
description=Update tricky store target list with action button. Custom config: ADDITION and EXCLUDE in /data/adb/tricky_store/target_list_config
updateJson=https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/refs/heads/master/update.json

18
module/service.sh Normal file
View File

@@ -0,0 +1,18 @@
MODDIR=${0%/*}
COMPATH="$MODDIR/common"
# Check pm command functionality
sleep 10
until pm list packages > /dev/null 2>&1; do
sleep 1
done
# Check tricky store status
TS="/data/adb/modules/tricky_store"
if [ -f "$TS/disable" ]; then
cat "$COMPATH/disabled" > "$MODDIR/module.prop"
elif [ ! -d "$TS" ]; then
cat "$COMPATH/ninstalled" > "$MODDIR/module.prop"
else
cat "$COMPATH/normal" > "$MODDIR/module.prop"
sh "$MODDIR"/common/UpdateTargetList.sh || true
fi

9
module/uninstall.sh Normal file
View File

@@ -0,0 +1,9 @@
MODDIR="/data/adb/tricky_store"
# Remove residue and restore original keybox.
MODPATH=${0%/*}
rm -rf "$MODDIR/target_list_config"
rm -f "$MODDIR/UpdateTargetList.sh"
if [ -f "$MODPATH/common/origkeybox" ]; then
rm -f "$MODDIR/keybox.xml"
mv "$MODPATH/common/origkeybox" "$MODDIR/keybox.xml"
fi

View File

@@ -1,6 +1,6 @@
{
"version": "v3.6",
"versionCode": 18,
"zipUrl": "https://raw.githubusercontent.com/Zackptg5/MMT-Extended/install.zip",
"changelog": "https://raw.githubusercontent.com/Zackptg5/MMT-Extended/changelog.md"
"version": "v1.2",
"versionCode": 12,
"zipUrl": "",
"changelog": "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/refs/heads/master/changelog.md"
}