Skip to content

Commit

Permalink
add parseResAXmlHandler to get raw content of xml
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbubble committed Jan 12, 2023
1 parent 4dc2bde commit dd44f56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ build/*
flowdroidAndSoot.src/*
out/
.vscode/
bin/*
bin/*
*.iml
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ object AndroidUtils {


fun parseResAXml(fileName: String): AXmlNode? {
return parseResAXmlHandler(fileName)?.document?.rootNode
}

fun parseResAXmlHandler(fileName: String): AXmlHandler? {
val apkF = File(apkAbsPath!!)
if (!apkF.exists()) {
Log.logDebug("file '$apkAbsPath' does not exist!")
Expand All @@ -515,8 +519,7 @@ object AndroidUtils {
val entryName = entry.name
if (entryName == fileName) {
archive.getInputStream(entry).use { inputStream ->
val handler = AXmlHandler(inputStream, AXML20Parser())
return handler.document.rootNode
return AXmlHandler(inputStream, AXML20Parser())
}
}
}
Expand Down

0 comments on commit dd44f56

Please sign in to comment.