From 079743da1af63aa977d7d2b63996850521b96d5a Mon Sep 17 00:00:00 2001 From: flawedworld Date: Fri, 17 Dec 2021 19:29:36 +0000 Subject: [PATCH] Erase apdp on Qualcomm devices --- static/js/web-install.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/js/web-install.js b/static/js/web-install.js index 40d2ad98..556665a6 100644 --- a/static/js/web-install.js +++ b/static/js/web-install.js @@ -142,6 +142,8 @@ async function unlockBootloader(setProgress) { const supportedDevices = ["raven", "oriole", "barbet", "redfin", "bramble", "sunfish", "coral", "flame", "bonito", "sargo", "crosshatch", "blueline"]; +const qualcommDevices = ["barbet", "redfin", "bramble", "sunfish", "coral", "flame", "bonito", "sargo", "crosshatch", "blueline"]; + async function getLatestRelease() { let product = await device.getVariable("product"); if (!supportedDevices.includes(product)) { @@ -197,6 +199,8 @@ async function reconnectCallback() { async function flashRelease(setProgress) { await ensureConnected(setProgress); + let product = await device.getVariable("product"); + // Need to do this again because the user may not have clicked download if // it was cached setProgress("Finding latest release..."); @@ -221,6 +225,12 @@ async function flashRelease(setProgress) { // See https://android.googlesource.com/platform/system/core/+/eclair-release/fastboot/fastboot.c#532 // for context as to why the trailing space is needed. await device.runCommand("oem uart disable "); + if (qualcommDevices.includes(product)) { + setProgress("Erasing apdp..."); + // Both slots are wiped as even apdp on an inactive slot will modify /proc/cmdline + await device.runCommand("erase:apdp_a"); + await device.runCommand("erase:apdp_b"); + } } finally { safeToLeave = true; }