Compare commits

18 Commits
v1.3 ... v1.4

Author SHA1 Message Date
KOWX712
07ab5f92b5 Update module.prop 2024-10-28 21:50:53 +08:00
KOWX712
9e64bde6a8 Update changelog.md 2024-10-28 21:46:43 +08:00
KOWX712
f2b1a0b79c Update UpdateTargetList.sh 2024-10-28 21:42:38 +08:00
KOWX712
ebe9fce938 Update README.md 2024-10-28 21:37:49 +08:00
KOWX712
c0a4dd4128 v1.4 2024-10-28 21:34:42 +08:00
KOWX712
1ebe14c646 refactor code
simplify, bug fix, unify variable name
2024-10-28 21:28:56 +08:00
KOWX712
4a7437705c change ro.boot.vbmeta.digest logic
migrate from system.prop to reset prop due system.prop not working on some device
2024-10-28 19:50:02 +08:00
KOWX712
608f3364af Merge branch 'master' of https://github.com/KOWX712/Tricky-Addon-Update-Target-List 2024-10-28 03:16:19 +08:00
KOWX712
6d56230a99 Update customize.sh 2024-10-28 03:16:15 +08:00
KOWX712
a07ce94b1b Update update.json 2024-10-27 03:00:13 +08:00
KOWX712
a2132bdc3a Update changelog.md 2024-10-27 02:43:02 +08:00
KOWX712
3dbc256230 Update update.json 2024-10-27 02:35:24 +08:00
KOWX712
cf5b4d458d fix recognition issue 2024-10-27 02:24:27 +08:00
KOWX712
dc85dfbe10 fix 2024-10-27 01:34:30 +08:00
KOWX712
c89b112d98 Merge branch 'master' of https://github.com/KOWX712/Tricky-Addon-Update-Target-List 2024-10-27 01:06:08 +08:00
KOWX712
5e790b98f7 1.3.1 initial 2024-10-27 01:06:03 +08:00
KOWX712
bd3362646f Update update.json 2024-10-26 04:38:07 +08:00
KOWX712
35f481c626 Update update.json 2024-10-26 04:37:57 +08:00
14 changed files with 136 additions and 71 deletions

View File

