mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-18 23:56:13 -08:00
Compare commits
1 Commits
aviraxp-pa
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bbc736051 |
@@ -46,11 +46,25 @@ class MagiskPlugin : Plugin<Project> {
|
||||
private fun Project.applyPlugin() {
|
||||
initRandom(rootProject.file("dict.txt"))
|
||||
props.clear()
|
||||
rootProject.file("gradle.properties").inputStream().use { props.load(it) }
|
||||
|
||||
// Get gradle properties relevant to Magisk
|
||||
props.putAll(properties.filter { (key, _) -> key.startsWith("magisk.") })
|
||||
|
||||
// Load config.prop
|
||||
val configPath: String? by this
|
||||
val config = rootFile(configPath ?: "config.prop")
|
||||
if (config.exists())
|
||||
config.inputStream().use { props.load(it) }
|
||||
val configFile = rootFile(configPath ?: "config.prop")
|
||||
if (configFile.exists()) {
|
||||
configFile.inputStream().use {
|
||||
val config = Properties()
|
||||
config.load(it)
|
||||
// Remove properties that should be passed by commandline
|
||||
config.remove("abiList")
|
||||
props.putAll(config)
|
||||
}
|
||||
}
|
||||
|
||||
// Commandline override
|
||||
findProperty("abiList")?.let { props.put("abiList", it) }
|
||||
|
||||
val repo = FileRepository(rootFile(".git"))
|
||||
val refId = repo.refDatabase.exactRef("HEAD").objectId
|
||||
|
||||
1
build.py
1
build.py
@@ -406,6 +406,7 @@ def build_apk(module: str):
|
||||
gradlew,
|
||||
f"{module}:assemble{build_type}",
|
||||
f"-PconfigPath={props}",
|
||||
f"-PabiList={','.join(build_abis.keys())}",
|
||||
],
|
||||
env=env,
|
||||
)
|
||||
|
||||
@@ -292,7 +292,7 @@ static int find_dtb_offset(const uint8_t *buf, unsigned sz) {
|
||||
auto fdt_hdr = reinterpret_cast<const fdt_header *>(curr);
|
||||
|
||||
// Check that fdt_header.totalsize does not overflow kernel image size or is empty dtb
|
||||
// https://github.com/torvalds/linux/commit/7b937cc243e5b1df8780a0aa743ce800df6c68d1
|
||||
// https://github.com/torvalds/linux/commit/7b937cc243e5b1df8780a0aa743ce800df6c68d1
|
||||
uint32_t totalsize = fdt_hdr->totalsize;
|
||||
if (totalsize > end - curr || totalsize <= 0x48)
|
||||
continue;
|
||||
@@ -913,6 +913,8 @@ void repack(Utf8CStr src_img, Utf8CStr out_img, bool skip_comp) {
|
||||
file_align();
|
||||
}
|
||||
|
||||
off.tail = lseek(fd, 0, SEEK_CUR);
|
||||
|
||||
// Proprietary stuffs
|
||||
if (boot.flags[SEANDROID_FLAG]) {
|
||||
xwrite(fd, SEANDROID_MAGIC, 16);
|
||||
@@ -923,7 +925,6 @@ void repack(Utf8CStr src_img, Utf8CStr out_img, bool skip_comp) {
|
||||
xwrite(fd, LG_BUMP_MAGIC, 16);
|
||||
}
|
||||
|
||||
off.tail = lseek(fd, 0, SEEK_CUR);
|
||||
file_align();
|
||||
|
||||
// vbmeta
|
||||
|
||||
Reference in New Issue
Block a user