mirror of
https://github.com/chiteroman/PlayIntegrityFix.git
synced 2025-01-18 18:42:21 +08:00
Merge pull request #503 from KOWX712/new_webui
Add action-on-webui support to old root manager.
This commit is contained in:
commit
51b38eab0d
@ -65,3 +65,14 @@ if [ -f "/data/adb/pif.json" ]; then
|
||||
ui_print "- Backup custom pif.json"
|
||||
mv -f /data/adb/pif.json /data/adb/pif.json.old
|
||||
fi
|
||||
|
||||
# give exec perm to action.sh
|
||||
chmod +x "$MODPATH/action.sh"
|
||||
|
||||
# action.sh, ap 10927, ksu 11981
|
||||
if { [ "$KSU" = "true" ] && [ "$KSU_VER_CODE" -ge 11981 ]; } ||
|
||||
{ [ "$APATCH" = "true" ] && [ "$APATCH_VER_CODE" -ge 10927 ]; }; then
|
||||
# we dont need the webui workaround
|
||||
# since manager has action
|
||||
rm -rf "$MODPATH/webroot"
|
||||
fi
|
||||
|
BIN
module/webroot/assets/RobotoMono-Regular.ttf
Normal file
BIN
module/webroot/assets/RobotoMono-Regular.ttf
Normal file
Binary file not shown.
14
module/webroot/index.html
Normal file
14
module/webroot/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Play Integrity Fix</title>
|
||||
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||
<link rel="stylesheet" type="text/css" href="/mmrl/insets.css" />
|
||||
<script type="module" crossorigin src="scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="output">[+] Fetching pif.json, please wait...</div>
|
||||
</body>
|
||||
</html>
|
37
module/webroot/scripts.js
Normal file
37
module/webroot/scripts.js
Normal file
@ -0,0 +1,37 @@
|
||||
// Execute shell commands with ksu.exec
|
||||
async function execCommand(command) {
|
||||
const callbackName = `exec_callback_${Date.now()}`;
|
||||
return new Promise((resolve, reject) => {
|
||||
window[callbackName] = (errno, stdout, stderr) => {
|
||||
delete window[callbackName];
|
||||
errno === 0 ? resolve(stdout) : reject(stderr);
|
||||
};
|
||||
ksu.exec(command, "{}", callbackName);
|
||||
});
|
||||
}
|
||||
|
||||
// Function to run the script and display its output
|
||||
async function runAction() {
|
||||
const output = document.querySelector('.output');
|
||||
try {
|
||||
const scriptOutput = await execCommand("sh /data/adb/modules/playintegrityfix/action.sh");
|
||||
output.innerHTML = '';
|
||||
const lines = scriptOutput.split('\n');
|
||||
lines.forEach(line => {
|
||||
const lineElement = document.createElement('div');
|
||||
lineElement.style.whiteSpace = 'pre-wrap';
|
||||
lineElement.textContent = line;
|
||||
if (line === '') {
|
||||
lineElement.innerHTML = ' ';
|
||||
}
|
||||
output.appendChild(lineElement);
|
||||
});
|
||||
} catch (error) {
|
||||
output.innerHTML = '[!] Error: Fail to execute action.sh';
|
||||
console.error('Script execution failed:', error);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
setTimeout(runAction, 200);
|
||||
});
|
27
module/webroot/styles.css
Normal file
27
module/webroot/styles.css
Normal file
@ -0,0 +1,27 @@
|
||||
@font-face {
|
||||
font-family: 'Mono';
|
||||
src: url('assets/RobotoMono-Regular.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Mono';
|
||||
padding-top: var(--window-inset-top);
|
||||
padding-bottom: var(--window-inset-bottom);
|
||||
}
|
||||
|
||||
.output {
|
||||
font-size: 14px;
|
||||
left: 10px;
|
||||
width: calc(100vw - 20px);
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #121212;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user