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

manifest file not found #55

Closed fff1604 closed 2 years ago

fff1604 commented 2 years ago

Describe the bug: The wrapping tool does not find the manifest file of the apk, although it is included in the input.apk.

To Reproduce I performed following steps on a Windows 10, XPS 15 9550 Dell laptop inside the PowerShell:

  1. Zipaling apk: zipalign 4 input.apk zipaligned.apk
  2. Sign apk: apksigner sign -ks keystore.jks -v -out signed.apk --min-sdk-version 23 zipaligned.apk
  3. Wrap apk (with AWT):
    Import-Module .\IntuneAppWrappingTool.psm1
    $pw = ConvertTo-SecureString "thekeystorepassword" -AsPlainText -Force   
    Invoke-AppWrappingTool signed.apk wrapped.apk -KeyStorePath keystore.jks -KeyStorePassword $pw -KeyAlias "keyname" -KeyPassword $pw
  4. Following error message appears:
    Failed to package app. [...] 
    AppPackagerException: Failed to copy file from 
    [...]AppData\Local\Temp\IntuneAppWrappingTool-4378829391173829931\sourceApk\AndroidManifest.xml 
    to [...]AppData\Local\Temp\IntuneAppWrappingTool-4378829391173829931\sourceApk\original\META_INF\AWT_BACKUP\AndroidManifest.xml 
    [...] FileNotFoundException

I checked the singed.apk (the input apk for awt) and it has a manifest file included. The wrapping of the android app worked just fine with a previous version of awt a year ago.

Expected behavior: The app should be correctly wrapped by the AWT.

Screenshots and logs: See the steps to reproduce section above.

Program / platform versions

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

fff1604 commented 2 years ago

I made further investigations:

  1. I tried to wrap my app with an older version of AWT (1.0.2963.3) from around the time, when I was able to wrap my app successfully the last time. But I got the same error with the old version as well.
  2. Then I tried to wrap the app on another pc, because I was currious, if maybe some operating system settings were making troubles. But also there I got errors. The specs from the my other pc: Gigabyte Aero 15, Win 10 64-Bit 20H2, Java version: 17.0.2, android targetsdk and compilesdk 30, Powershell version: 5.1.19041.1320, AWT version 1.0.3401.4

Maybe there was a Window update since last year, that causes the bug? The last time I could wrap my app successfully with AWT was 29.01.2021.

fff1604 commented 2 years ago

See the log file of one of my wrapping attempts (with the old version 1.0.2963.3): IntuneAppWrappingToolLog_20220128_115134_Anonymized.txt

codylund commented 2 years ago

Hi @fff1604, thanks for your report! This error is a bit perplexing. At this point in the wrapping process, we assume that this file will be present and in the same location for any input APK. I'm not aware of any automated Windows processes that would delete temp files out from under our program. I also don't think it is possible to build an APK without AndroidManifest.xml.

A couple follow up questions to help move the investigation forward:

  1. Is it possible for you to share the problematic APK file or a sample Android APK that also reproduces the issue?
  2. Does this issue reproduce on your machine with other APKs? Can you successfully wrap this APK on a different machine?
  3. What happens if you don't align/sign the APK before using AWT? I want to rule out the possibility of those tools corrupting the input APK.
meghandaly commented 2 years ago

@fff1604 Are you still experiencing this issue? If so, can you provide us with the information Cody requested? If not, can you relay to us what caused the issue to be mitigated?

meghandaly commented 2 years ago

Closing because our team has not received additional information within the last 30 days and the issue is not actionable.

If you are still experiencing this issue, please provide the requested information and reopen the issue.