Skip to content

Commit

Permalink
Fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
j005u committed May 9, 2023
2 parents defe680 + bf7c9d9 commit f8d9330
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 68 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
tmp/
dist/
dist/
67 changes: 0 additions & 67 deletions src/exploit.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,73 +296,6 @@ async function lock(path) {

}

async function hardlock(path) {

console.log("This will reset secure_debug and dm_verity. Make sure you are in stock state or use butter to reflash if not. Type 'yes' to confirm?")
return confirm()
.then(() => {
return identifyDevice(path)
/*.then(() => {
console.log("sending flash command for first slot")
return shell(`
umount /proc/cmdline || true
update_engine --update_package=/cache/ota.zip
reboot`)
})
.then(() => {
console.log("waiting 2 minutes (30 seconds spare on just flash v2 goggles) for the flash to complete")
return sleep(120000)
})
.then(() => {
port = new SerialPort({path: portPath, baudRate})
})
.then(() => {
console.log("sending flash command for second slot")
return shell(`
umount /proc/cmdline || true
update_engine --update_package=/cache/ota.zip
reboot`)
})
.then(() => {
console.log("waiting 2 minutes (30 seconds spare on just flash v2 goggles) for the flash to complete")
return sleep(120000)
})
.then(() => {
port = new SerialPort({path: portPath, baudRate})
})*/
.then(patch)
.then(()=> {
const config = configs[device].debug
config.data = Buffer.from("00000E00AF5C5F2800295F2FAF4849444A490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF0000000000000000000000880AEE0E01D4E85374710961DECE84176BF1F91800000000000000000000000000000000000000000000000000000000", "hex")
/*
if(result.data[6] === 0x0e) {
offset = 1
}
//newer devices are et 5
else if(result.data[5] === 0x0e) {
offset = 0
}
*/
//config.data = Uint8Array.from(Buffer.from("00000E00AF5C5F2800295F2FAF4849444A490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF0000000000000000000000880AEE0E01D4E85374710961DECE84176BF1F91800000000000000000000000000000000000000000000000000000000", "hex"))
return talk(port, config, false)
.then((result) => {
console.log(result)
port.close()
console.log("hardlock should be done, power cycle your device")
console.log("you can use 'shell reboot' and verify nothing happens")
console.log("you should get:")
console.log("harry, i'm sorry, you're not a wizard")
process.exit(0)
})
})
.catch((error)=> {
console.log(error)
process.exit(1)
})
})

}


function makeShellPayload(script) {
//console.log("executing", script)
Expand Down

3 comments on commit f8d9330

@LeoniePhiline
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j005u module.exports.hardlock = hardlock errors, as hardlock is now undefined.

@j005u
Copy link
Contributor Author

@j005u j005u commented on f8d9330 Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't realize this was causing errors, I wonder if we're running different node versions? Generally assigning undefined values should be fine, it's accessing props on them when you get into trouble.

In any case pushed a fix, this was originally ever only published in error. You should not use hardlock, it could lead to bootloops and other nastyness.

@LeoniePhiline
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had been using node20.

Please sign in to comment.