Merge pull request #600 from KOWX712/main
Some checks failed
Android CI / build (push) Has been cancelled

misc update
This commit is contained in:
chiteroman 2025-04-27 14:18:24 +02:00 committed by GitHub
commit ce4d2e43c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 110 additions and 112 deletions

View File

@ -5,6 +5,14 @@ MODDIR=/data/adb/modules/playintegrityfix
version=$(grep "^version=" $MODDIR/module.prop | sed 's/version=//g') version=$(grep "^version=" $MODDIR/module.prop | sed 's/version=//g')
FORCE_PREVIEW=1 FORCE_PREVIEW=1
# lets try to use tmpfs for processing
TEMPDIR="$MODDIR/temp" #fallback
[ -w /sbin ] && TEMPDIR="/sbin/playintegrityfix"
[ -w /debug_ramdisk ] && TEMPDIR="/debug_ramdisk/playintegrityfix"
[ -w /dev ] && TEMPDIR="/dev/playintegrityfix"
mkdir -p "$TEMPDIR"
cd "$TEMPDIR"
echo "[+] PlayIntegrityFix $version" echo "[+] PlayIntegrityFix $version"
echo "[+] $(basename "$0")" echo "[+] $(basename "$0")"
printf "\n\n" printf "\n\n"
@ -20,6 +28,8 @@ sleep_pause() {
download_fail() { download_fail() {
dl_domain=$(echo "$1" | awk -F[/:] '{print $4}') dl_domain=$(echo "$1" | awk -F[/:] '{print $4}')
echo "$1" | grep -q "\.zip$" && return echo "$1" | grep -q "\.zip$" && return
# Clean up on download fail
rm -rf "$TEMPDIR"
ping -c 1 -W 5 "$dl_domain" > /dev/null 2>&1 || { ping -c 1 -W 5 "$dl_domain" > /dev/null 2>&1 || {
echo "[!] Unable to connect to $dl_domain, please check your internet connection and try again" echo "[!] Unable to connect to $dl_domain, please check your internet connection and try again"
sleep_pause sleep_pause
@ -52,14 +62,6 @@ set_random_beta() {
PRODUCT=$(echo "$PRODUCT_LIST" | sed -n "$((rand_index + 1))p") PRODUCT=$(echo "$PRODUCT_LIST" | sed -n "$((rand_index + 1))p")
} }
# lets try to use tmpfs for processing
TEMPDIR="$MODDIR/temp" #fallback
[ -w /sbin ] && TEMPDIR="/sbin/playintegrityfix"
[ -w /debug_ramdisk ] && TEMPDIR="/debug_ramdisk/playintegrityfix"
[ -w /dev ] && TEMPDIR="/dev/playintegrityfix"
mkdir -p "$TEMPDIR"
cd "$TEMPDIR"
# Get latest Pixel Beta information # Get latest Pixel Beta information
download https://developer.android.com/about/versions PIXEL_VERSIONS_HTML download https://developer.android.com/about/versions PIXEL_VERSIONS_HTML
BETA_URL=$(grep -o 'https://developer.android.com/about/versions/.*[0-9]"' PIXEL_VERSIONS_HTML | sort -ru | cut -d\" -f1 | head -n1) BETA_URL=$(grep -o 'https://developer.android.com/about/versions/.*[0-9]"' PIXEL_VERSIONS_HTML | sort -ru | cut -d\" -f1 | head -n1)
@ -93,6 +95,12 @@ echo "$MODEL ($PRODUCT)"
FINGERPRINT="$(strings PIXEL_ZIP_METADATA | grep -am1 'post-build=' | cut -d= -f2)" FINGERPRINT="$(strings PIXEL_ZIP_METADATA | grep -am1 'post-build=' | cut -d= -f2)"
SECURITY_PATCH="$(strings PIXEL_ZIP_METADATA | grep -am1 'security-patch-level=' | cut -d= -f2)" SECURITY_PATCH="$(strings PIXEL_ZIP_METADATA | grep -am1 'security-patch-level=' | cut -d= -f2)"
# Validate required field to prevent empty pif.json
if [ -z "$FINGERPRINT" ] || [ -z "$SECURITY_PATCH" ]; then
# link to download pixel rom metadata that skipped connection check due to ulimit
download_fail "https://dl.google.com"
fi
echo "- Dumping values to pif.json ..." echo "- Dumping values to pif.json ..."
cat <<EOF | tee pif.json cat <<EOF | tee pif.json
{ {

View File

@ -21,6 +21,7 @@ function applyButtonEventListeners() {
const fetchButton = document.getElementById('fetch'); const fetchButton = document.getElementById('fetch');
const previewFpToggle = document.getElementById('preview-fp-toggle-container'); const previewFpToggle = document.getElementById('preview-fp-toggle-container');
const clearButton = document.querySelector('.clear-terminal'); const clearButton = document.querySelector('.clear-terminal');
const terminal = document.querySelector('.output-terminal-content');
fetchButton.addEventListener('click', runAction); fetchButton.addEventListener('click', runAction);
previewFpToggle.addEventListener('click', async () => { previewFpToggle.addEventListener('click', async () => {
@ -34,14 +35,12 @@ function applyButtonEventListeners() {
console.error('Failed to switch fingerprint type:', error); console.error('Failed to switch fingerprint type:', error);
} }
}); });
clearButton.addEventListener('click', () => { clearButton.addEventListener('click', () => {
const output = document.querySelector('.output-terminal-content'); terminal.innerHTML = '';
output.innerHTML = '';
currentFontSize = 14; currentFontSize = 14;
updateFontSize(currentFontSize); updateFontSize(currentFontSize);
}); });
const terminal = document.querySelector('.output-terminal-content');
terminal.addEventListener('touchstart', (e) => { terminal.addEventListener('touchstart', (e) => {
if (e.touches.length === 2) { if (e.touches.length === 2) {
@ -49,7 +48,6 @@ function applyButtonEventListeners() {
initialPinchDistance = getDistance(e.touches[0], e.touches[1]); initialPinchDistance = getDistance(e.touches[0], e.touches[1]);
} }
}, { passive: false }); }, { passive: false });
terminal.addEventListener('touchmove', (e) => { terminal.addEventListener('touchmove', (e) => {
if (e.touches.length === 2) { if (e.touches.length === 2) {
e.preventDefault(); e.preventDefault();
@ -66,7 +64,6 @@ function applyButtonEventListeners() {
initialPinchDistance = currentDistance; initialPinchDistance = currentDistance;
} }
}, { passive: false }); }, { passive: false });
terminal.addEventListener('touchend', () => { terminal.addEventListener('touchend', () => {
initialPinchDistance = null; initialPinchDistance = null;
}); });
@ -147,11 +144,29 @@ async function runAction() {
actionRunning = false; actionRunning = false;
} }
// Function to apply ripple effect /**
* Simulate MD3 ripple animation
* Usage: class="ripple-element" style="position: relative; overflow: hidden;"
* Note: Require background-color to work properly
* @return {void}
*/
function applyRippleEffect() { function applyRippleEffect() {
document.querySelectorAll('.ripple-element').forEach(element => { document.querySelectorAll('.ripple-element').forEach(element => {
if (element.dataset.rippleListener !== "true") { if (element.dataset.rippleListener !== "true") {
element.addEventListener("pointerdown", function (event) { element.addEventListener("pointerdown", async (event) => {
// Pointer up event
const handlePointerUp = () => {
ripple.classList.add("end");
setTimeout(() => {
ripple.classList.remove("end");
ripple.remove();
}, duration * 1000);
element.removeEventListener("pointerup", handlePointerUp);
element.removeEventListener("pointercancel", handlePointerUp);
};
element.addEventListener("pointerup", handlePointerUp);
element.addEventListener("pointercancel", handlePointerUp);
const ripple = document.createElement("span"); const ripple = document.createElement("span");
ripple.classList.add("ripple"); ripple.classList.add("ripple");
@ -176,7 +191,6 @@ function applyRippleEffect() {
// Adaptive color // Adaptive color
const computedStyle = window.getComputedStyle(element); const computedStyle = window.getComputedStyle(element);
const bgColor = computedStyle.backgroundColor || "rgba(0, 0, 0, 0)"; const bgColor = computedStyle.backgroundColor || "rgba(0, 0, 0, 0)";
const textColor = computedStyle.color;
const isDarkColor = (color) => { const isDarkColor = (color) => {
const rgb = color.match(/\d+/g); const rgb = color.match(/\d+/g);
if (!rgb) return false; if (!rgb) return false;
@ -185,19 +199,8 @@ function applyRippleEffect() {
}; };
ripple.style.backgroundColor = isDarkColor(bgColor) ? "rgba(255, 255, 255, 0.2)" : ""; ripple.style.backgroundColor = isDarkColor(bgColor) ? "rgba(255, 255, 255, 0.2)" : "";
// Append ripple and handle cleanup // Append ripple
element.appendChild(ripple); element.appendChild(ripple);
const handlePointerUp = () => {
ripple.classList.add("end");
setTimeout(() => {
ripple.classList.remove("end");
ripple.remove();
}, duration * 1000);
element.removeEventListener("pointerup", handlePointerUp);
element.removeEventListener("pointercancel", handlePointerUp);
};
element.addEventListener("pointerup", handlePointerUp);
element.addEventListener("pointercancel", handlePointerUp);
}); });
element.dataset.rippleListener = "true"; element.dataset.rippleListener = "true";
} }
@ -213,27 +216,6 @@ async function checkMMRL() {
} catch (error) { } catch (error) {
console.log("Error setting status bars theme:", 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);
}
try {
await execCommand("whoami");
} catch (error) {
appendToOutput("");
appendToOutput("[!] Please allow permission in MMRL settings");
appendToOutput("[-] Settings");
appendToOutput("[-] Security");
appendToOutput("[-] Allow JavaScript API");
appendToOutput("[-] Play Integrity Fix");
appendToOutput("[-] Enable Allow Advanced KernelSU API");
appendToOutput("");
}
} else {
console.log("Not running in MMRL environment.");
} }
} }

View File

@ -1,23 +1,61 @@
@font-face { @import url('https://mui.kernelsu.org/mmrl/insets.css');
font-family: 'Mono'; @import url('https://mui.kernelsu.org/mmrl/colors.css');
src: url('assets/RobotoMono-Regular.ttf') format('truetype');
font-weight: normal; :root {
font-style: normal; /* window inset */
--top-inset: var(--window-inset-top, 0px);
--bottom-inset: var(--window-inset-bottom, 0px);
/* Background colors */
--bg-primary: var(--background, #EDEDED);
--bg-secondary: var(--tonalSurface, #fff);
--bg-input: var(--surfaceBright, #F5F5F5);
/* Text colors */
--text-constant: var(--onSurface, #000);
--text-primary: var(--onSurface, #000);
--text-muted: #757575;
/* Border colors */
--border-color: var(--outlineVariant, #ccc);
/* Button colors */
--btn-primary: var(--primary, #007bff);
--btn-primary-text: var(--onPrimary, #fff);
}
@media (prefers-color-scheme: dark) {
:root {
/* Background colors */
--bg-primary: var(--background, #151515);
--bg-secondary: var(--tonalSurface, #292929);
--bg-input: var(--surfaceBright, #1b1b1b);
/* Text colors */
--text-constant: var(--onSurface, #eee);;
--text-primary: var(--onSurface, #eee);
--text-muted: #C2C2C2;
/* Border colors */
--border-color: var(--outlineVariant, #636363);
}
} }
body { body {
background-color: #F5F5F5; color: var(--text-primary);
padding-top: var(--window-inset-top); background-color: var(--bg-primary);
padding-bottom: var(--window-inset-bottom); padding-top: var(--top-inset);
padding-bottom: var(--bottom-inset);
margin: 0;
} }
.content { .content {
padding-bottom: 10px; padding-bottom: 30px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 90vh; height: calc(100vh - var(--top-inset) - var(--bottom-inset));
gap: 15px; box-sizing: border-box;
} }
.header { .header {
@ -28,22 +66,23 @@ body {
width: calc(85vw + 30px); width: calc(85vw + 30px);
max-width: 800px; max-width: 800px;
flex-shrink: 0; flex-shrink: 0;
background-color: #fff; background-color: var(--bg-secondary);
border: none; border: none;
border-radius: 15px; border-radius: 15px;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
overflow: hidden; overflow: hidden;
} }
.toggle-list { .toggle-list {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #fff; background-color: var(--bg-secondary);
padding: 10px 20px; min-height: 25px;
padding: 8px 20px;
white-space: nowrap; white-space: nowrap;
text-align: left; text-align: left;
border-bottom: 1px solid #ccc; border-bottom: 1px solid var(--border-color);;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
@ -81,7 +120,7 @@ body {
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: #ccc; background-color: var(--border-color);
-webkit-transition: .4s; -webkit-transition: .4s;
transition: .4s; transition: .4s;
} }
@ -93,19 +132,20 @@ body {
width: 19px; width: 19px;
left: 3px; left: 3px;
bottom: 3px; bottom: 3px;
background-color: white; background-color: var(--text-muted);
transition: .4s; transition: .4s;
} }
input:checked+.slider { input:checked+.slider {
background-color: #007bff; background-color: var(--btn-primary);
} }
input:focus+.slider { input:focus+.slider {
box-shadow: 0 0 1px #007bff; box-shadow: 0 0 1px var(--btn-primary);
} }
input:checked+.slider:before { input:checked+.slider:before {
background-color: var(--btn-primary-text);
transform: translateX(15px); transform: translateX(15px);
} }
@ -121,10 +161,11 @@ input:checked+.slider:before {
width: calc(85vw + 30px); width: calc(85vw + 30px);
max-width: 800px; max-width: 800px;
flex-grow: 1; flex-grow: 1;
background-color: #fff; background-color: var(--bg-input);
box-sizing: border-box; box-sizing: border-box;
border-radius: 15px; border-radius: 15px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
margin-top: 15px;
overflow: hidden; overflow: hidden;
} }
@ -133,27 +174,27 @@ input:checked+.slider:before {
padding: 5px 15px; padding: 5px 15px;
font-size: 14px; font-size: 14px;
justify-content: space-between; justify-content: space-between;
background-color: #E0E0E0; background-color: var(--bg-secondary);
color: #333; color: var(--text-muted);
user-select: none; user-select: none;
} }
.clear-terminal { .clear-terminal {
display: flex; display: flex;
align-items: center; align-items: center;
}
.clear-terminal svg { svg {
fill: #333; fill: var(--text-muted);;
}
} }
.output-terminal-content { .output-terminal-content {
font-family: 'Mono'; font-family: monospace;
font-size: 14px; font-size: 14px;
padding: 10px; padding: 10px;
width: calc(100% - 20px); width: calc(100% - 20px);
height: calc(100% - 50px); height: calc(100% - 50px);
overflow-y: scroll; overflow-y: auto;
} }
.output-content { .output-content {
@ -188,37 +229,4 @@ input:checked+.slider:before {
to { to {
transform: scale(3); transform: scale(3);
} }
}
@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
color: #fff;
}
.toggle-list,
.button-box,
.output-terminal-header {
background-color: #343434;
}
.output-terminal-header {
color: #ccc;
}
.clear-terminal svg {
fill: #ccc;
}
.output-terminal {
background-color: #232323;
}
.toggle-list {
border-bottom: 1px solid #6E6E6E;
}
.slider {
background-color: #6E6E6E;
}
} }