Skip to content

Commit

Permalink
Fix PackageParser
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
Signed-off-by: YOUNG HO CHA <ganachoco@linecorp.com>
  • Loading branch information
ganadist authored and utzcoz committed Oct 22, 2023
1 parent b0c04e9 commit 3ac18e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Expand Up @@ -116,6 +116,9 @@ public ResTable_lib_header asResTable_lib_header() {
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());
} else {
return null;
}
Expand Down
Expand Up @@ -44,7 +44,16 @@ public static Package callParsePackage(Path apkFile) {
if (RuntimeEnvironment.getApiLevel() >= Build.VERSION_CODES.Q) {
QHelper.setCallback(packageParser);
}
thePackage = packageParser.parsePackage(apkFile.toFile(), 0);
// thePackage = packageParser.parsePackage(apkFile.toFile(), flags);
thePackage = packageParser.parsePackage(apkFile.toFile().getParentFile(), 0);
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);
}
} else { // JB -> KK
thePackage =
reflector(_PackageParser_.class, packageParser)
Expand Down

0 comments on commit 3ac18e4

Please sign in to comment.