microsoftconnect / intune-app-wrapping-tool-android

Use the Intune App Wrapping Tool for Android to enable Android apps to be managed by Microsoft Intune
28 stars 11 forks source link

Latest APK wrap gives an invalid apk file. #95

Closed E-N-G-XOR closed 5 months ago

E-N-G-XOR commented 6 months ago

Questions to Ask Before Submission

  1. Does you app launch successfully without wrapping? YES
  2. Have you reviewed the prerequisites for App Wrapping? YES
  3. Does your issue have a solution in the Troubleshooting Guide? NO
  4. Have you checked the Microsoft Intune App SDK for Android repository for similar issues? YES
  5. Are you using the latest version of the App Wrapper? YES

Describe the bug: A clear and concise description of what the bug is. intunes says the app is successfully wrapped, but it is not. I have an apk I cannot use.

The package name for this app is 'app_name'. If you need to specify the package name during deployment, please use this one.
The application was successfully wrapped.
Please zipalign and sign the application before use.

To Reproduce Steps to reproduce the behavior:

  1. simply install the latest tooling from git.
  2. import the module
  3. invoke-AppWrappingTool -InputPath .\in.apk -OutputPath .\out.apk -Verbose | Tee-Object -FilePath .\wrap.log

Expected behavior: A clear and concise description of what you expected to happen.

app to launch and work as per pre-wrapping

Screenshots and logs:

Smartphone (please complete the following information):

Intune app wrapping tool (please complete the following information):

Additional context: wrap.log

Add any other context about the problem here.

Log says the app is successfully wrapped, but the app will not install on devices... Error attached. log

E-N-G-XOR commented 6 months ago

Missing attachments

sabaricod commented 5 months ago

did you found any fix @E-N-G-XOR

E-N-G-XOR commented 5 months ago

Hi,

Not yet. The Microsoft guys think it has to with the fact that it is a self-signed cert.

The tests continue...

Ta, X

On Fri, 12 Jan 2024, 17:06 sabaricod, @.***> wrote:

did you found any fix @E-N-G-XOR https://github.com/E-N-G-XOR

— Reply to this email directly, view it on GitHub https://github.com/msintuneappsdk/intune-app-wrapping-tool-android/issues/95#issuecomment-1889150459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGPQSQOMMP7UBINBAROLXP3YOEYNTAVCNFSM6AAAAABBTH4TZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGE2TANBVHE . You are receiving this because you were mentioned.Message ID: <msintuneappsdk/intune-app-wrapping-tool-android/issues/95/1889150459@ github.com>

rygo-msft commented 5 months ago

@E-N-G-XOR please see: https://github.com/msintuneappsdk/intune-app-wrapping-tool-android/wiki/Troubleshooting-the-App-Wrapper#issues-during-app-installation

If this does not resolve your issue, please share logcat logs capturing the failed installation or details about what issues your see from your wrapped apk.

E-N-G-XOR commented 5 months ago

So, found the solution...

The problem is with the apk file.

So, once the apk file is signed and intune wrapped.

We then have to zipalign and re-sign the apk (again) with with any self-signed cert located in a keystore file with apksigner.

I used android studio to generate a dumpy keystore file and signed the second time with that.

And we are business...

On Tue, 16 Jan 2024, 20:24 Ryan Gormley, @.***> wrote:

@E-N-G-XOR https://github.com/E-N-G-XOR please see: https://github.com/msintuneappsdk/intune-app-wrapping-tool-android/wiki/Troubleshooting-the-App-Wrapper#issues-during-app-installation

If this does not resolve your issue, please share logcat logs capturing the failed installation or details about what issues your see from your wrapped apk.

— Reply to this email directly, view it on GitHub https://github.com/msintuneappsdk/intune-app-wrapping-tool-android/issues/95#issuecomment-1894082304, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGPQSQO6R2I4HP3NCHSINMDYO2SVDAVCNFSM6AAAAABBTH4TZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUGA4DEMZQGQ . You are receiving this because you were mentioned.Message ID: <msintuneappsdk/intune-app-wrapping-tool-android/issues/95/1894082304@ github.com>

rygo-msft commented 5 months ago

To clarify, any modification to app file will break app signing (it wouldn't be a very good signature if it didn't detect modification). As such, all apk files created by the wrapper will be unsigned and must be zip-aligned and signed before use.

You do not need to sign apks with multiple keys, but signing must be the last modification to an app for the signature to be valid.