Skip to content

Commit 00b507c

Browse files
committed
staging
1 parent 1ba9793 commit 00b507c

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

bbootimg/src/main/kotlin/avb/Avb.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class Avb {
206206
val readBackInfo = ObjectMapper().readValue(File(getJsonFileName(fileName)), AVBInfo::class.java)
207207
val intermediateDir = Helper.joinPath(Helper.prop("workDir")!!, "intermediate")
208208
val newHashDesc = if (File(intermediateDir).exists()) {
209-
AVBInfo.parseFrom(Dumpling(Helper.joinPath(intermediateDir, "$fileName.signed")))
209+
AVBInfo.parseFrom(Dumpling(Helper.joinPath(intermediateDir, File("$fileName.signed").name)))
210210
} else {
211211
//FIXME: before BootV2 supports abe mode
212212
AVBInfo.parseFrom(Dumpling("$fileName.signed"))

bbootimg/src/main/kotlin/rom/sparse/SparseImage.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ data class SparseImage(var info: SparseInfo = SparseInfo()) {
3434
partName,
3535
workDir,
3636
File(workDir, File(info.output).nameWithoutExtension).path,
37-
File(workDir, File(info.pulp).name + ".signed").path
37+
File(Helper.prop("intermediateDir"), File(info.pulp).name + ".signed").path
3838
)
3939
}
4040

@@ -44,7 +44,7 @@ data class SparseImage(var info: SparseInfo = SparseInfo()) {
4444
partName,
4545
workDir,
4646
File(workDir, File(info.output).nameWithoutExtension).path,
47-
File(workDir, "${info.output}.signed").path
47+
File(Helper.prop("intermediateDir"), "${info.output}.signed").path
4848
)
4949
}
5050

@@ -119,7 +119,7 @@ data class SparseImage(var info: SparseInfo = SparseInfo()) {
119119
if (info.outerFsType == "sparse") {
120120
img2simg(File(workDir, (File(info.output).name + ".signed")).path, File(info.output).name + ".signed")
121121
} else {
122-
val s = info.pulp + ".signed"
122+
val s = Helper.joinPath(Helper.prop("intermediateDir")!!, File(info.pulp + ".signed").name)
123123
val t = info.output + ".signed"
124124
log.info("Moving $s -> $t")
125125
Files.move(Path(s), Path(t), java.nio.file.StandardCopyOption.REPLACE_EXISTING)
@@ -261,7 +261,7 @@ data class SparseImage(var info: SparseInfo = SparseInfo()) {
261261
DefaultExecutor().apply {
262262
streamHandler = PumpStreamHandler(System.out, System.err)
263263
}.execute(CommandLine.parse("aosp/plugged/bin/sefcontext_compile").apply {
264-
addArguments("-o " + Helper.prop("workDir") + "file_contexts.bin")
264+
addArguments("-o " + File(Helper.prop("workDir"), "file_contexts.bin").path)
265265
addArgument("aosp/plugged/res/file_contexts.concat")
266266
}.also { log.warn(it.toString()) }, env)
267267
}

bbootimg/src/main/kotlin/rom/sparse/SparseImgParser.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,7 @@ class SparseImgParser : IPackable {
5959

6060
override fun pack(fileName: String) {
6161
//TODO("not implemented: refer to https://github.com/cfig/Android_boot_image_editor/issues/133")
62-
val cfgFile = outDir + fileName.removeSuffix(".img") + ".json"
63-
val readBackSi = ObjectMapper().readValue(File(cfgFile), SparseImage::class.java)
64-
readBackSi
65-
.pack()
66-
.updateVbmeta()
67-
.unwrap()
62+
packInternal(Helper.prop("workDir")!!, fileName)
6863
}
6964

7065
fun packInternal(workspace: String, outFileName: String) {
@@ -83,6 +78,11 @@ class SparseImgParser : IPackable {
8378
val iniRole = Common.loadProperties(File(workspace, "workspace.ini").canonicalPath).getProperty("role")
8479
val cfgFile = File(workspace, iniRole.removeSuffix(".img") + ".json").canonicalPath
8580
log.info("Loading config from $cfgFile")
81+
val readBackSi = ObjectMapper().readValue(File(cfgFile), SparseImage::class.java)
82+
readBackSi
83+
.pack()
84+
.updateVbmeta()
85+
.unwrap()
8686
}
8787

8888
// invoked solely by reflection

0 commit comments

Comments
 (0)