Skip to content

Commit

Permalink
Merge pull request #415 from WithSecureLabs/414-drozer-does-not-run-o…
Browse files Browse the repository at this point in the history
…n-android-6-marshmallow

Revert back to the old way of getting data dir on SDK < 24
  • Loading branch information
Yogehi committed Apr 2, 2024
2 parents 884496a + 8456245 commit c499043
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/drozer/console/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def __init__(self, server, session_id, arguments):
self.stderr = DecolouredStream(self.stderr)

m = Module(self)
if m.has_context():
if m.has_context() and self.reflector.resolve("android.os.Build$VERSION").SDK_INT >= 24:
dataDir = str(m.getContext().getDataDir().getCanonicalPath().native())
elif m.has_context():
dataDir = str(m.getContext().getApplicationInfo().dataDir)
else:
dataDir = str(m.new("java.io.File", ".").getCanonicalPath().native())
self.variables = { 'PATH': dataDir +'/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin',
Expand Down

0 comments on commit c499043

Please sign in to comment.