Skip to content
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

guessPath not to depend on the first level of app directory #156

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

ttanxu
Copy link
Contributor

@ttanxu ttanxu commented Jan 24, 2020

We are updating apps' apk path to have a two-level structure.

Default apk path of an installed app:
Before: /data/app/[packageName]-[randomString]/base.apk
After: /data/app/[randomStringA]/[packageName]-[randomStringB]/base.apk

This CL fixes the path guessing assumption the apk dir is only one level
below the /data/app dir.

Fixes #155.

@ttanxu
Copy link
Contributor Author

ttanxu commented Jan 24, 2020

One of Google employees sent out this patch for the fork in AOSP so I sent out this for review as well. Note the author also updated existing cases to match the most recently released Android version, and added new test cases for the new case.

We are updating apps' apk path to have a two-level structure.

Default apk path of an installed app:
Before: /data/app/[packageName]-[randomString]/base.apk
After: /data/app/[randomStringA]/[packageName]-[randomStringB]/base.apk

This CL fixes the path guessing assumption the apk dir is only one level
below the /data/app dir.

Fixes linkedin#155.
@ttanxu
Copy link
Contributor Author

ttanxu commented Jan 28, 2020

Updated this PR. We found a bug in the previous version that didn't consider the case where there is dash in the random string.

@@ -136,20 +136,31 @@ private static String processClassLoaderString43OrLater(String input) {

File[] guessPath(String input) {
List<File> results = new ArrayList<>();
String apkPathRoot = "/data/app/";
for (String potential : splitPathList(input)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if we include the example path /data/app/[randomStringA]/[packageName]-[randomStringB]/base.apk as a comment.

@chao2zhang chao2zhang merged commit 1bb921e into linkedin:master Feb 26, 2020
chao2zhang pushed a commit to chao2zhang/dexmaker that referenced this pull request Jun 2, 2020
drewhannay pushed a commit that referenced this pull request Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update AppDataDirGuesser#guessPath() for new app location
3 participants