You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ecdbdd96a | ||
|
|
6d8f364d17 | ||
|
|
6994d1845e | ||
|
|
2b023ca1ba | ||
|
|
a2c062fb32 | ||
|
|
09c7cc27f1 | ||
|
|
d4b48998eb | ||
|
|
b410d12e9a | ||
|
|
20c402d425 | ||
|
|
f61009b34e | ||
|
|
39b6eb4b3d | ||
|
|
52e10335dc | ||
|
|
3fe5853a7d | ||
|
|
65def0bed2 | ||
|
|
a2fef2e1ed | ||
|
|
6cb72d87aa | ||
|
|
2948476589 | ||
|
|
842b2691a7 | ||
|
|
eb3ab39a80 | ||
|
|
1d105428e2 | ||
|
|
e11937b1c5 | ||
|
|
02c27b9692 | ||
|
|
b36c48b554 | ||
|
|
62f86ceb50 | ||
|
|
d6fbd0a812 | ||
|
|
6043b1de06 | ||
|
|
c7503a2643 | ||
|
|
6809b69c6d | ||
|
|
af8d3a1723 | ||
|
|
932648bc5b | ||
|
|
12670d26b0 | ||
|
|
e19ba37817 | ||
|
|
7a4fc9d9b5 | ||
|
|
630cdae303 | ||
|
|
5808080237 | ||
|
|
07ab5f92b5 | ||
|
|
9e64bde6a8 | ||
|
|
f2b1a0b79c | ||
|
|
ebe9fce938 | ||
|
|
c0a4dd4128 | ||
|
|
1ebe14c646 | ||
|
|
4a7437705c | ||
|
|
608f3364af | ||
|
|
6d56230a99 | ||
|
|
a07ce94b1b | ||
|
|
a2132bdc3a | ||
|
|
3dbc256230 | ||
|
|
cf5b4d458d | ||
|
|
dc85dfbe10 | ||
|
|
c89b112d98 | ||
|
|
5e790b98f7 | ||
|
|
bd3362646f | ||
|
|
35f481c626 |
29
README.md
29
README.md
@@ -1,23 +1,40 @@
|
|||||||
# **Tricky Addon: Update Target List**
|
# **Tricky Addon - Update Target List**
|
||||||
An addon module for tricky store
|
An addon module for tricky store
|
||||||
|
|
||||||
---
|
---
|
||||||
## Description
|
## Description
|
||||||
- Automated script to update tricky store target list.
|
- Automated script to update tricky store target list.
|
||||||
- Custom config: ADDITION and EXCLUDE in `/data/adb/tricky_store/target_list_config`
|
- System app excluded by default
|
||||||
|
- This is **not** a necessary module for root hide but for those who lazy to do it manually
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- Tricky store module installed
|
- [Tricky store](https://github.com/5ec1cff/TrickyStore) module installed
|
||||||
|
|
||||||
|
## Custom Configuration
|
||||||
|
- ADDITION and EXCLUDE in `/data/adb/tricky_store/target_list_config`
|
||||||
|
- EXCLUDE for removing unnecessary apps
|
||||||
|
- ADDITION for adding back system app excluded by default
|
||||||
|
- Configuration list with **KSU WebUI** (For KernelSU and Apatch, )
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
**Module will update taget list on every boot.**
|
### Automatic update
|
||||||
|
- On boot
|
||||||
|
|
||||||
|
### Manually update
|
||||||
**Action button method**
|
**Action button method**
|
||||||
- If action button feature is available, use action button can update tricky store target list.
|
- Use action button to update tricky store target list.
|
||||||
|
- Available for Magisk 27008+, KernelSU 11981+, Apatch 10927+
|
||||||
|
|
||||||
**Manual script method**
|
**Manual script method**
|
||||||
- If action button feature isn't avaliable, you can run `UpdateTargetList.sh` under `/data/adb/tricky_store` manually.
|
- Run `UpdateTargetList.sh` under `/data/adb/tricky_store` manually.
|
||||||
|
- MT manager is recommened for this method
|
||||||
|
|
||||||
|
## More
|
||||||
|
**Support to pass abnormal boot state**
|
||||||
|
- Put Verfied Boot Hash to `boot_hash` in `/data/adb/modules/TA_utl`, reboot.
|
||||||
|
|
||||||
|
## Acknowledgement
|
||||||
|
- [j-hc/zygisk-detach](https://github.com/j-hc/zygisk-detach) - KSU WebUI template
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
Download: [GitHub release](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases)
|
Download: [GitHub release](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases)
|
||||||
|
|||||||
31
changelog.md
31
changelog.md
@@ -3,11 +3,38 @@ Automated script to update tricky store target.txt
|
|||||||
|
|
||||||
Requirement: Tricky Store module installed
|
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: [Tricky Addon: Update Target List](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest)
|
||||||
|
|
||||||
|
Telegram channel: [KOW's Little World](https://t.me/kowchannel)
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
### v2.0
|
||||||
|
- Added WebUI for configuration
|
||||||
|
|
||||||
|
### v1.7
|
||||||
|
- Fixed update issue (Will start to work in next update)
|
||||||
|
|
||||||
|
### v1.6
|
||||||
|
- Updated something
|
||||||
|
|
||||||
|
### v1.5
|
||||||
|
- Fixed some known issue
|
||||||
|
- Updated something
|
||||||
|
|
||||||
|
### v1.4.1
|
||||||
|
- Fixed Magisk installation issue
|
||||||
|
|
||||||
|
### v1.4
|
||||||
|
- Migrate ro.boot.vbmeta.digest from system.prop to resetprop
|
||||||
|
- Fix config list recognize error on some device
|
||||||
|
- Refactor code
|
||||||
|
|
||||||
|
### v1.3.1
|
||||||
|
- Added Apatch Next package name to exclude list
|
||||||
|
- Fix automatic update target script not working issue
|
||||||
|
|
||||||
### v1.3
|
### v1.3
|
||||||
- Minor improvement in code
|
- Minor improvement in code
|
||||||
- Overwrite protection: won't remove previous setup when updating module
|
- Overwrite protection: won't remove previous setup when updating module
|
||||||
|
|||||||
@@ -1,8 +1,26 @@
|
|||||||
## Tricky Addon Lite: Update Target List Script
|
## Tricky Addon Lite: Update Target List Script
|
||||||
- Script only, **NOT Module**
|
- Script only, **NOT Module**
|
||||||
- Run with root priviledge
|
- Run with root priviledge
|
||||||
|
- Recommend to run with MT manager
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
### v2.0
|
||||||
|
- More clarify remark in code
|
||||||
|
- Remove useless code
|
||||||
|
|
||||||
|
### v1.6, v1.7
|
||||||
|
- Remain same with v1.5
|
||||||
|
|
||||||
|
### v1.5
|
||||||
|
- Reduced size
|
||||||
|
- Removed useless code
|
||||||
|
|
||||||
|
### v1.4, v1.4.1
|
||||||
|
- Remain same with v1.3.1
|
||||||
|
|
||||||
|
### v1.3.1
|
||||||
|
- Added Apatch Next package name to exclude list
|
||||||
|
|
||||||
### v1.3
|
### v1.3
|
||||||
- More user friendly exclude and addition list config
|
- More user friendly exclude and addition list config
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# by KOW
|
# Tricky Addon Lite: Update Target List Script v2.0
|
||||||
# Tricky Addon Lite: Update Target List Script v1.3
|
|
||||||
# GitHub Repository: https://github.com/KOWX712/Tricky-Addon-Update-Target-List/blob/master/lite-script_only/README.md
|
# GitHub Repository: https://github.com/KOWX712/Tricky-Addon-Update-Target-List/blob/master/lite-script_only/README.md
|
||||||
# Telegram channel: https://t.me/kowchannel
|
# Telegram channel: https://t.me/kowchannel
|
||||||
|
|
||||||
# This script will put all non-system app into /data/adb/tricky_store/target.txt
|
# This script will put all non-system app into /data/adb/tricky_store/target.txt
|
||||||
|
|
||||||
|
###################################################
|
||||||
# Configurable exclude and addition list
|
# Configurable exclude and addition list
|
||||||
# DO NOT remove default package names here
|
# DO NOT remove default package names here
|
||||||
|
###################################################
|
||||||
|
|
||||||
EXCLUDE="
|
EXCLUDE="
|
||||||
oneplus
|
oneplus
|
||||||
coloros
|
coloros
|
||||||
com.android.patch
|
com.android.patch
|
||||||
me.bmax.apatch"
|
me.bmax.apatch
|
||||||
|
me.garfieldhan.apatch.next"
|
||||||
|
|
||||||
ADDITION="
|
ADDITION="
|
||||||
com.google.android.gms
|
com.google.android.gms
|
||||||
@@ -21,15 +24,14 @@ io.github.vvb2060.keyattestation
|
|||||||
io.github.vvb2060.mahoshojo
|
io.github.vvb2060.mahoshojo
|
||||||
icu.nullptr.nativetest"
|
icu.nullptr.nativetest"
|
||||||
|
|
||||||
echo " "
|
###################################################
|
||||||
echo " Staring script..."
|
# Script
|
||||||
echo " "
|
###################################################
|
||||||
|
|
||||||
# Create or overwrite the target.txt file
|
|
||||||
> /data/adb/tricky_store/target.txt
|
|
||||||
|
|
||||||
echo " Adding apps to target.txt..."
|
|
||||||
echo " "
|
echo " "
|
||||||
|
echo "- Staring script..."
|
||||||
|
echo " "
|
||||||
|
echo "- Adding apps to target.txt..."
|
||||||
|
|
||||||
EXCLUDE=$(echo "$EXCLUDE" | tr '\n' '|' | sed 's/^|//;s/|$//')
|
EXCLUDE=$(echo "$EXCLUDE" | tr '\n' '|' | sed 's/^|//;s/|$//')
|
||||||
ADDITION=$(echo "$ADDITION" | tr '\n' ' ' | sed 's/^ //;s/ $//')
|
ADDITION=$(echo "$ADDITION" | tr '\n' ' ' | sed 's/^ //;s/ $//')
|
||||||
@@ -45,8 +47,5 @@ for app in $ADDITION; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Force stop gms. Not necessary, you can add it if you want
|
echo " "
|
||||||
#su -c killall com.google.android.gms
|
echo "- All done!"
|
||||||
#su -c killall com.google.android.gms.unstable
|
|
||||||
|
|
||||||
echo " All done!"
|
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
#!/sbin/sh
|
#!/sbin/sh
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# Initialization
|
# Initialization
|
||||||
#################
|
#################
|
||||||
|
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
# echo before loading util_functions
|
# echo before loading util_functions
|
||||||
ui_print() { echo "$1"; }
|
ui_print() { echo "$1"; }
|
||||||
|
|
||||||
require_new_magisk() {
|
require_new_magisk() {
|
||||||
ui_print "*******************************"
|
ui_print "*******************************"
|
||||||
ui_print " Please install Magisk v20.4+! "
|
ui_print " Please install Magisk v20.4+! "
|
||||||
ui_print "*******************************"
|
ui_print "*******************************"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Load util_functions.sh
|
# Load util_functions.sh
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
OUTFD=$2
|
OUTFD=$2
|
||||||
ZIPFILE=$3
|
ZIPFILE=$3
|
||||||
|
|
||||||
mount /data 2>/dev/null
|
mount /data 2>/dev/null
|
||||||
|
|
||||||
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
|
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
|
||||||
. /data/adb/magisk/util_functions.sh
|
. /data/adb/magisk/util_functions.sh
|
||||||
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
|
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
|
||||||
|
|
||||||
install_module
|
install_module
|
||||||
exit 0
|
exit 0
|
||||||
@@ -1 +1 @@
|
|||||||
#MAGISK
|
#MAGISK
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
MODDIR=${0%/*}
|
SCRIPT_DIR="/data/adb/tricky_store"
|
||||||
|
|
||||||
echo "**********************************************"
|
echo "**********************************************"
|
||||||
echo "- Staring script..."
|
echo "- Staring script..."
|
||||||
echo " "
|
echo " "
|
||||||
|
|
||||||
sh "$MODDIR"/common/UpdateTargetList.sh
|
if [ ! -f "$SCRIPT_DIR/UpdateTargetList.sh" ]; then
|
||||||
|
echo "! Script missing, please install module again"
|
||||||
|
echo "**********************************************"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
. "$SCRIPT_DIR/UpdateTargetList.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "**********************************************"
|
echo "**********************************************"
|
||||||
echo "\(__All set!__)/"
|
echo "\(__All set!__)/"
|
||||||
echo "Exiting in 3 seconds..."
|
echo "Exiting in 2 seconds..."
|
||||||
sleep 3
|
sleep 2
|
||||||
@@ -2,8 +2,7 @@
|
|||||||
# DO NOT remove the default app here
|
# DO NOT remove the default app here
|
||||||
# You can add your custom addition app's package name here
|
# You can add your custom addition app's package name here
|
||||||
# Each app package name should be on a new line
|
# Each app package name should be on a new line
|
||||||
|
|
||||||
com.google.android.gms
|
com.google.android.gms
|
||||||
io.github.vvb2060.keyattestation
|
io.github.vvb2060.keyattestation
|
||||||
io.github.vvb2060.mahoshojo
|
io.github.vvb2060.mahoshojo
|
||||||
icu.nullptr.nativetest
|
icu.nullptr.nativetest
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
# DO NOT remove the default app here
|
# DO NOT remove the default app here
|
||||||
# You can add your custom exclusion app here
|
# You can add your custom exclusion app here
|
||||||
# Each app package name should be on a new line
|
# Each app package name should be on a new line
|
||||||
|
|
||||||
oneplus
|
oneplus
|
||||||
coloros
|
coloros
|
||||||
com.android.patch
|
com.android.patch
|
||||||
me.bmax.apatch
|
me.bmax.apatch
|
||||||
|
me.garfieldhan.apatch.next
|
||||||
|
|||||||
@@ -1,56 +1,40 @@
|
|||||||
#!/bin/sh
|
#!/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
|
# 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.
|
CONFIG_DIR="/data/adb/tricky_store/target_list_config"
|
||||||
MODDIR="/data/adb/tricky_store/target_list_config"
|
|
||||||
|
|
||||||
# Config file check
|
|
||||||
echo "- Checking config files..."
|
echo "- Checking config files..."
|
||||||
echo " "
|
echo " "
|
||||||
if [ ! -f "$MODDIR/EXCLUDE" ]; then
|
if [ ! -f "$CONFIG_DIR/EXCLUDE" ]; then
|
||||||
echo "! Exclude list is missing, please reinstall module"
|
echo "! Exclude list is missing, please install module again"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "- Exclude config file found."
|
echo "- Exclude config file found"
|
||||||
echo " "
|
echo " "
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$MODDIR/ADDITION" ]; then
|
if [ ! -f "$CONFIG_DIR/ADDITION" ]; then
|
||||||
echo "! Addition list is missing, please reinstall module"
|
echo "! Addition list is missing, please install module again"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "- Addition config file found."
|
echo "- Addition config file found"
|
||||||
echo " "
|
echo " "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Read exclution and addition config
|
EXCLUDE=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$CONFIG_DIR/EXCLUDE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | tr '\n' '|' | sed 's/|$//')
|
||||||
EXCLUDE=$(grep -vE '^#|^$' "$MODDIR/EXCLUDE" | tr '\n' '|' | sed 's/|$//')
|
ADDITION=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$CONFIG_DIR/ADDITION")
|
||||||
ADDITION=$(grep -vE '^#|^$' "$MODDIR/ADDITION")
|
|
||||||
|
|
||||||
# Create or overwrite the target.txt file
|
echo "- Adding apps into /data/adb/tricky_store/target.txt..."
|
||||||
echo "- Overwritting target.txt"
|
|
||||||
echo " "
|
|
||||||
> /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 " "
|
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
|
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 "- Adding addition app... "
|
||||||
echo " "
|
echo " "
|
||||||
for app in $ADDITION; do
|
for app in $ADDITION; do
|
||||||
if ! grep -qx "$app" /data/adb/tricky_store/target.txt; then
|
app=$(echo "$app" | tr -d '[:space:]')
|
||||||
|
if ! grep -Fq "$app" /data/adb/tricky_store/target.txt; then
|
||||||
echo "$app" >> /data/adb/tricky_store/target.txt
|
echo "$app" >> /data/adb/tricky_store/target.txt
|
||||||
fi
|
fi
|
||||||
done
|
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 "- target.txt updated successfully"
|
||||||
echo " "
|
echo " "
|
||||||
6
module/common/boot_hash
Normal file
6
module/common/boot_hash
Normal 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
|
||||||
@@ -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=
|
|
||||||
@@ -1,91 +1,123 @@
|
|||||||
SKIPUNZIP=0
|
SKIPUNZIP=0
|
||||||
DEBUG=false
|
DEBUG=false
|
||||||
if [ "$(which magisk)" ]; then
|
|
||||||
BM="Magisk:$MAGISK_VER│$MAGISK_VER_CODE"
|
ui_print " ";
|
||||||
|
if [ "$APATCH" ]; then
|
||||||
|
ui_print "- APatch:$APATCH_VER│$APATCH_VER_CODE"
|
||||||
elif [ "$KSU" ]; then
|
elif [ "$KSU" ]; then
|
||||||
BM="KSU:$KSU_KERNEL_VER_CODE│$KSU_VER_CODE"
|
ui_print "- KSU:$KSU_KERNEL_VER_CODE│$KSU_VER_CODE"
|
||||||
elif [ "$APATCH" ]; then
|
elif [ "$MAGISK_VER_CODE" ]; then
|
||||||
BM="APatch:$APATCH_VER│$APATCH_VER_CODE"
|
ui_print "- Magisk:$MAGISK_VER│$MAGISK_VER_CODE"
|
||||||
else
|
else
|
||||||
ui_print " ";
|
ui_print " ";
|
||||||
ui_print "! recovery is not supported";
|
ui_print "! recovery is not supported";
|
||||||
abort " ";
|
abort " ";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
print_modname() {
|
COMPATH="$MODPATH/common"
|
||||||
ui_print "*******************************************************"
|
TS="/data/adb/modules/tricky_store"
|
||||||
ui_print "Installing Tricky Addon: Update Target List"
|
SCRIPT_DIR="/data/adb/tricky_store"
|
||||||
ui_print "Author: KOWX712"
|
CONFIG_DIR="$SCRIPT_DIR/target_list_config"
|
||||||
ui_print "*******************************************************"
|
MODNAME=$(grep '^id=' "$MODPATH/module.prop" | awk -F= '{print $2}' | xargs)
|
||||||
}
|
ORG_DIR="/data/adb/modules/$MODNAME"
|
||||||
|
kb="$COMPATH/.default"
|
||||||
|
|
||||||
if [ -d /data/adb/modules/tricky_store ]; then
|
if [ -d "$TS" ]; then
|
||||||
echo "- Tricky store module installed"
|
ui_print "- Tricky store module installed"
|
||||||
else
|
else
|
||||||
echo "! Tricky store module is not installed"
|
ui_print "! Tricky store module is not installed"
|
||||||
abort " "
|
abort " "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
key_check() {
|
key_check() {
|
||||||
while true; do
|
while true; do
|
||||||
key_check=$(/system/bin/getevent -qlc 1)
|
key_check=$(/system/bin/getevent -qlc 1)
|
||||||
key_event=$(echo "$key_check" | awk '{ print $3 }' | grep 'KEY_')
|
key_event=$(echo "$key_check" | awk '{ print $3 }' | grep 'KEY_')
|
||||||
key_status=$(echo "$key_check" | awk '{ print $4 }')
|
key_status=$(echo "$key_check" | awk '{ print $4 }')
|
||||||
if [[ "$key_event" == *"KEY_"* && "$key_status" == "DOWN" ]]; then
|
if [[ "$key_event" == *"KEY_"* && "$key_status" == "DOWN" ]]; then
|
||||||
keycheck="$key_event"
|
keycheck="$key_event"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
while true; do
|
while true; do
|
||||||
key_check=$(/system/bin/getevent -qlc 1)
|
key_check=$(/system/bin/getevent -qlc 1)
|
||||||
key_event=$(echo "$key_check" | awk '{ print $3 }' | grep 'KEY_')
|
key_event=$(echo "$key_check" | awk '{ print $3 }' | grep 'KEY_')
|
||||||
key_status=$(echo "$key_check" | awk '{ print $4 }')
|
key_status=$(echo "$key_check" | awk '{ print $4 }')
|
||||||
if [[ "$key_event" == *"KEY_"* && "$key_status" == "UP" ]]; then
|
if [[ "$key_event" == *"KEY_"* && "$key_status" == "UP" ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
add_exclude() {
|
||||||
|
EXCLUDE=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$CONFIG_DIR/EXCLUDE")
|
||||||
|
for app in $EXCLUDE; do
|
||||||
|
app=$(echo "$app" | tr -d '[:space:]')
|
||||||
|
if ! grep -Fq "$app" $COMPATH/EXCLUDE; then
|
||||||
|
echo "$app" >> $COMPATH/EXCLUDE
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
|
||||||
|
}
|
||||||
|
|
||||||
|
add_addition() {
|
||||||
|
ADDITION=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$CONFIG_DIR/ADDITION")
|
||||||
|
for app in $ADDITION; do
|
||||||
|
app=$(echo "$app" | tr -d '[:space:]')
|
||||||
|
if ! grep -Fq "$app" $COMPATH/ADDITION; then
|
||||||
|
echo "$app" >> $COMPATH/ADDITION
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_print "- Installing..."
|
ui_print "- Installing..."
|
||||||
COMPATH="$MODPATH/common"
|
|
||||||
CONFIG_DIR="/data/adb/tricky_store/target_list_config"
|
if [ -f "$SCRIPT_DIR/UpdateTargetList.sh" ]; then
|
||||||
SCRIPT_DIR="/data/adb/tricky_store"
|
rm -f "$SCRIPT_DIR/UpdateTargetList.sh"
|
||||||
MODNAME=$(grep '^id=' "$MODPATH/module.prop" | awk -F= '{print $2}' | xargs)
|
fi
|
||||||
for status in normal ninstalled disabled; do
|
cp "$MODPATH/module.prop" "$COMPATH/module.prop.orig"
|
||||||
cp "$MODPATH/module.prop" "$COMPATH/$status"
|
mv "$COMPATH/UpdateTargetList.sh" "$SCRIPT_DIR/UpdateTargetList.sh"
|
||||||
done
|
|
||||||
sed -i 's/^description=.*/description=Tricky store is not installed/' "$COMPATH/ninstalled"
|
set_perm $SCRIPT_DIR/UpdateTargetList.sh 0 2000 0755
|
||||||
sed -i 's/^description=.*/description=Tricky store is disabled/' "$COMPATH/disabled"
|
|
||||||
rm -f "$SCRIPT_DIR/UpdateTargetList.sh"
|
if [ -d "$CONFIG_DIR" ]; then
|
||||||
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
|
|
||||||
if [ ! -f "$CONFIG_DIR/EXCLUDE" ] && [ ! -f "$CONFIG_DIR/ADDITION" ]; then
|
if [ ! -f "$CONFIG_DIR/EXCLUDE" ] && [ ! -f "$CONFIG_DIR/ADDITION" ]; then
|
||||||
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
|
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
|
||||||
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
|
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
|
||||||
elif [ ! -f "$CONFIG_DIR/ADDITION" ]; then
|
elif [ ! -f "$CONFIG_DIR/ADDITION" ]; then
|
||||||
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
|
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
|
||||||
rm -f "$COMPATH/EXCLUDE"
|
add_exclude
|
||||||
elif [ ! -f "$CONFIG_DIR/EXCLUDE" ]; then
|
elif [ ! -f "$CONFIG_DIR/EXCLUDE" ]; then
|
||||||
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
|
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
|
||||||
rm -f "$COMPATH/ADDITION"
|
add_addition
|
||||||
else
|
else
|
||||||
rm -f "$COMPATH/EXCLUDE"
|
add_exclude
|
||||||
rm -f "$COMPATH/ADDITION"
|
add_addition
|
||||||
|
fi
|
||||||
|
ui_print "- Migrating old config data"
|
||||||
|
else
|
||||||
|
ui_print "- Creating config folder $CONFIG_DIR"
|
||||||
|
mkdir -p "$CONFIG_DIR"
|
||||||
|
mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE"
|
||||||
|
mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$ORG_DIR/boot_hash" ]; then
|
||||||
|
mv "$COMPATH/boot_hash" "$MODPATH/boot_hash"
|
||||||
|
else
|
||||||
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/data/adb/modules/$MODNAME/system.prop" ]; then
|
|
||||||
mv "$COMPATH/system.prop" "$MODPATH/system.prop"
|
|
||||||
else
|
|
||||||
rm -f "$COMPATH/system.prop"
|
|
||||||
mv "/data/adb/modules/$MODNAME/system.prop" "$MODPATH/system.prop"
|
|
||||||
fi
|
|
||||||
|
|
||||||
kb="$COMPATH/.keybox"
|
|
||||||
ui_print "*********************************************"
|
ui_print "*********************************************"
|
||||||
ui_print "- Do you want to replace tricky store keybox?"
|
ui_print "- Do you want to replace tricky store keybox?"
|
||||||
ui_print " VOL [+]: YES"
|
ui_print " VOL [+]: YES"
|
||||||
@@ -93,17 +125,23 @@ ui_print " VOL [-]: NO"
|
|||||||
ui_print "*********************************************"
|
ui_print "*********************************************"
|
||||||
key_check
|
key_check
|
||||||
if [[ "$keycheck" == "KEY_VOLUMEUP" ]]; then
|
if [[ "$keycheck" == "KEY_VOLUMEUP" ]]; then
|
||||||
ui_print "*********************************************"
|
ui_print "*********************************************"
|
||||||
ui_print "- Replacing keybox..."
|
ui_print "- Backing up original keybox..."
|
||||||
ui_print "*********************************************"
|
ui_print "- Replacing keybox..."
|
||||||
if [ ! -f "/data/adb/modules/$MODNAME/common/origkeybox" ]; then
|
ui_print "*********************************************"
|
||||||
mv "$SCRIPT_DIR/keybox.xml" "$COMPATH/origkeybox"
|
if [ -f "$ORG_DIR/common/origkeybox" ]; then
|
||||||
fi
|
mv "$ORG_DIR/common/origkeybox" "$COMPATH/origkeybox"
|
||||||
mv "$kb" "$SCRIPT_DIR/keybox.xml"
|
else
|
||||||
|
mv "$SCRIPT_DIR/keybox.xml" "$COMPATH/origkeybox"
|
||||||
|
fi
|
||||||
|
mv "$kb" "$SCRIPT_DIR/keybox.xml"
|
||||||
else
|
else
|
||||||
rm -f "$kb"
|
if [ -f "$ORG_DIR/common/origkeybox" ]; then
|
||||||
|
mv "$ORG_DIR/common/origkeybox" "$COMPATH/origkeybox"
|
||||||
|
else
|
||||||
|
rm -f "$kb"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ui_print " "
|
|
||||||
ui_print "- Installation completed successfully! "
|
ui_print "- Installation completed successfully! "
|
||||||
ui_print " "
|
ui_print " "
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
id=TA_utl
|
id=TA_utl
|
||||||
name=Tricky Addon: Update Target List
|
name=Tricky Addon - Update Target List
|
||||||
version=v1.3
|
version=v2.0
|
||||||
versionCode=13
|
versionCode=200
|
||||||
author=KOWX712
|
author=KOWX712
|
||||||
description=Update tricky store target list with action button. Custom config: ADDITION and EXCLUDE in /data/adb/tricky_store/target_list_config
|
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
|
||||||
|
|||||||
@@ -1,20 +1,31 @@
|
|||||||
MODDIR=${0%/*}
|
MODPATH=${0%/*}
|
||||||
COMPATH="$MODDIR/common"
|
|
||||||
TS="/data/adb/modules/tricky_store"
|
TS="/data/adb/modules/tricky_store"
|
||||||
|
SCRIPT_DIR="/data/adb/tricky_store"
|
||||||
|
|
||||||
if [ ! -f "$COMPATH/ninstalled" ] || [ ! -f "$COMPATH/disabled" ] || [ ! -f "$COMPATH/normal" ]; then
|
hash_value=$(grep -v '^#' "$MODPATH/boot_hash" | tr -d '[:space:]')
|
||||||
sed -i 's/^description=.*/description=Module is corrupted, please reinstall module./' "$MODDIR/module.prop"
|
if [ -n "$hash_value" ]; then
|
||||||
abort
|
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
|
fi
|
||||||
|
|
||||||
if [ ! -d "$TS" ]; then
|
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
|
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"
|
||||||
|
elif [ ! -f "$SCRIPT_DIR/UpdateTargetList.sh" ]; then
|
||||||
|
sed -i 's/^description=.*/description=Script missing, please install module again/' "$MODPATH/module.prop"
|
||||||
|
touch "$MODPATH/disable"
|
||||||
else
|
else
|
||||||
cat "$COMPATH/normal" > "$MODDIR/module.prop"
|
cat "$MODPATH/common/module.prop.orig" > "$MODPATH/module.prop"
|
||||||
until [ "$(getprop sys.boot_completed)" = "1" ]; do
|
until [ "$(getprop sys.boot_completed)" = "1" ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
. "$COMPATH/common/UpdateTargetList.sh"
|
. "$SCRIPT_DIR/UpdateTargetList.sh"
|
||||||
fi
|
fi
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
MODDIR="/data/adb/tricky_store"
|
|
||||||
# Remove residue and restore original keybox.
|
|
||||||
MODPATH=${0%/*}
|
MODPATH=${0%/*}
|
||||||
rm -rf "$MODDIR/target_list_config"
|
SCRIPT_DIR="/data/adb/tricky_store"
|
||||||
rm -f "$MODDIR/UpdateTargetList.sh"
|
|
||||||
|
# Remove residue and restore original keybox.
|
||||||
|
rm -rf "$SCRIPT_DIR/target_list_config"
|
||||||
|
rm -f "$SCRIPT_DIR/UpdateTargetList.sh"
|
||||||
if [ -f "$MODPATH/common/origkeybox" ]; then
|
if [ -f "$MODPATH/common/origkeybox" ]; then
|
||||||
rm -f "$MODDIR/keybox.xml"
|
rm -f "$SCRIPT_DIR/keybox.xml"
|
||||||
mv "$MODPATH/common/origkeybox" "$MODDIR/keybox.xml"
|
mv "$MODPATH/common/origkeybox" "$SCRIPT_DIR/keybox.xml"
|
||||||
fi
|
fi
|
||||||
44
module/webroot/index.html
Normal file
44
module/webroot/index.html
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<link rel="stylesheet" href="/styles.css" type="text/css">
|
||||||
|
<script type="module" crossorigin src="/index.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="title">Tricky Addon - Update Target List</div>
|
||||||
|
<div class="search-card">
|
||||||
|
<input type="text" class="search-input" id="search" placeholder="Search">
|
||||||
|
</div>
|
||||||
|
<div class="menu">
|
||||||
|
<input type="checkbox" id="menu-toggle" class="menu-toggle" style="display: none;">
|
||||||
|
<label for="menu-toggle" id="menu-button">☰</label>
|
||||||
|
<div id="menu-options" class="menu-options">
|
||||||
|
<ul>
|
||||||
|
<li id="refresh">Refresh</li>
|
||||||
|
<li id="select-all">Select All</li>
|
||||||
|
<li id="deselect-all">Deselect All</li>
|
||||||
|
<li id="update">Update Target List</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="apps-list"></div>
|
||||||
|
<div class="floating-card">
|
||||||
|
<button class="floating-btn" id="save">Save Config</button>
|
||||||
|
</div>
|
||||||
|
<template id="app-template">
|
||||||
|
<div class="card" onclick="toggleCheckbox(event)">
|
||||||
|
<div class="content">
|
||||||
|
<p class="name"></p>
|
||||||
|
<input type="checkbox" class="checkbox" checked>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="acknowledgment">
|
||||||
|
Credit to j-hc/zygisk-detach WebUI
|
||||||
|
</div>
|
||||||
|
<div id="prompt" class="prompt"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
242
module/webroot/index.js
Normal file
242
module/webroot/index.js
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
let e = 0;
|
||||||
|
const appTemplate = document.getElementById("app-template").content;
|
||||||
|
const appListContainer = document.getElementById("apps-list");
|
||||||
|
let excludeList = [];
|
||||||
|
|
||||||
|
// Function to execute shell commands
|
||||||
|
async function execCommand(command) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const callbackName = `exec_callback_${Date.now()}_${e++}`;
|
||||||
|
window[callbackName] = (errno, stdout, stderr) => {
|
||||||
|
delete window[callbackName];
|
||||||
|
if (errno === 0) {
|
||||||
|
resolve(stdout);
|
||||||
|
} else {
|
||||||
|
console.error(`Error executing command: ${stderr}`);
|
||||||
|
reject(stderr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
ksu.exec(command, "{}", callbackName);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Execution error: ${error}`);
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to read the EXCLUDE file and return its contents as an array
|
||||||
|
async function readExcludeFile() {
|
||||||
|
try {
|
||||||
|
const result = await execCommand('cat /data/adb/tricky_store/target_list_config/EXCLUDE');
|
||||||
|
excludeList = result.split("\n").filter(app => app.trim() !== ''); // Filter out empty lines
|
||||||
|
console.log("Current EXCLUDE list:", excludeList);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to read EXCLUDE file:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to fetch the app list using the package manager
|
||||||
|
async function fetchAppList() {
|
||||||
|
try {
|
||||||
|
const result = await execCommand("pm list packages -3 </dev/null 2>&1 | cat");
|
||||||
|
return result.split("\n").map(line => line.replace("package:", "").trim()).filter(Boolean);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to fetch app list:", error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to render apps
|
||||||
|
async function renderAppList() {
|
||||||
|
await readExcludeFile();
|
||||||
|
const apps = await fetchAppList();
|
||||||
|
const sortedApps = apps.sort((a, b) => {
|
||||||
|
const aInExclude = excludeList.includes(a);
|
||||||
|
const bInExclude = excludeList.includes(b);
|
||||||
|
return aInExclude === bInExclude ? a.localeCompare(b) : aInExclude ? 1 : -1;
|
||||||
|
});
|
||||||
|
appListContainer.innerHTML = "";
|
||||||
|
sortedApps.forEach(appName => {
|
||||||
|
const appElement = document.importNode(appTemplate, true);
|
||||||
|
appElement.querySelector(".name").textContent = appName;
|
||||||
|
const checkbox = appElement.querySelector(".checkbox");
|
||||||
|
checkbox.checked = !excludeList.includes(appName);
|
||||||
|
appListContainer.appendChild(appElement);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to refresh the app list and clear the search input
|
||||||
|
async function refreshAppList() {
|
||||||
|
const searchInput = document.getElementById("search");
|
||||||
|
searchInput.value = '';
|
||||||
|
const apps = appListContainer.querySelectorAll(".card");
|
||||||
|
apps.forEach(app => app.style.display = "block");
|
||||||
|
await renderAppList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to select all apps
|
||||||
|
function selectAllApps() {
|
||||||
|
document.querySelectorAll(".checkbox").forEach(checkbox => checkbox.checked = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to deselect all apps
|
||||||
|
function deselectAllApps() {
|
||||||
|
document.querySelectorAll(".checkbox").forEach(checkbox => checkbox.checked = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
let promptTimeout; // Variable to store the current timeout
|
||||||
|
|
||||||
|
// Function to show the prompt with a success or error message
|
||||||
|
function showPrompt(message, isSuccess = true) {
|
||||||
|
const prompt = document.getElementById('prompt');
|
||||||
|
prompt.textContent = message;
|
||||||
|
prompt.classList.toggle('error', !isSuccess); // Apply error class if not success
|
||||||
|
prompt.style.display = 'block';
|
||||||
|
|
||||||
|
if (promptTimeout) {
|
||||||
|
clearTimeout(promptTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
promptTimeout = setTimeout(() => {
|
||||||
|
prompt.style.display = 'none';
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to update the target list by executing a script
|
||||||
|
async function updateTargetList() {
|
||||||
|
try {
|
||||||
|
await execCommand("/data/adb/tricky_store/UpdateTargetList.sh");
|
||||||
|
showPrompt("Successfully updated target.txt");
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to update target list:", error);
|
||||||
|
showPrompt("Failed to update target.txt !", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Menu toggle functionality
|
||||||
|
function setupMenuToggle() {
|
||||||
|
const menuButton = document.getElementById('menu-button');
|
||||||
|
const menuOptions = document.getElementById('menu-options');
|
||||||
|
|
||||||
|
menuButton.addEventListener('click', (event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
if (menuOptions.classList.contains('visible')) {
|
||||||
|
closeMenu();
|
||||||
|
} else {
|
||||||
|
menuOptions.style.display = 'block';
|
||||||
|
setTimeout(() => {
|
||||||
|
menuOptions.classList.remove('hidden');
|
||||||
|
menuOptions.classList.add('visible');
|
||||||
|
menuButton.classList.add('menu-open');
|
||||||
|
menuButton.classList.remove('menu-closed');
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('click', (event) => {
|
||||||
|
if (!menuOptions.contains(event.target) && event.target !== menuButton) {
|
||||||
|
closeMenu();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const closeMenuItems = ['refresh', 'select-all', 'deselect-all', 'update'];
|
||||||
|
closeMenuItems.forEach(id => {
|
||||||
|
const item = document.getElementById(id);
|
||||||
|
if (item) {
|
||||||
|
item.addEventListener('click', (event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
closeMenu();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function closeMenu() {
|
||||||
|
if (menuOptions.classList.contains('visible')) {
|
||||||
|
menuOptions.classList.remove('visible');
|
||||||
|
menuOptions.classList.add('hidden');
|
||||||
|
menuButton.classList.remove('menu-open');
|
||||||
|
menuButton.classList.add('menu-closed');
|
||||||
|
setTimeout(() => {
|
||||||
|
menuOptions.style.display = 'none';
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search functionality
|
||||||
|
document.getElementById("search").addEventListener("input", (e) => {
|
||||||
|
const searchQuery = e.target.value.toLowerCase();
|
||||||
|
const apps = appListContainer.querySelectorAll(".card");
|
||||||
|
apps.forEach(app => {
|
||||||
|
const name = app.querySelector(".name").textContent.toLowerCase();
|
||||||
|
app.style.display = name.includes(searchQuery) ? "block" : "none";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add button click event to update EXCLUDE file
|
||||||
|
document.getElementById("save").addEventListener("click", async () => {
|
||||||
|
await readExcludeFile();
|
||||||
|
const deselectedApps = Array.from(appListContainer.querySelectorAll(".checkbox:not(:checked)"))
|
||||||
|
.map(checkbox => checkbox.closest(".card").querySelector(".name").textContent);
|
||||||
|
const selectedApps = Array.from(appListContainer.querySelectorAll(".checkbox:checked"))
|
||||||
|
.map(checkbox => checkbox.closest(".card").querySelector(".name").textContent);
|
||||||
|
|
||||||
|
for (const app of deselectedApps) {
|
||||||
|
if (!excludeList.includes(app)) {
|
||||||
|
excludeList.push(app);
|
||||||
|
console.log("Added to EXCLUDE list:", app);
|
||||||
|
} else {
|
||||||
|
console.log("App already in EXCLUDE file, skipping:", app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedApps.length > 0) {
|
||||||
|
selectedApps.forEach(app => {
|
||||||
|
excludeList = excludeList.filter(excludedApp => excludedApp !== app);
|
||||||
|
console.log("Removed from EXCLUDE list:", app);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const updatedExcludeContent = excludeList.join("\n");
|
||||||
|
await execCommand(`echo "${updatedExcludeContent}" > /data/adb/tricky_store/target_list_config/EXCLUDE`);
|
||||||
|
console.log("EXCLUDE file updated successfully.");
|
||||||
|
showPrompt("Config saved successfully");
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to update EXCLUDE file:", error);
|
||||||
|
showPrompt("Failed to save config", false);
|
||||||
|
}
|
||||||
|
await readExcludeFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Event listener for the "Update Target List" menu option
|
||||||
|
document.getElementById('update').addEventListener('click', updateTargetList);
|
||||||
|
|
||||||
|
// Initial load
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
setupMenuToggle();
|
||||||
|
document.getElementById("refresh").addEventListener("click", refreshAppList);
|
||||||
|
document.getElementById("select-all").addEventListener("click", selectAllApps);
|
||||||
|
document.getElementById("deselect-all").addEventListener("click", deselectAllApps);
|
||||||
|
renderAppList();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Scroll event
|
||||||
|
let lastScrollY = window.scrollY;
|
||||||
|
const title = document.getElementById('title');
|
||||||
|
const searchCard = document.querySelector('.search-card');
|
||||||
|
const menu = document.querySelector('.menu');
|
||||||
|
|
||||||
|
window.addEventListener('scroll', () => {
|
||||||
|
if (window.scrollY > lastScrollY) {
|
||||||
|
title.style.transform = 'translateY(-100%)';
|
||||||
|
searchCard.style.transform = 'translateY(-40px)';
|
||||||
|
menu.style.transform = 'translateY(-40px)';
|
||||||
|
} else {
|
||||||
|
title.style.transform = 'translateY(0)';
|
||||||
|
searchCard.style.transform = 'translateY(0)';
|
||||||
|
menu.style.transform = 'translateY(0)';
|
||||||
|
}
|
||||||
|
lastScrollY = window.scrollY;
|
||||||
|
});
|
||||||
218
module/webroot/styles.css
Normal file
218
module/webroot/styles.css
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
body {
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title {
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
border: none;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
left: 0;
|
||||||
|
padding: 7px 25px;
|
||||||
|
position: fixed;
|
||||||
|
text-align: left;
|
||||||
|
top: 0;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apps-list {
|
||||||
|
margin-top: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-card {
|
||||||
|
background-color: white;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 25px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
position: fixed;
|
||||||
|
top: 40px;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
width: calc(100% - 100px);
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
background-color: #fff;
|
||||||
|
border: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 14px;
|
||||||
|
outline: none;
|
||||||
|
padding: 5px 15px;
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
top: 40px;
|
||||||
|
right: 10px;
|
||||||
|
z-index: 1000;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-toggle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-button {
|
||||||
|
background-color: white;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 25px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
|
padding: 13px 17px;
|
||||||
|
text-align: center;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-options {
|
||||||
|
background-color: white;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 110%;
|
||||||
|
right: 0;
|
||||||
|
transform: translateX(100%);
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
width: 170px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-options.visible {
|
||||||
|
display: block;
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-options.hidden {
|
||||||
|
transform: translateX(110%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-options ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-options li {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 15px 16px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-open {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-closed {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background-color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
outline: none;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0;
|
||||||
|
max-width: calc(100% - 30px);
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt {
|
||||||
|
background-color: #4CAF50;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
|
color: white;
|
||||||
|
display: none;
|
||||||
|
font-size: 15px;
|
||||||
|
left: 10px;
|
||||||
|
padding: 5px 15px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 15px;
|
||||||
|
z-index: 1000;
|
||||||
|
transition: opacity 1s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt.error {
|
||||||
|
background-color: #f44336;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-card {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 45px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-btn {
|
||||||
|
background-color: #007bff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 24px;
|
||||||
|
box-shadow: 0 4px 8px #0003;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: transform .3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.acknowledgment {
|
||||||
|
color: #6E6E6E;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body {
|
||||||
|
background-color: #121212;
|
||||||
|
color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title {
|
||||||
|
background-color: #121212;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card,
|
||||||
|
.search-input,
|
||||||
|
.search-card {
|
||||||
|
background-color: #343434;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-card {
|
||||||
|
border: 1px solid #6E6E6E;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-options,
|
||||||
|
#menu-button {
|
||||||
|
background-color: #343434;
|
||||||
|
border: 1px solid #6E6E6E;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "v1.2",
|
"versionCode": 200,
|
||||||
"versionCode": 12,
|
"version": "v2.0",
|
||||||
"zipUrl": "https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/download/v1.2/TrickyAddonModule_UpdateTargetList-v1.2.zip",
|
"zipUrl": "https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/download/v2.0/TrickyAddonModule-v2.0.zip",
|
||||||
"changelog": "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/refs/heads/master/changelog.md"
|
"changelog": "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/refs/heads/master/changelog.md"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user