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

AppDataDirGuesses incorrectly guesses data directory for secondary Android users #128

Closed
mahuna13 opened this issue Dec 3, 2018 · 0 comments

Comments

@mahuna13
Copy link
Contributor

mahuna13 commented Dec 3, 2018

"/data/data" directory is a data directory for user 0. If there are multiple users on the device, each will have a separate data dir indicated by their user id in "/data/user/[user_id]" i.e.
"/data/user/0" -> "data/data" (user 0 directory)
"/data/user/10" (user 10 directory)

When we run a test in a secondary user (like user 10), AppDataDirGuesser.guess() will return null, and the test will fail unless "dexmaker.dexcache" has been explicitly specified.

To fix this:

  • We would need to guess the ID of the user running the test. This can be fetched through android APIs, like android.os.Process, but dexmaker doesn't depend on the android library.
  • Try to find a directory by iterating over possible user IDs, capping at some reasonable maximum. This is hacky and limited, but might be the only option if we can't depend on android
mahuna13 added a commit to mahuna13/dexmaker that referenced this issue Dec 4, 2018
Correctly guesses data directory when running in secondary users (user ID >= 10) in Android.
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

No branches or pull requests

1 participant