Invisible module update method, more

New update card for invisible module, refine module visibility logic (better adapt with MMRL). Add active class.
This commit is contained in:
KOWX712
2024-12-07 16:10:13 +08:00
parent 4563a3399d
commit 1b2a1701f4
10 changed files with 116 additions and 30 deletions

View File

@@ -18,6 +18,13 @@ elif [ ! -d "$TSPA" ] && [ -f "/storage/emulated/0/stop-tspa-auto-target" ]; the
rm -f "/storage/emulated/0/stop-tspa-auto-target"
fi
if [ -f "$TS/action.sh" ]; then
rm -f "$TS/action.sh"
fi
if [ -d "$TS/webroot" ]; then
rm -rf "$TS/webroot"
fi
if [ -d "$MODPATH/common/temp" ]; then
if [ "$KSU" ] || [ "$APATCH" ]; then
rm -f "$MODPATH/module.prop"
@@ -29,23 +36,15 @@ if [ -d "$MODPATH/common/temp" ]; then
exit 0
fi
MODPATH="$HIDE_DIR"
if [ -f "$MODPATH/action.sh" ]; then
ln -s "$MODPATH/action.sh" "$TS/action.sh"
fi
ln -s "$MODPATH/webroot" "$TS/webroot"
fi
OUTPUT_APP="$MODPATH/common/applist"
OUTPUT_SKIP="$MODPATH/common/skiplist"
if [ -f "$MODPATH/action.sh" ]; then
if [ -f "$TS/action.sh" ]; then
rm -f "$TS/action.sh"
fi
ln -s "$MODPATH/action.sh" "$TS/action.sh"
else
if [ -d "$TS/webroot" ]; then
rm -rf "$TS/webroot"
fi
ln -s "$MODPATH/webroot" "$TS/webroot"
fi
until [ "$(getprop sys.boot_completed)" = "1" ]; do
sleep 1
done

View File

@@ -77,6 +77,10 @@
<!-- Applist Display -->
<div id="apps-list"></div>
<div class="update-card" id="update-card">
<p id="update-available" data-i18n="update_available"></p>
<p id="redirect-to-release" data-i18n="redirect_to_release"></p>
</div>
<template id="app-template">
<div class="card-box">
<div class="card">

View File

