Skip to content

Commit

Permalink
Fix code formatting
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Oct 1, 2022
1 parent 0cfa7e9 commit 60d6a94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
Expand Up @@ -115,7 +115,8 @@ public ResTable_lib_entry asResTable_lib_entry() {
if (header_size() >= ResTable_lib_entry.SIZEOF) {
return new ResTable_lib_entry(device_chunk_.myBuf(), device_chunk_.myOffset());
} else if (header_size() > 0) {
return new ResTable_lib_entry(device_chunk_.myBuf(), device_chunk_.myOffset() + header_size());
return new ResTable_lib_entry(
device_chunk_.myBuf(), device_chunk_.myOffset() + header_size());
} else {
return null;
}
Expand Down
Expand Up @@ -725,11 +725,11 @@ static LoadedPackage Load(Chunk chunk,
// reinterpret_cast<ResTable_lib_entry*>(child_chunk.data_ptr());
ResTable_lib_entry entry_begin =
child_chunk.asResTable_lib_entry();
// ResTable_lib_entry entry_end = entry_begin + dtohl(lib.count);
// for (auto entry_iter = entry_begin; entry_iter != entry_end; ++entry_iter) {
for (ResTable_lib_entry entry_iter = entry_begin;
entry_iter.myOffset() != entry_begin.myOffset() + dtohl(lib.count) * ResTable_lib_entry.SIZEOF;
) {
// ResTable_lib_entry entry_end = entry_begin + dtohl(lib.count);
// for (auto entry_iter = entry_begin; entry_iter != entry_end; ++entry_iter) {
for (ResTable_lib_entry entry_iter = entry_begin;
entry_iter.myOffset()
!= entry_begin.myOffset() + dtohl(lib.count) * ResTable_lib_entry.SIZEOF; ) {
String package_name =
Util.ReadUtf16StringFromDevice(entry_iter.packageName,
entry_iter.packageName.length);
Expand All @@ -745,12 +745,14 @@ static LoadedPackage Load(Chunk chunk,
// dtohl(entry_iter.packageId));
loaded_package.dynamic_package_map_.add(new DynamicPackageEntry(package_name,
dtohl(entry_iter.packageId)));
try {
entry_iter = new ResTable_lib_entry(entry_iter.myBuf(), entry_iter.myOffset() + ResTable_lib_entry.SIZEOF);
} catch (Exception e) {
try {
entry_iter =
new ResTable_lib_entry(
entry_iter.myBuf(), entry_iter.myOffset() + ResTable_lib_entry.SIZEOF);
} catch (Exception e) {
System.err.println("failed to create new entry " + e.getMessage());
break;
}
}
}

} break;
Expand Down
Expand Up @@ -45,15 +45,15 @@ public static Package callParsePackage(Path apkFile) {
if (RuntimeEnvironment.getApiLevel() >= Build.VERSION_CODES.Q) {
QHelper.setCallback(packageParser);
}
//thePackage = packageParser.parsePackage(apkFile.toFile(), flags);
// thePackage = packageParser.parsePackage(apkFile.toFile(), flags);
thePackage = packageParser.parsePackage(apkFile.toFile().getParentFile(), flags);
System.out.println("Package : " + thePackage.toString());
System.out.println(" code : " + thePackage.baseCodePath);
for (int i = 0; i < thePackage.splitNames.length; i++) {
String splits = thePackage.splitNames[i];
String codepath = thePackage.splitCodePaths[i];
System.out.println("Split Package : " + splits);
System.out.println("Split code : " + codepath);
String splits = thePackage.splitNames[i];
String codepath = thePackage.splitCodePaths[i];
System.out.println("Split Package : " + splits);
System.out.println("Split code : " + codepath);
}
} else { // JB -> KK
thePackage =
Expand Down

0 comments on commit 60d6a94

Please sign in to comment.