You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
improve: Web UI by ignoring hw unsupported 64/32-bit
This commit improves Web UI Javascript code by allowing it to be aware of unsupported 64 or 32 bit, thus removing zygoteXX and daemonXX info.
This commit is contained in:
@@ -66,13 +66,13 @@
|
||||
<div class="brightc lock" style="font-size: 1.1em">Root Implementation</div>
|
||||
<div class="brightc desc lockd" id="root_impl" style="font-size: 0.9em; margin-top: 3px;">Unknown</div>
|
||||
</div>
|
||||
<div class="brightc content">
|
||||
<div class="brightc content" id="zygote64">
|
||||
<div class="brightc lock" style="font-size: 1.1em">Zygote64</div>
|
||||
<div class="brightc desc lockd" id="is_zygote64_injected" style="font-size: 0.9em; margin-top: 3px;">Unknown</div>
|
||||
<div class="brightc desc lockd" id="zygote64_status" style="font-size: 0.9em; margin-top: 3px;">Unknown</div>
|
||||
</div>
|
||||
<div class="brightc content lock">
|
||||
<div class="brightc content lock" id="zygote32">
|
||||
<div class="brightc lock" style="font-size: 1.1em">Zygote32</div>
|
||||
<div class="brightc desc lockd" id="is_zygote32_injected" style="font-size: 0.9em; margin-top: 3px;">Unknown</div>
|
||||
<div class="brightc desc lockd" id="zygote32_status" style="font-size: 0.9em; margin-top: 3px;">Unknown</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- INFO: Settings card body (Daemon32) -->
|
||||
<div class="small_card">
|
||||
<div class="small_card" id="daemon64">
|
||||
<div class="small_card_bg content" style="font-size: 1.1em; padding-left: 5px; padding-top: 6px; padding-bottom: 14px;">Daemon (32 bit)</div>
|
||||
<div class="small_card_bg content button_list">
|
||||
<div class="center button">Stop</div>
|
||||
@@ -129,7 +129,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- INFO: Settings card body (Daemon64) -->
|
||||
<div class="small_card" style="margin-top: 15px;">
|
||||
<div class="small_card" style="margin-top: 15px;" id="daemon32">
|
||||
<div class="small_card_bg content" style="font-size: 1.1em; padding-left: 5px; padding-top: 6px; padding-bottom: 14px;">Daemon (64 bit)</div>
|
||||
<div class="small_card_bg content button_list">
|
||||
<div class="center button">Stop</div>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { fullScreen, exec, toast } from './kernelsu.js';
|
||||
import { fullScreen, exec, toast } from './kernelsu.js'
|
||||
|
||||
const EXPECTED = 1
|
||||
const UNEXPECTED_FAIL = 2
|
||||
|
||||
(async () => {
|
||||
const loading_screen = document.getElementById('loading_screen')
|
||||
|
||||
fullScreen(true)
|
||||
|
||||
const loading_screen = document.getElementById('loading_screen')
|
||||
|
||||
const rootCss = document.querySelector(':root')
|
||||
|
||||
const rezygisk_state = document.getElementById('rezygisk_state')
|
||||
const rezygisk_settings = document.getElementById('rezygisk_settings')
|
||||
const rezygisk_icon_state = document.getElementById('rezygisk_icon_state')
|
||||
@@ -13,47 +17,74 @@ import { fullScreen, exec, toast } from './kernelsu.js';
|
||||
const code_version = document.getElementById('version_code')
|
||||
const root_impl = document.getElementById('root_impl')
|
||||
|
||||
const is_zygote32_injected = document.getElementById('is_zygote32_injected')
|
||||
const is_zygote64_injected = document.getElementById('is_zygote64_injected')
|
||||
const zygote64_div = document.getElementById('zygote64')
|
||||
const zygote32_div = document.getElementById('zygote32')
|
||||
|
||||
const daemon64_div = document.getElementById('daemon64')
|
||||
const daemon32_div = document.getElementById('daemon32')
|
||||
|
||||
const zygote32_status_div = document.getElementById('zygote32_status')
|
||||
const zygote64_status_div = document.getElementById('zygote64_status')
|
||||
|
||||
let zygote64_status = EXPECTED
|
||||
let zygote32_status = EXPECTED
|
||||
|
||||
const ptrace64Cmd = await exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 info')
|
||||
|
||||
if (ptrace64Cmd.errno === 0) {
|
||||
const lines = ptrace64Cmd.stdout.split('\n')
|
||||
|
||||
/* INFO: Root implementation and ReZygisk version parsing */
|
||||
code_version.innerHTML = lines[0].split('Tracer ')[1].split('-')[0]
|
||||
|
||||
root_impl.innerHTML = lines[4].split(': ')[1]
|
||||
|
||||
is_zygote64_injected.innerHTML = lines[5].split(': ')[1] === 'yes' ? 'Injected' : 'Not Injected'
|
||||
zygote64_status_div.innerHTML = lines[5].split(': ')[1] === 'yes' ? 'Injected' : 'Not Injected'
|
||||
|
||||
if (zygote64_status_div.innerHTML === 'Not Injected') zygote64_status = UNEXPECTED_FAIL
|
||||
} else if (ptrace64Cmd.stderr.includes('cannot execute binary file: Exec format error')) {
|
||||
zygote64_div.remove()
|
||||
daemon64_div.remove()
|
||||
} else {
|
||||
toast(`zygisk-ptrace64 error (${ptrace64Cmd.errno}): ${ptrace64Cmd.stderr}`)
|
||||
|
||||
zygote64_status = UNEXPECTED_FAIL
|
||||
}
|
||||
|
||||
const ptrace32Cmd = await exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace32 info')
|
||||
|
||||
if (ptrace32Cmd.errno === 0) {
|
||||
const lines32 = ptrace32Cmd.stdout.split('\n')
|
||||
const lines = ptrace32Cmd.stdout.split('\n')
|
||||
|
||||
is_zygote32_injected.innerHTML = lines32[5].split(': ')[1] === 'yes' ? 'Injected' : 'Not Injected'
|
||||
/* INFO: Root implementation and ReZygisk version parsing -- Necessary if 64-bit fails */
|
||||
code_version.innerHTML = lines[0].split('Tracer ')[1].split('-')[0]
|
||||
root_impl.innerHTML = lines[4].split(': ')[1]
|
||||
|
||||
zygote32_status_div.innerHTML = lines[5].split(': ')[1] === 'yes' ? 'Injected' : 'Not Injected'
|
||||
|
||||
if (zygote32_status_div.innerHTML === 'Not Injected') zygote32_status = UNEXPECTED_FAIL
|
||||
} else if (ptrace32Cmd.stderr.includes('not executable: 32-bit ELF file')) {
|
||||
zygote32_div.remove()
|
||||
daemon32_div.remove()
|
||||
} else {
|
||||
toast(`zygisk-ptrace32 error (${ptrace32Cmd.errno}): ${ptrace32Cmd.stderr}`)
|
||||
|
||||
zygote32_status = UNEXPECTED_FAIL
|
||||
}
|
||||
|
||||
if (is_zygote32_injected.innerHTML === 'Not Injected' && is_zygote64_injected.innerHTML === 'Not injected') {
|
||||
rezygisk_state.innerHTML = 'ReZygisk is not functioning!'
|
||||
} else if (is_zygote32_injected.innerHTML === 'Injected' && is_zygote64_injected.innerHTML === 'Injected') {
|
||||
if (zygote32_status === EXPECTED && zygote64_status === EXPECTED) {
|
||||
rezygisk_state.innerHTML = 'ReZygisk is fully functioning!'
|
||||
|
||||
rezygisk_settings.removeAttribute('style')
|
||||
rootCss.style.setProperty('--bright', '#3a4857')
|
||||
rezygisk_icon_state.innerHTML = '<img class="brightc" src="assets/tick.svg">'
|
||||
} else {
|
||||
} else if (zygote64_status === EXPECTED ^ zygote32_status.innerHTML === EXPECTED) {
|
||||
rezygisk_state.innerHTML = 'ReZygisk is partially functioning!'
|
||||
|
||||
rezygisk_settings.removeAttribute('style')
|
||||
rootCss.style.setProperty('--bright', '#766000')
|
||||
rezygisk_icon_state.innerHTML = '<img class="brightc" src="assets/warn.svg">'
|
||||
} else {
|
||||
rezygisk_state.innerHTML = 'ReZygisk is not functioning!'
|
||||
}
|
||||
|
||||
const modules_card = document.getElementById('modules_card')
|
||||
@@ -83,8 +114,8 @@ import { fullScreen, exec, toast } from './kernelsu.js';
|
||||
}
|
||||
|
||||
const bitsUsed = []
|
||||
if (lsZygiskCmd.stdout.split('\n').find((line) => [ 'armeabi-v7a.so', 'x86.so' ].includes(line))) bitsUsed.push('32 bit')
|
||||
if (lsZygiskCmd.stdout.split('\n').find((line) => [ 'arm64-v8a.so', 'x86_64.so' ].includes(line))) bitsUsed.push('64 bit')
|
||||
if (zygote32_status === EXPECTED && lsZygiskCmd.stdout.split('\n').find((line) => [ 'armeabi-v7a.so', 'x86.so' ].includes(line))) bitsUsed.push('32 bit')
|
||||
if (zygote64_status === EXPECTED && lsZygiskCmd.stdout.split('\n').find((line) => [ 'arm64-v8a.so', 'x86_64.so' ].includes(line))) bitsUsed.push('64 bit')
|
||||
|
||||
if (bitsUsed.length === 0) bitsUsed.push('N/A')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user