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
misc: drop MMRL permission request on new version of MMRL
- drop support for MMRL version < 33412
This commit is contained in:
@@ -246,15 +246,9 @@
|
|||||||
<!-- MMRL Permission Request Overlay -->
|
<!-- MMRL Permission Request Overlay -->
|
||||||
<div id="permission-popup" class="permission-popup overlay">
|
<div id="permission-popup" class="permission-popup overlay">
|
||||||
<div class="permission-content">
|
<div class="permission-content">
|
||||||
<h2 id="permission-title">Please allow JavaScript API in MMRL settings</h2>
|
<h2 id="permission-title">Please update MMRL to continue</h2>
|
||||||
<div class="permission-steps">
|
<div class="permission-steps">
|
||||||
<ol>
|
<p>Minimun MMRL version: v33412</p>
|
||||||
<li>Settings</li>
|
|
||||||
<li>Security</li>
|
|
||||||
<li>Allow JavaScript API</li>
|
|
||||||
<li>Tricky Store</li>
|
|
||||||
<li>Enable "Allow Advanced KernelSU API"</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ const ADDITIONAL_APPS = [ "android", "com.google.android.gms", "io.github.vvb206
|
|||||||
// Variables
|
// Variables
|
||||||
let e = 0;
|
let e = 0;
|
||||||
let isRefreshing = false;
|
let isRefreshing = false;
|
||||||
let MMRL_API = true;
|
|
||||||
|
|
||||||
// Function to set basePath
|
// Function to set basePath
|
||||||
async function getBasePath() {
|
async function getBasePath() {
|
||||||
@@ -214,21 +213,20 @@ async function checkMMRL() {
|
|||||||
console.error("Error setting status bars theme:", error)
|
console.error("Error setting status bars theme:", error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request API permission, supported version: 33045+
|
// Check MMRL version
|
||||||
try {
|
try {
|
||||||
$tricky_store.requestAdvancedKernelSUAPI();
|
const mmrlJson = $tricky_store.getMmrl();
|
||||||
|
const mmrlData = JSON.parse(mmrlJson);
|
||||||
|
if (mmrlData.versionCode < 33412) {
|
||||||
|
throw new Error('MMRL version is less than 33412');
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error requesting API:", error);
|
console.error('MMRL version check failed:', error);
|
||||||
}
|
$tricky_store.requestAdvancedKernelSUAPI(); // Just to ensure linkRedirect work
|
||||||
|
|
||||||
// Check permissions
|
|
||||||
try {
|
|
||||||
await execCommand('ls /data/adb/modules');
|
|
||||||
MMRL_API = true;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Permission check failed:', error);
|
|
||||||
permissionPopup.style.display = 'flex';
|
permissionPopup.style.display = 'flex';
|
||||||
MMRL_API = false;
|
setTimeout(() => {
|
||||||
|
linkRedirect('https://github.com/MMRLApp/MMRL/releases/latest');
|
||||||
|
}, 3000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -326,9 +324,8 @@ window.addEventListener('scroll', () => {
|
|||||||
// Initial load
|
// Initial load
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
await loadTranslations();
|
await loadTranslations();
|
||||||
await checkMMRL();
|
|
||||||
if (!MMRL_API) return;
|
|
||||||
await getBasePath();
|
await getBasePath();
|
||||||
|
checkMMRL();
|
||||||
hideFloatingBtn();
|
hideFloatingBtn();
|
||||||
getModuleVersion();
|
getModuleVersion();
|
||||||
setupMenuToggle();
|
setupMenuToggle();
|
||||||
|
|||||||
@@ -262,14 +262,6 @@ body {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.permission-steps ol {
|
|
||||||
padding: 0 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.permission-steps li {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ripple-element {
|
.ripple-element {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
Reference in New Issue
Block a user