@@ -34,6 +34,7 @@ const saveButton = document.getElementById('boot-hash-save-button');
// Applist Elements
const appTemplate = document.getElementById('app-template').content;
const appListContainer = document.getElementById('apps-list');
const updateCard = document.getElementById('update-card');
// Loading, Save and Prompt Elements
const loadingIndicator = document.querySelector('.loading');
@@ -349,6 +350,7 @@ async function runExtraScript() {
if (output.includes("update")) {
console.log("Update detected from extra script.");
showPrompt("new_update");
updateCard.style.display = "flex";
await execCommand(`
su -c "mkdir -p '/data/adb/modules/TA_utl' &&
cp -rf '${basePath}common/temp/'* '/data/adb/modules/TA_utl/'"
@@ -539,7 +541,7 @@ function aboutMenu() {
hideMenu();
});
aboutOverlay.addEventListener('click', (event) => {
if (!menu.contains(event.target)) {
if (!aboutMenu.contains(event.target)) {
hideMenu();
}
});
@@ -630,6 +632,9 @@ async function fetchAppList() {
}
floatingBtn.style.transform = "translateY(-120px)";
toggleableCheckbox();
if (appListContainer.firstChild !== updateCard) {
appListContainer.insertBefore(updateCard, appListContainer.firstChild);
}
}
// Make checkboxes toggleable
@@ -763,6 +768,11 @@ document.addEventListener('DOMContentLoaded', async () => {
runExtraScript();
});
// Redirect to GitHub release page
updateCard.addEventListener('click', () => {
window.location.href = 'https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest';
});
// Function to execute shell commands
async function execCommand(command) {
return new Promise((resolve, reject) => {

View File

@@ -7,6 +7,9 @@
"boot_hash_input_placeholder": "Paste your verified Boot Hash here",
"uninstall_webui": "Uninstall WebUI",
"update_available": "A new version is ready",
"redirect_to_release": "tap to download the latest version",
"refresh": "Refresh",
"select_all": "Select All",
"deselect_all": "Deselect All",
@@ -33,7 +36,7 @@
"by": "by ",
"telegram_channel": "Telegram Channel",
"github": "GitHub",
"disclaimer": "This WebUI is not a part of Tricky Store, DO NOT report to Tricky Store author if you encounter any issue.",
"disclaimer": "This module is not a part of the Tricky Store module. DO NOT report any issues to Tricky Store if encountered.",
"acknowledgment": "Acknowledgment",
"no_internet": "Please check your Internet connection",

View File

@@ -7,6 +7,9 @@
"boot_hash_input_placeholder": "Paste your verified Boot Hash here",
"uninstall_webui": "Uninstall WebUI",
"update_available": "A new version is ready",
"redirect_to_release": "tap to download the latest version",
"refresh": "Refresh",
"select_all": "Select All",
"deselect_all": "Deselect All",

View File

@@ -7,6 +7,9 @@
"boot_hash_input_placeholder": "Вставьте свой проверенный Boot Hash сюда",
"uninstall_webui": "Удалить WebUI",
"update_available": "Доступна новая версия",
"redirect_to_release": "нажмите, чтобы скачать последнюю версию",
"refresh": "Обновить",
"select_all": "Выбрать все",
"deselect_all": "Отменить выбор всех",

View File

@@ -7,6 +7,9 @@
"boot_hash_input_placeholder": "I-paste ang iyong verified Boot Hash dito",
"uninstall_webui": "I-uninstall ang WebUI",
"update_available": "Handa na ang bagong bersyon",
"redirect_to_release": "i-tap para i-download ang pinakabagong bersyon",
"refresh": "I-refresh",
"select_all": "Piliin Lahat",
"deselect_all": "Huwag Pumili ng Lahat",

View File

@@ -6,6 +6,9 @@
"loading": "加载中...",
"boot_hash_input_placeholder": "在此粘贴您的哈希值",
"uninstall_webui": "卸载 WebUI",
"update_available": "发现新的版本",
"redirect_to_release": "点击跳转 GitHub 下载最新版本",
"refresh": "刷新",
"select_all": "全选",

View File

@@ -7,6 +7,9 @@
"boot_hash_input_placeholder": "在此粘貼您的哈希值",
"uninstall_webui": "卸載 WebUI",
"update_available": "發現新的版本",
"redirect_to_release": "點擊跳轉至 GitHub 下載最新版本",
"refresh": "刷新",
"select_all": "全選",
"deselect_all": "取消全選",

View File

@@ -106,6 +106,7 @@ body {
width: 100%;
white-space: nowrap;
border-bottom: 1px solid #ccc;
transition: background-color 0.2s ease;
}
.language-option:last-child {
@@ -277,9 +278,11 @@ body {
border: none;
border-radius: 38px;
font-size: 18px;
font-weight: bold;
background-color: #007bff;
color: white;
margin-left: auto;
transition: background-color 0.2s ease;
}
.about-overlay {
@@ -309,6 +312,7 @@ body {
padding: 25px 30px;
z-index: 1200;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
z-index: 1200;
opacity: 0;
display: flex;
flex-direction: column;
@@ -344,10 +348,6 @@ body {
font-size: 14px;
}
.about-content p[data-i18n="disclaimer"] {
font-style: italic;
}
.about-content p span[data-i18n="telegram_channel"] {
font-weight: bold;
}
@@ -356,6 +356,10 @@ body {
font-weight: bold;
}
.about-content p[data-i18n="disclaimer"] {
font-style: italic;
}
.about-content p[data-i18n="acknowledgment"] {
font-weight: bold;
font-size: 18px;
@@ -365,10 +369,6 @@ body {
font-size: 16px;
}
#apps-list {
margin-top: 100px;
}
.search-menu-container {
display: flex;
position: fixed;
@@ -505,6 +505,7 @@ body {
padding: 12px 4px;
text-align: left;
border-bottom: 1px solid #ccc;
transition: background-color 0.2s ease;
}
.menu-options li:last-child {
@@ -528,6 +529,40 @@ body {
align-items: center;
}
#apps-list {
margin-top: 100px;
flex-direction: column;
}
.update-card {
display: none;
flex-direction: column;
justify-content: space-between;
align-items: center;
background-color: #DCDCDC;
border: none;
border-radius: 10px;
margin: 0 auto;
margin-bottom: 10px;
outline: none;
padding: 12px;
width: calc(100% - 30px);
max-width: 900px;
transition: background-color 0.2s ease;
}
#update-available {
font-size: 20px;
font-weight: bold;
margin-top: 15px;
margin-bottom: 0;
}
#redirect-to-release {
margin-top: 5px;
margin-bottom: 15px;
}
.card {
background-color: white;
border: none;
@@ -538,6 +573,7 @@ body {
padding: 12px;
width: calc(100% - 30px);
max-width: 900px;
transition: background-color 0.2s ease;
}
.content {
@@ -645,10 +681,6 @@ body {
border-bottom-right-radius: 50px;
}
.floating-btn:active {
background-color: #003d80;
}
.loading {
position: fixed;
top: 0;
@@ -689,10 +721,6 @@ body {
transition: background-color 0.2s ease;
}
.uninstall-container:active {
background-color: #830000;
}
.uninstall-container i {
margin-right: 5px;
font-size: 18px;
@@ -709,6 +737,22 @@ body {
display: none;
}
.language-option:active,
.menu-options li:active,
.card:active,
.update-card:active {
background-color: #C8C8C8;
}
.boot-hash-save-button:active,
.floating-btn:active {
background-color: #003d80;
}
.uninstall-container:active {
background-color: #830000;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
@@ -736,6 +780,10 @@ body {
background-color: #343434;
}
.update-card {
background-color: #4D4D4D;
}
.search-card {
border: 1px solid #6E6E6E;
}
@@ -756,4 +804,11 @@ body {
.menu-options li {
border-bottom: 1px solid #6E6E6E;
}
.language-option:active,
.menu-options li:active,
.card:active,
.update-card:active {
background-color: #616161;
}
}