mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-05-29 04:50:13 +02:00
flash module: ignore META-INF
This commit is contained in:
parent
3414415907
commit
506961a10d
@ -47,20 +47,14 @@ open class FlashZip(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val isValid = try {
|
try {
|
||||||
zipFile.unzip(installDir, "META-INF/com/google/android", true)
|
val binary = File(installDir, "update-binary")
|
||||||
val script = File(installDir, "updater-script")
|
AppContext.assets.open("module_installer.sh").use { it.writeTo(binary) }
|
||||||
script.readText().contains("#MAGISK")
|
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
console.add("! Unzip error")
|
console.add("! Unzip error")
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isValid) {
|
|
||||||
console.add("! This zip is not a Magisk module!")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
console.add("- Installing ${mUri.displayName}")
|
console.add("- Installing ${mUri.displayName}")
|
||||||
|
|
||||||
return Shell.cmd("sh $installDir/update-binary dummy 1 \'$zipFile\'")
|
return Shell.cmd("sh $installDir/update-binary dummy 1 \'$zipFile\'")
|
||||||
|
@ -641,7 +641,7 @@ install_module() {
|
|||||||
|
|
||||||
# Extract prop file
|
# Extract prop file
|
||||||
unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2
|
unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2
|
||||||
[ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!"
|
[ ! -f $TMPDIR/module.prop ] && abort "! This zip is not a Magisk module!"
|
||||||
|
|
||||||
local MODDIRNAME=modules
|
local MODDIRNAME=modules
|
||||||
$BOOTMODE && MODDIRNAME=modules_update
|
$BOOTMODE && MODDIRNAME=modules_update
|
||||||
|
Loading…
x
Reference in New Issue
Block a user