-
Notifications
You must be signed in to change notification settings - Fork 276
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
Fix android open link verify #1999
Changes from all commits
dc402ca
b02ed01
1d7a1c7
a6437ef
3f3d53e
f374da2
eed7d93
54a6057
7cf65a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,11 +38,15 @@ object AndroidAppFiles { | |
} | ||
|
||
fun getApkFile(dadb: Dadb, appId: String): File { | ||
val apkPath = dadb.shell("pm list packages -f --user 0 | grep $appId | head -1") | ||
.output.substringAfterLast("package:").substringBefore("=$appId") | ||
apkPath.substringBefore("=$appId") | ||
val apkPath = dadb.shell("pm path $appId").output.removePrefix("package:").trim() | ||
val dst = File.createTempFile("tmp", ".apk") | ||
dadb.pull(dst, apkPath) | ||
try { | ||
dadb.pull(dst, apkPath) | ||
} catch (e: IOException) { | ||
val newApkPath = "/sdcard/$appId.apk" | ||
dadb.shell("cp $apkPath $newApkPath") | ||
dadb.pull(dst, newApkPath) | ||
} | ||
Comment on lines
+43
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? I'm curious to learn why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See this SO answer for example If we add multi-API-level testing on the CI, we should add simple tests for |
||
return dst | ||
} | ||
|
||
|
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.
Nice! Thanks for making it shorter.