fix: unable to fetch security patch x2

#42
This commit is contained in:
KOWX712
2025-05-18 21:14:30 +08:00
parent 357289b558
commit 56afd639a4
5 changed files with 22 additions and 3 deletions
+1
View File
@@ -113,6 +113,7 @@
<string name="security_patch_fetching">Fetching...</string>
<string name="security_patch_fetched">Done</string>
<string name="security_patch_get_failed">Failed to fetch security patch date</string>
<string name="security_patch_unable_to_connect">Unable to connect to source.android.com</string>
<string name="security_patch_auto_success">Auto config enabled successfully</string>
<string name="security_patch_auto_failed">Failed to enable auto config</string>
<string name="security_patch_save_success">Security patch saved successfully</string>
+1
View File
@@ -113,6 +113,7 @@
<string name="security_patch_fetching">获取中...</string>
<string name="security_patch_fetched">完成</string>
<string name="security_patch_get_failed">获取安全补丁日期失败</string>
<string name="security_patch_unable_to_connect">无法连接至 source.android.com</string>
<string name="security_patch_auto_success">自动配置成功启用</string>
<string name="security_patch_auto_failed">无法启用自动配置</string>
<string name="security_patch_save_success">安全补丁成功保存</string>
+1
View File
@@ -113,6 +113,7 @@
<string name="security_patch_fetching">獲取中...</string>
<string name="security_patch_fetched">完成</string>
<string name="security_patch_get_failed">獲取安全補丁日期失敗</string>
<string name="security_patch_unable_to_connect">無法連線至 source.android.com</string>
<string name="security_patch_auto_success">自動配置成功啟用</string>
<string name="security_patch_auto_failed">無法啟用自動配置</string>
<string name="security_patch_save_success">安全補丁成功保存</string>
+8 -1
View File
@@ -314,7 +314,7 @@ export function securityPatch() {
getButton.addEventListener('click', async () => {
showPrompt('security_patch_fetching');
const output = spawn('sh', [`${basePath}/common/get_extra.sh`, '--get-security-patch'],
{ env: { PATH: "/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH" }});
{ cwd: "/data/local/tmp", env: { PATH: "/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH" }});
output.stdout.on('data', (data) => {
showPrompt('security_patch_fetched', true, 1000);
checkAdvanced(true);
@@ -324,6 +324,13 @@ export function securityPatch() {
bootPatchInput.value = data;
vendorPatchInput.value = data;
});
output.stderr.on('data', (data) => {
if (data.includes("failed")) {
showPrompt('security_patch_unable_to_connect', false);
} else {
console.error(data);
}
});
output.on('exit', (code) => {
if (code !== 0) showPrompt('security_patch_get_failed', false);
});