@@ -3,11 +3,21 @@ Automated script to update tricky store target.txt
Requirement: Tricky Store module installed
GitHub release: https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest
Manually add VerifiedBootHash to /data/adb/modules/TA_utl/boot_hash (optional)
Telegram channel: https://t.me/kowchannel
GitHub release: [https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest)
Telegram channel: [https://t.me/kowchannel](https://t.me/kowchannel)
## Changelog
### v1.4
- Migrate ro.boot.vbmeta.digest from system.prop to resetprop
- Refactor code
### v1.3.1
- Added Apatch Next package name to exclude list
- Fix automatic update target script not working issue
### v1.3
- Minor improvement in code
- Overwrite protection: won't remove previous setup when updating module

View File

@@ -1,8 +1,15 @@
## Tricky Addon Lite: Update Target List Script
- Script only, **NOT Module**
- Run with root priviledge
- Recommend to run with MT manager
## Changelog
### v1.4
- Remain same with v1.3.1
### v1.3.1
- Added Apatch Next package name to exclude list
### v1.3
- More user friendly exclude and addition list config

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# by KOW
# Tricky Addon Lite: Update Target List Script v1.3
# Tricky Addon Lite: Update Target List Script v1.4 (v1.3.1)
# GitHub Repository: https://github.com/KOWX712/Tricky-Addon-Update-Target-List/blob/master/lite-script_only/README.md
# Telegram channel: https://t.me/kowchannel
@@ -13,7 +13,8 @@ EXCLUDE="
oneplus
coloros
com.android.patch
me.bmax.apatch"
me.bmax.apatch
me.garfieldhan.apatch.next"
ADDITION="
com.google.android.gms

View File

@@ -10,14 +10,14 @@ MODDIR="/data/adb/tricky_store/target_list_config"
echo "- Checking config files..."
echo " "
if [ ! -f "$MODDIR/EXCLUDE" ]; then
echo "! Exclude list is missing, please reinstall module"
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, please reinstall module"
echo "! Addition list is missing"
exit 1
else
echo "- Addition config file found."
@@ -26,7 +26,7 @@ fi
# Read exclution and addition config
EXCLUDE=$(grep -vE '^#|^$' "$MODDIR/EXCLUDE" | tr '\n' '|' | sed 's/|$//')
ADDITION=$(grep -vE '^#|^$' "$MODDIR/ADDITION")
ADDITION=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/ADDITION")
# Create or overwrite the target.txt file
echo "- Overwritting target.txt"
@@ -43,7 +43,8 @@ sleep 1
echo "- Adding addition app... "
echo " "
for app in $ADDITION; do
if ! grep -qx "$app" /data/adb/tricky_store/target.txt; then
app=$(echo "$app" | tr -d '[:space:]') # Trim any whitespace
if ! grep -Fxq "$app" /data/adb/tricky_store/target.txt; then
echo "$app" >> /data/adb/tricky_store/target.txt
fi
done

View File

@@ -3,9 +3,9 @@ echo "**********************************************"
echo "- Staring script..."
echo " "
sh "$MODDIR"/common/UpdateTargetList.sh
sh "$MODDIR"/UpdateTargetList.sh
echo "**********************************************"
echo "\(__All set!__)/"
echo "Exiting in 3 seconds..."
sleep 3
echo "Exiting in 2 seconds..."
sleep 2

View File

@@ -6,4 +6,4 @@
com.google.android.gms
io.github.vvb2060.keyattestation
io.github.vvb2060.mahoshojo
icu.nullptr.nativetest
icu.nullptr.nativetest

View File

@@ -6,4 +6,5 @@
oneplus
coloros
com.android.patch
me.bmax.apatch
me.bmax.apatch
me.garfieldhan.apatch.next

6
module/common/boot_hash Normal file
View File

@@ -0,0 +1,6 @@
# This file is to pass Minotaur native test 'Partition Check Fail'
# Download Key Attestation (chiteroman fork recommended)
# Link: https://github.com/chiteroman/KeyAttestation/releases
# Get your VerifiedBootHash value from Key Attestation app
# Ask here if you don't know how to do: https://t.me/kowchannelchat
# Paste verifiedBootHash value on next line and save

View File

@@ -1,3 +0,0 @@
# 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=

View File

@@ -1,6 +1,6 @@
SKIPUNZIP=0
DEBUG=false
if [ "$(which magisk)" ]; then
if [ "$MAGISK_VER_CODE" ]; then
BM="Magisk:$MAGISK_VER$MAGISK_VER_CODE"
elif [ "$KSU" ]; then
BM="KSU:$KSU_KERNEL_VER_CODE$KSU_VER_CODE"
@@ -19,7 +19,15 @@ print_modname() {
ui_print "*******************************************************"
}
if [ -d /data/adb/modules/tricky_store ]; then
COMPATH="$MODPATH/common"
TS="/data/adb/tricky_store"
CONFIG_DIR="$TS/target_list_config"
MODNAME=$(grep '^id=' "$MODPATH/module.prop" | awk -F= '{print $2}' | xargs)
ORG_DIR="/data/adb/modules/$MODNAME"
EXCLUDE=$(grep -vE '^#|^$' "$CONFIG_DIR/EXCLUDE")
ADDITION=$(grep -vE '^#|^$' "$CONFIG_DIR/ADDITION")
if [ -d "$TS" ]; then
echo "- Tricky store module installed"
else
echo "! Tricky store module is not installed"
@@ -46,43 +54,62 @@ key_check() {
done
}
add_exclude() {
for app in $EXCLUDE; do
if ! grep -qx "$app" $COMPATH/EXCLUDE; then
echo "$app" >> $COMPATH/EXCLUDE
fi
done
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
}
add_addition() {
for app in $ADDITION; do
if ! grep -qx "$app" $COMPATH/ADDITION; then
echo "$app" >> $COMPATH/ADDITION
fi
done
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
}
ui_print "- Installing..."
COMPATH="$MODPATH/common"
CONFIG_DIR="/data/adb/tricky_store/target_list_config"
SCRIPT_DIR="/data/adb/tricky_store"
MODNAME=$(grep '^id=' "$MODPATH/module.prop" | awk -F= '{print $2}' | xargs)
for status in normal ninstalled disabled; do
cp "$MODPATH/module.prop" "$COMPATH/$status"
done
sed -i 's/^description=.*/description=Tricky store is not installed/' "$COMPATH/ninstalled"
sed -i 's/^description=.*/description=Tricky store is disabled/' "$COMPATH/disabled"
rm -f "$SCRIPT_DIR/UpdateTargetList.sh"
cp "$COMPATH/UpdateTargetList.sh" "$SCRIPT_DIR/UpdateTargetList.sh"
if [ ! -d "$CONFIG_DIR" ]; then
mkdir -p "$CONFIG_DIR"
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
elif [ -d "$CONFIG_DIR" ]; then
cp "$MODPATH/UpdateTargetList.sh" "$TS/UpdateTargetList.sh"
cp "$MODPATH/module.prop" "$COMPATH/module.prop.orig"
if [ -d "$CONFIG_DIR" ]; then
if [ ! -f "$CONFIG_DIR/EXCLUDE" ] && [ ! -f "$CONFIG_DIR/ADDITION" ]; then
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
elif [ ! -f "$CONFIG_DIR/ADDITION" ]; then
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
rm -f "$COMPATH/EXCLUDE"
add_exclude
elif [ ! -f "$CONFIG_DIR/EXCLUDE" ]; then
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
rm -f "$COMPATH/ADDITION"
add_addition
else
rm -f "$COMPATH/EXCLUDE"
rm -f "$COMPATH/ADDITION"
add_exclude
add_addition
fi
else
mkdir -p "$CONFIG_DIR"
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
fi
if [ ! -f "/data/adb/modules/$MODNAME/system.prop" ]; then
mv "$COMPATH/system.prop" "$MODPATH/system.prop"
if [ ! -f "$ORG_DIR/boot_hash" ]; then
mv "$COMPATH/boot_hash" "$MODPATH/boot_hash"
else
rm -f "$COMPATH/system.prop"
mv "/data/adb/modules/$MODNAME/system.prop" "$MODPATH/system.prop"
rm -f "$COMPATH/boot_hash"
mv "$ORG_DIR/boot_hash" "$MODPATH/boot_hash"
fi
# Migrate from old version setup
if [ -f "$ORG_DIR/system.prop" ]; then
hash_value=$(sed -n 's/^ro.boot.vbmeta.digest=//p' "$ORG_DIR/system.prop")
if [ -n "$hash_value" ]; then
echo -e "\n$hash_value" >> "$MODPATH/boot_hash"
fi
fi
kb="$COMPATH/.keybox"
@@ -93,15 +120,23 @@ ui_print " VOL [-]: NO"
ui_print "*********************************************"
key_check
if [[ "$keycheck" == "KEY_VOLUMEUP" ]]; then
ui_print "*********************************************"
ui_print "- Replacing keybox..."
ui_print "*********************************************"
if [ ! -f "/data/adb/modules/$MODNAME/common/origkeybox" ]; then
mv "$SCRIPT_DIR/keybox.xml" "$COMPATH/origkeybox"
fi
mv "$kb" "$SCRIPT_DIR/keybox.xml"
ui_print "*********************************************"
ui_print "- Replacing keybox..."
ui_print "*********************************************"
if [ -f "$ORG_DIR/common/origkeybox" ]; then
mv "$ORG_DIR/common/origkeybox" "$COMPATH/origkeybox"
else
mv "$TS/keybox.xml" "$COMPATH/origkeybox"
fi
mv "$kb" "$TS/keybox.xml"
else
rm -f "$kb"
if [ -f "$ORG_DIR/common/origkeybox" ]; then
mv "$ORG_DIR/common/origkeybox" "$COMPATH/origkeybox"
else
rm -f "$kb"
fi
fi
ui_print " "

View File

@@ -1,7 +1,7 @@
id=TA_utl
name=Tricky Addon: Update Target List
version=v1.3
versionCode=13
version=v1.4
versionCode=140
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
updateJson=https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/master/update.json

View File

@@ -1,20 +1,27 @@
MODDIR=${0%/*}
COMPATH="$MODDIR/common"
MODPATH=${0%/*}
TS="/data/adb/modules/tricky_store"
if [ ! -f "$COMPATH/ninstalled" ] || [ ! -f "$COMPATH/disabled" ] || [ ! -f "$COMPATH/normal" ]; then
sed -i 's/^description=.*/description=Module is corrupted, please reinstall module./' "$MODDIR/module.prop"
abort
hash_value=$(grep -v '^#' "$MODPATH/boot_hash" | tr -d '[:space:]')
if [ -n "$hash_value" ]; then
resetprop -n ro.boot.vbmeta.digest "$hash_value"
fi
if [ ! -f "$MODPATH/common/module.prop.orig" ]; then
sed -i 's/^description=.*/description=Module is corrupted, please reinstall module./' "$MODPATH/module.prop"
touch "$MODPATH/disable"
exit 1
fi
if [ ! -d "$TS" ]; then
cat "$COMPATH/ninstalled" > "$MODDIR/module.prop"
sed -i 's/^description=.*/description=Tricky store is not installed/' "$MODPATH/module.prop"
touch "$MODPATH/disable"
elif [ -f "$TS/disable" ]; then
cat "$COMPATH/disabled" > "$MODDIR/module.prop"
sed -i 's/^description=.*/description=Tricky store is disabled/' "$MODPATH/module.prop"
touch "$MODPATH/disable"
else
cat "$COMPATH/normal" > "$MODDIR/module.prop"
cat "$MODPATH/common/module.prop.orig" > "$MODPATH/module.prop"
until [ "$(getprop sys.boot_completed)" = "1" ]; do
sleep 1
done
. "$COMPATH/common/UpdateTargetList.sh"
. "$MODPATH/UpdateTargetList.sh"
fi

View File

@@ -1,9 +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"
TS="/data/adb/tricky_store"
# Remove residue and restore original keybox.
rm -rf "$TS/target_list_config"
rm -f "$TS/UpdateTargetList.sh"
if [ -f "$MODPATH/common/origkeybox" ]; then
rm -f "$MODDIR/keybox.xml"
mv "$MODPATH/common/origkeybox" "$MODDIR/keybox.xml"
rm -f "$TS/keybox.xml"
mv "$MODPATH/common/origkeybox" "$TS/keybox.xml"
fi

View File

@@ -1,6 +1,6 @@
{
"version": "v1.2",
"versionCode": 12,
"zipUrl": "https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/download/v1.2/TrickyAddonModule_UpdateTargetList-v1.2.zip",
"version": "v1.3.1",
"versionCode": 131,
"zipUrl": "https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/download/v1.3.1/TrickyAddonModule_UpdateTargetList-v1.3.1.zip",
"changelog": "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/refs/heads/master/changelog.md"
}