Erase apdp on Qualcomm devices

This commit is contained in:
flawedworld 2021-12-17 19:29:36 +00:00 committed by Daniel Micay
parent 09ab263605
commit 079743da1a

View File

@ -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;
}