diff --git a/module/webroot/scripts.js b/module/webroot/scripts.js
index 8ce7185..dc9fe12 100644
--- a/module/webroot/scripts.js
+++ b/module/webroot/scripts.js
@@ -27,11 +27,37 @@ async function runAction() {
output.appendChild(lineElement);
});
} catch (error) {
- output.innerHTML = '[!] Error: Fail to execute action.sh';
console.error('Script execution failed:', error);
+ if (typeof ksu !== 'undefined' && ksu.mmrl) {
+ output.innerHTML = '[!] Please allow permission in MMRL settings
[-] Settings
[-] Security
[-] Allow JavaScript API
[-] Play Integrity Fix
[-] Enable Allow Advanced KernelSU API';
+ } else {
+ output.innerHTML = '[!] Error: Fail to execute action.sh';
+ }
+ }
+}
+
+// Function to check if running in MMRL
+function checkMMRL() {
+ if (typeof ksu !== 'undefined' && ksu.mmrl) {
+ // Set status bars theme based on device theme
+ try {
+ $playintegrityfix.setLightStatusBars(!window.matchMedia('(prefers-color-scheme: dark)').matches)
+ } catch (error) {
+ console.log("Error setting status bars theme:", error)
+ }
+
+ // Request API permission, supported version: 33045+
+ try {
+ $playintegrityfix.requestAdvancedKernelSUAPI();
+ } catch (error) {
+ console.log("Error requesting API:", error);
+ }
+ } else {
+ console.log("Not running in MMRL environment.");
}
}
document.addEventListener('DOMContentLoaded', async () => {
+ checkMMRL();
setTimeout(runAction, 200);
});
\ No newline at end of file