-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse additional dex files created in uncommon way #66
base: main
Are you sure you want to change the base?
Conversation
crazyformat
commented
May 26, 2021
…for multidex. It is packing additional dex files not as classesX.dex but as a pack of .jar files in assets/secondary-program-dex-jars. This diff adds support for this approach allowing parsing of these files along with common classesX.dex. Minors: - no need to print non-unique test names. This should not happen in common but some apks somehow have it - filter out common example test name "testFoo"
…nging it to a more explicit `endsWith`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the buck behavior documented anywhere so that we can reference it? Having a reference to the output format would be good to document
it.name.endsWith(".dex") | ||
} | ||
.map{ zip.readBytes() } | ||
.first() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused why this is only the first - isn't the goal to supoprt multidex by putting the extra dex filess inside this jar?
@@ -65,7 +65,7 @@ private fun findJUnit3Tests(dexFiles: List<DexFile>, testNames: MutableSet<TestM | |||
private fun DexFile.findJUnit3Tests(descriptors: MutableSet<String>): List<TestMethod> { | |||
val testClasses = findClassesWithSuperClass(descriptors) | |||
return createTestMethods(testClasses, { classDef, _ -> findMethodIds(classDef) }) | |||
.filter { it.testName.contains("#test") } | |||
.filter { it.testName.contains("#test") and !it.testName.endsWith("#testFoo") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a strange behavior to bake into a library - I imagine your code may use testFoo as a fake test, but from the libraries perspective (as well ass junit afaik) it is a valid test, so I'm not ure we should be making assumptions about intention. Thoughts?
Thanks for looking into this. All together, I don't think we should move on with this pull-request. By the end of the day I had to move away from dex-test-parser because in some cases it is still not able to find all the instrumentation tests in the APK, there is just no evidence of some test methods in any of dex files. Apparently, we have some in-flight generated test methods. |