Skip to content

Commit

Permalink
webui: add preview fingerprint toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
KOWX712 committed Mar 3, 2025
1 parent 60fdcfd commit 028a81d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 22 deletions.
37 changes: 22 additions & 15 deletions module/webroot/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!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>
<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="content">
Expand All @@ -18,15 +18,22 @@ <h3>
</div>
<div class="button-box">
<div class="toggle-list ripple-element" id="fetch">
<span class="toggle-text">Fetch pif.json</span>
</div>
<div class="toggle-list ripple-element" id="sdk-vending-toggle-container">
<span class="toggle-text">Spoof sdk version to Play Store</span>
<label class="toggle-switch">
<input type="checkbox" id="toggle-sdk-vending" disabled>
<span class="slider round"></span>
</label>
</div>
<span class="toggle-text">Fetch pif.json</span>
</div>
<div class="toggle-list ripple-element" id="preview-fp-toggle-container">
<span class="toggle-text">Use preview fingerprint</span>
<label class="toggle-switch">
<input type="checkbox" id="toggle-preview-fp" disabled>
<span class="slider round"></span>
</label>
</div>
<div class="toggle-list ripple-element" id="sdk-vending-toggle-container">
<span class="toggle-text">Spoof sdk version to Play Store</span>
<label class="toggle-switch">
<input type="checkbox" id="toggle-sdk-vending" disabled>
<span class="slider round"></span>
</label>
</div>
</div>
<div class="output-terminal">
<div class="output-terminal-header">
Expand Down
48 changes: 41 additions & 7 deletions module/webroot/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async function execCommand(command) {
function applyButtonEventListeners() {
const fetchButton = document.getElementById('fetch');
const sdkVendingToggle = document.getElementById('sdk-vending-toggle-container');
const previewFpToggle = document.getElementById('preview-fp-toggle-container');
const clearButton = document.querySelector('.clear-terminal');

fetchButton.addEventListener('click', runAction);
Expand All @@ -43,10 +44,21 @@ function applyButtonEventListeners() {
appendToOutput(`[+] Successfully changed spoofVendingSdk to ${isChecked ? 0 : 1}`);
document.getElementById('toggle-sdk-vending').checked = !isChecked;
} catch (error) {
appendToOutput("[-] Failed to change spoofVendingSdk");
appendToOutput("[!] Failed to change spoofVendingSdk");
console.error('Failed to toggle sdk vending:', error);
}
});
previewFpToggle.addEventListener('click', async () => {
try {
const isChecked = document.getElementById('toggle-preview-fp').checked;
await execCommand(`sed -i 's/^FORCE_PREVIEW=.*$/FORCE_PREVIEW=${isChecked ? 0 : 1}/' /data/adb/modules/playintegrityfix/action.sh`);
appendToOutput(`[+] Switched fingerprint to ${isChecked ? 'beta' : 'preview'}`);
loadPreviewFingerprintConfig();
} catch (error) {
appendToOutput("[!] Failed to switch fingerprint type");
console.error('Failed to switch fingerprint type:', error);
}
});
clearButton.addEventListener('click', () => {
const output = document.querySelector('.output-terminal-content');
output.innerHTML = '';
Expand Down Expand Up @@ -92,19 +104,40 @@ async function loadVersionFromModuleProp() {
const version = await execCommand("grep '^version=' /data/adb/modules/playintegrityfix/module.prop | cut -d'=' -f2");
versionElement.textContent = version.trim();
} catch (error) {
appendToOutput("[-] Failed to read version from module.prop");
appendToOutput("[!] Failed to read version from module.prop");
console.error("Failed to read version from module.prop:", error);
}
}

// Function to load spoofVendingSdk config
async function loadSpoofVendingSdkConfig() {
const sdkVendingToggle = document.getElementById('toggle-sdk-vending');
const isChecked = await execCommand(`grep -o '"spoofVendingSdk": [01]' /data/adb/modules/playintegrityfix/pif.json | cut -d' ' -f2`);
if (isChecked === '0') {
try {
const sdkVendingToggle = document.getElementById('toggle-sdk-vending');
const isChecked = await execCommand(`grep -o '"spoofVendingSdk": [01]' /data/adb/modules/playintegrityfix/pif.json | cut -d' ' -f2`);
if (isChecked === '0') {
sdkVendingToggle.checked = false;
} else {
sdkVendingToggle.checked = true;
} else {
sdkVendingToggle.checked = true;
}
} catch (error) {
appendToOutput("[!] Failed to load spoofVendingSdk config");
console.error("Failed to load spoofVendingSdk config:", error);
}
}

// Function to load preview fingerprint config
async function loadPreviewFingerprintConfig() {
try {
const previewFpToggle = document.getElementById('toggle-preview-fp');
const isChecked = await execCommand(`grep -o 'FORCE_PREVIEW=[01]' /data/adb/modules/playintegrityfix/action.sh | cut -d'=' -f2`);
if (isChecked === '0') {
previewFpToggle.checked = false;
} else {
previewFpToggle.checked = true;
}
} catch (error) {
appendToOutput("[!] Failed to load preview fingerprint config");
console.error("Failed to load preview fingerprint config:", error);
}
}

Expand Down Expand Up @@ -262,6 +295,7 @@ document.addEventListener('DOMContentLoaded', async () => {
checkMMRL();
loadVersionFromModuleProp();
loadSpoofVendingSdkConfig();
loadPreviewFingerprintConfig();
applyButtonEventListeners();
applyRippleEffect();
});

0 comments on commit 028a81d

Please sign in to comment.