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

BuildToolCLI strips META-INF from jars #178

Open
nikita-island opened this issue Aug 28, 2023 · 4 comments
Open

BuildToolCLI strips META-INF from jars #178

nikita-island opened this issue Aug 28, 2023 · 4 comments
Labels
Backlog Issue is in the backlog to be worked at an indeterminate future time. Bug

Comments

@nikita-island
Copy link

Questions to Ask Before Submission

  1. Does your app compile and launch successfully without the Intune App SDK? Yes
  2. Have you checked the [Microsoft Intune App SDK for Android] repository for similar issues? Yes
  3. Are you using the latest version of the [SDK and Plugin]? Yes

Summary

When processing .jars with BuildToolCLI, the tool removes META-INF from the output .jar.
This creates various problems. For example, some .jars contain embedded proguard config META-INF/com.android.tools/r8/*, and stripping them causes compilation errors.

Example of a public .jar where proguard config gets stripped: org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4

Note that when the --input is a directory rather than a .jar, BuildToolCLI copies META-INF correctly.

Details

  • Intune Android App SDK Version: 9.7.0
  • Gradle Version: N/A, this is standalone BuildToolCLI
  • AGP Version: N/A, this is standalone BuildToolCLI
  • Operating System (Mac, Linux, Windows) and Version: Linux (Fedora 37)
  • Android Studio Version: N/A, this is standalone BuildToolCLI

Logs

Android Studio / Gradle Logs

N/A, no gradle or Android Studio. This is standalone BuildToolCLI.
It doesn't print any errors, rewrite completes successfully. Downstream dex-ing fails with the rewritten .jars.

Gradle Build Plugin Report Logs

N/A, no gradle or Android Studio. This is standalone BuildToolCLI.
It doesn't print any errors, rewrite completes successfully. Downstream dex-ing fails with the rewritten .jars.

@boyzhang-msft
Copy link

Hi @nikita-island , thanks for reporting this issue. We have created a bug (ADO# 25068431) internally to track. I'd like to ask a few clarification questions please:

  • Is your app a native Android app? Or is it built with some other frameworks like Xamarin?
  • Does it work when you put the jar file in a directory, and provide the directory as --input?

@nikita-island
Copy link
Author

@boyzhang-msft:

  • Is your app a native Android app? Or is it built with some other frameworks like Xamarin?

Yes, it's a native app (with a custom build system that doesn't use Gradle)

  • Does it work when you put the jar file in a directory, and provide the directory as --input?

Yes, as I mentioned in the issue, using an extracted .jar works correctly.

@nikita-island
Copy link
Author

@boyzhang-msft Hi, any updates on this issue?

@boyzhang-msft
Copy link

@nikita-island , we do not have an ETA yet. I'll keep you posted here once we made progress. Sorry about the delay!

@bannus bannus added the Backlog Issue is in the backlog to be worked at an indeterminate future time. label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Issue is in the backlog to be worked at an indeterminate future time. Bug
Projects
None yet
Development

No branches or pull requests

3 participants