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

[android] Add warning message when Android devices have package verification enabled #1291

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

ivanpovazan
Copy link
Member

@ivanpovazan ivanpovazan commented Oct 9, 2024

Description

This PR adds functionality to check if a physical Android device is configured to correctly to allow debug APK installs.
Additionally, it prints out warning messages in cases the package verifier is not properly disabled which can lead to INSTALL_FAILED_VERIFICATION_FAILURE errors.

Follow-up work

@ivanpovazan
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ivanpovazan ivanpovazan changed the title [NO-MERGE] WIP: Fix installing dbg apks [android] Disable package verification to enable testing debug APKs Oct 9, 2024
@ivanpovazan
Copy link
Member Author

@ivanpovazan ivanpovazan changed the title [android] Disable package verification to enable testing debug APKs [android] Add warning message when Android devices have package verification enabled Oct 10, 2024
@ivanpovazan
Copy link
Member Author

We now generate the following log and warning messages in cases package verifier is not properly disabled:

[04:11:34] dbug: Check current adb install and/or package verification settings
[04:11:34] dbug: Executing command: 'D:\h\w\9C86086D\p\microsoft.dotnet.xharness.cli\10.0.0-ci\runtimes\any\native\adb\windows\adb.exe -s 26091FDF60024Q shell settings get global verifier_verify_adb_installs'
[04:11:34] dbug: verifier_verify_adb_installs = 
[04:11:34] warn: Installing debug apks on a device might be rejected with INSTALL_FAILED_VERIFICATION_FAILURE. Make sure to set 'verifier_verify_adb_installs' to '0'
[04:11:34] dbug: Executing command: 'D:\h\w\9C86086D\p\microsoft.dotnet.xharness.cli\10.0.0-ci\runtimes\any\native\adb\windows\adb.exe -s 26091FDF60024Q shell settings get global package_verifier_enable'
[04:11:34] dbug: package_verifier_enable = 
[04:11:34] warn: Installing debug apks on a device might be rejected with INSTALL_FAILED_VERIFICATION_FAILURE. Make sure to set 'package_verifier_enable' to '0'

Relevant log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-xharness-refs-pull-1291-merge-cc92462c3409498299/System.Buffers.Tests-arm64-v8a.Attempt.3/1/console.9f873a78.log?helixlogtype=result

This reverts commit d3250c7.
@ivanpovazan ivanpovazan marked this pull request as ready for review October 10, 2024 11:33
Copy link
Member

@matouskozak matouskozak left a comment

Choose a reason for hiding this comment

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

Neat work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Android area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants