feat: add create home screen shortcut option

This commit is contained in:
KOWX712
2025-05-09 18:07:29 +08:00
parent a198a31a15
commit 0ecd59414e
22 changed files with 82 additions and 33 deletions

3
.gitattributes vendored
View File

@@ -2,4 +2,5 @@
** text eol=lf
# Denote all files that are truly binary and should not be modified.
module/bin/**/** binary
module/bin/**/** binary
*.png binary

6
module/webui/config.json Normal file
View File

@@ -0,0 +1,6 @@
{
"title": "Tricky Addon",
"icon": "icon.png",
"windowResize": false,
"exitConfirm": false
}

BIN
module/webui/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -84,6 +84,7 @@
<li class="ripple-element" id="customkb" data-i18n="menu.set_custom_keybox"></li>
<li class="ripple-element" id="boot-hash" data-i18n="menu.set_verified_boot_hash"></li>
<li class="ripple-element" id="security-patch" data-i18n="menu.set_security_patch"></li>
<li class="ripple-element" id="shortcut" data-i18n="menu.shortcut"></li>
<li class="ripple-element" id="about" data-i18n="menu.about"></li>
</ul>
</div>

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Set Custom Keybox",
"set_verified_boot_hash": "Set Verified Boot Hash",
"set_security_patch": "Set Security Patch",
"about": "About"
"about": "About",
"shortcut": "Create home screen shortcut"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Failed to set custom keybox",
"no_file_selected": "No file selected",
"system_app_not_found": "System app not found",
"system_app_error": "Failed to add system app"
"system_app_error": "Failed to add system app",
"shortcut_created": "Home screen shortcut created"
},
"security_patch": {
"title": "Security Patch",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "تعيين Keybox مخصص",
"set_verified_boot_hash": "تعيين تجزئة التمهيد الموثوق",
"set_security_patch": "تعيين تصحيح الأمان",
"about": "حول"
"about": "حول",
"shortcut": "إنشاء اختصار على الشاشة الرئيسية"
},
"boot_hash": {
"title": "تجزئة التمهيد",
@@ -99,7 +100,8 @@
"custom_key_set_error": "فشل في تعيين keybox مخصص",
"no_file_selected": "لم يتم اختيار أي ملف",
"system_app_not_found": "لم يتم العثور على تطبيق النظام",
"system_app_error": "فشل في إضافة تطبيق النظام"
"system_app_error": "فشل في إضافة تطبيق النظام",
"shortcut_created": "تم إنشاء اختصار على الشاشة الرئيسية"
},
"security_patch": {
"title": "تصحيح الأمان",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Özəl Keybox təyin et",
"set_verified_boot_hash": "Təsdiqlənmiş Boot Hash təyin et",
"set_security_patch": "Təhlükəsizlik Təkmilləşdirməsini təyin et",
"about": "Haqqında"
"about": "Haqqında",
"shortcut": "Ana ekran qısayolu yarat"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Özəl keybox təyin oluna bilmədi",
"no_file_selected": "Fayl seçilməyib",
"system_app_not_found": "Sistem tətbiqi tapılmadı",
"system_app_error": "Sistem tətbiqini əlavə etmək mümkün olmadı"
"system_app_error": "Sistem tətbiqini əlavə etmək mümkün olmadı",
"shortcut_created": "Ana ekran qısayolu yaradıldı"
},
"security_patch": {
"title": "Təhlükəsizlik Təkmilləşdirməsi",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Set Custom Keybox",
"set_verified_boot_hash": "Set Verified Boot Hash",
"set_security_patch": "Set Security Patch",
"about": "About"
"about": "About",
"shortcut": "Create home screen shortcut"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Failed to set custom keybox",
"no_file_selected": "No file selected",
"system_app_not_found": "System app not found",
"system_app_error": "Failed to add system app"
"system_app_error": "Failed to add system app",
"shortcut_created": "Home screen shortcut created"
},
"security_patch": {
"title": "Security Patch",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Establecer Keybox Personalizado",
"set_security_patch": "Configurar Parche de Seguridad",
"set_verified_boot_hash": "Configurar Boot Hash Verificado",
"about": "Acerca de"
"about": "Acerca de",
"shortcut": "Crear acceso directo en la pantalla de inicio"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Error al establecer el keybox personalizado",
"no_file_selected": "Ningún archivo seleccionado",
"system_app_not_found": "Aplicación del sistema no encontrada",
"system_app_error": "Error al agregar la aplicación del sistema"
"system_app_error": "Error al agregar la aplicación del sistema",
"shortcut_created": "Acceso directo creado en la pantalla de inicio"
},
"security_patch": {
"title": "Parche de Seguridad",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Définir une Keybox personnalisée",
"set_verified_boot_hash": "Définir le hash Verified Boot",
"set_security_patch": "Définir le patch de sécurité",
"about": "À propos"
"about": "À propos",
"shortcut": "Créer un raccourci sur l'écran d'accueil"
},
"boot_hash": {
"title": "Hash de démarrage",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Échec de la définition de la Keybox personnalisée",
"no_file_selected": "Aucun fichier sélectionné",
"system_app_not_found": "Application système introuvable",
"system_app_error": "Échec de l'ajout de l'application système"
"system_app_error": "Échec de l'ajout de l'application système",
"shortcut_created": "Raccourci créé sur l'écran d'accueil"
},
"security_patch": {
"title": "Patch de sécurité",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Gunakan Keybox Kustom",
"set_verified_boot_hash": "Atur Verified Boot Hash",
"set_security_patch": "Atur Patch Keamanan",
"about": "Tentang"
"about": "Tentang",
"shortcut": "Buat pintasan di layar utama"
},
"boot_hash": {
"title": "Verified Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Gagal menggunakan keybox kustom",
"no_file_selected": "Tidak ada file yang dipilih",
"system_app_not_found": "Aplikasi sistem tidak ditemukan",
"system_app_error": "Gagal menambahkan aplikasi sistem"
"system_app_error": "Gagal menambahkan aplikasi sistem",
"shortcut_created": "Pintasan layar utama telah dibuat"
},
"security_patch": {
"title": "Patch Keamanan",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Imposta Keybox Personalizzata",
"set_verified_boot_hash": "Imposta Boot Hash Verificato",
"set_security_patch": "Imposta Patch di Sicurezza",
"about": "About"
"about": "About",
"shortcut": "Crea collegamento nella schermata iniziale"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Impossibile impostare keybox personalizzata",
"no_file_selected": "Nessun file selezionato",
"system_app_not_found": "App di sistema non trovata",
"system_app_error": "Impossibile aggiungere l'app di sistema"
"system_app_error": "Impossibile aggiungere l'app di sistema",
"shortcut_created": "Collegamento creato nella schermata iniziale"
},
"security_patch": {
"title": "Patch di sicurezza",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "カスタム Keybox を設定",
"set_verified_boot_hash": "確認付きブートハッシュを設定",
"set_security_patch": "セキュリティパッチを設定",
"about": "このアドオンについて"
"about": "このアドオンについて",
"shortcut": "ホーム画面にショートカットを作成"
},
"boot_hash": {
"title": "ブートハッシュ",
@@ -99,7 +100,8 @@
"custom_key_set_error": "カスタム Keybox の設定に失敗しました",
"no_file_selected": "ファイルが選択されていません",
"system_app_not_found": "システムアプリが見つかりません",
"system_app_error": "システムアプリの追加に失敗しました"
"system_app_error": "システムアプリの追加に失敗しました",
"shortcut_created": "ホーム画面にショートカットが作成されました"
},
"security_patch": {
"title": "セキュリティパッチ",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Ustaw niestandardowy klucz ",
"set_verified_boot_hash": "Ustaw zweryfikowany skrót rozruchowy",
"set_security_patch": "Ustaw poprawkę bezpieczeństwa",
"about": "O"
"about": "O",
"shortcut": "Utwórz skrót na ekranie głównym"
},
"boot_hash": {
"title": "Hash rozruchu",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Nie udało się ustawić niestandardowego klucza",
"no_file_selected": "Nie wybrano pliku",
"system_app_not_found": "Aplikacja systemowa nie znaleziona",
"system_app_error": "Nie udało się dodać aplikacji systemowej"
"system_app_error": "Nie udało się dodać aplikacji systemowej",
"shortcut_created": "Skrót na ekranie głównym został utworzony"
},
"security_patch": {
"title": "Poprawka bezpieczeństwa",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Definir Keybox Custom",
"set_verified_boot_hash": "Definir Hash de Boot Verificado",
"set_security_patch": "Definir Patch de segurança",
"about": "Sobre"
"about": "Sobre",
"shortcut": "Criar atalho na tela inicial"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Falha ao definir keybox customizada",
"no_file_selected": "Nenhum arquivo selecionado",
"system_app_not_found": "App do sistema não encontrado",
"system_app_error": "Falha ao adicionar app do sistema"
"system_app_error": "Falha ao adicionar app do sistema",
"shortcut_created": "Atalho na tela inicial criado com sucesso"
},
"security_patch": {
"title": "Patch de segurança",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Установить пользовательский Keybox",
"set_security_patch": "Установить Security Patch",
"set_verified_boot_hash": "Установить Verified Boot Hash",
"about": "О программе"
"about": "О программе",
"shortcut": "Создать ярлык на главном экране"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Не удалось установить пользовательский keybox",
"no_file_selected": "Файл не выбран",
"system_app_not_found": "Системное приложение не найдено",
"system_app_error": "Не удалось добавить системное приложение"
"system_app_error": "Не удалось добавить системное приложение",
"shortcut_created": "Ярлык на главном экране создан"
},
"security_patch": {
"title": "Патч безопасности",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "I-set ang Custom Keybox",
"set_verified_boot_hash": "I-set ang Verified Boot Hash",
"set_security_patch": "I-set ang Security Patch",
"about": "Tungkol"
"about": "Tungkol",
"shortcut": "Gumawa ng shortcut sa home screen"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Nabigong i-set ang Custom Keybox",
"no_file_selected": "Walang napiling file",
"system_app_not_found": "Walang natagpuan na system app",
"system_app_error": "Nabigong dagdag ang system app"
"system_app_error": "Nabigong dagdag ang system app",
"shortcut_created": "Matagumpay na nagawa ang shortcut sa home screen"
},
"security_patch": {
"title": "Security Patch",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "Özel Keybox Ayarla",
"set_security_patch": "Güvenlik Yaması Ayarla",
"set_verified_boot_hash": "Doğrulanmış Boot Hash Ayarla",
"about": "Hakkında"
"about": "Hakkında",
"shortcut": "Ana ekrana kısayol oluştur"
},
"boot_hash": {
"title": "Boot Hash",
@@ -99,7 +100,8 @@
"custom_key_set_error": "Özel keybox ayarlanamadı",
"no_file_selected": "Dosya seçilmedi",
"system_app_not_found": "Sistem uygulaması bulunamadı",
"system_app_error": "Sistem uygulaması ekleme hatası"
"system_app_error": "Sistem uygulaması ekleme hatası",
"shortcut_created": "Ana ekran kısayolu oluşturuldu"
},
"security_patch": {
"title": "Güvenlik Yaması",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "设置自定义密钥",
"set_security_patch": "设置安全补丁",
"set_verified_boot_hash": "设置哈希值",
"about": "关于"
"about": "关于",
"shortcut": "创建桌面快捷方式"
},
"boot_hash": {
"title": "哈希值",
@@ -99,7 +100,8 @@
"custom_key_set_error": "设置自定义密钥失败",
"no_file_selected": "未选择文件",
"system_app_not_found": "未找到该系统应用",
"system_app_error": "系统应用添加失败"
"system_app_error": "系统应用添加失败",
"shortcut_created": "桌面快捷方式已创建"
},
"security_patch": {
"title": "安全补丁",

View File

@@ -57,7 +57,8 @@
"set_custom_keybox": "設置自定義密鑰",
"set_security_patch": "設置安全補丁",
"set_verified_boot_hash": "設置哈希值",
"about": "關於"
"about": "關於",
"shortcut": "建立主畫面捷徑"
},
"boot_hash": {
"title": "哈希值",
@@ -99,7 +100,8 @@
"custom_key_set_error": "設置自定義密鑰失敗",
"no_file_selected": "未選擇文件",
"system_app_not_found": "未找到該系統應用",
"system_app_error": "系統應用添加失敗"
"system_app_error": "系統應用添加失敗",
"shortcut_created": "主畫面捷徑已建立"
},
"security_patch": {
"title": "安全補丁",

View File

@@ -192,6 +192,14 @@ function checkMMRL() {
if (window.$tricky_store && Object.keys($tricky_store).length > 0) {
// Set status bars theme based on device theme
$tricky_store.setLightStatusBars(!window.matchMedia('(prefers-color-scheme: dark)').matches)
// Create home screen shortcut
const shortcutButton = document.getElementById('shortcut');
shortcutButton.style.display = 'flex';
shortcutButton.addEventListener('click', () => {
$tricky_store.createShortcut();
showPrompt("prompt.shortcut_created", true);
});
}
}

View File

@@ -113,6 +113,7 @@
user-select: none;
}
#shortcut,
#select-denylist,
#security-patch {
display: none;