nikhilbadyal / docker-py-revanced

One Click Python util to build all Revanced apps.
https://nikhilbadyal.github.io/docker-py-revanced/
GNU General Public License v3.0
555 stars 430 forks source link

Failed to determine APK's minimum supported Android platform version #555

Open KnifeFed opened 2 weeks ago

KnifeFed commented 2 weeks ago

Request guidelines

Name

Infinity

Error log or link to the logs if using Github Action

$ docker run --rm \
         --pull='always' \
         -v "/mnt/cache/appdata/docker-py-revanced/apks:/app/apks/" \
         --env-file "/mnt/cache/appdata/docker-py-revanced/revanced.env" \
         nikhilbadyal/docker-py-revanced
latest: Pulling from nikhilbadyal/docker-py-revanced
Digest: sha256:cc44c17916016fd26772e5226cdd16d2d392ef03a952e0d36eaa8f8702814a52
Status: Image is up to date for nikhilbadyal/docker-py-revanced:latest
2024-09-06 21:33:27.686 | DEBUG    | src.downloader.github:_get_release_assets:97 - Found APKEditor-1.3.9.jar to be downloaded from https://github.com/REAndroid/APKEditor/releases/download/V1.3.9/APKEditor-1.3.9.jar
2024-09-06 21:33:27.686 | DEBUG    | src.downloader.download:_download:33 - Skipping download of apkeditor-output.jar from https://github.com/REAndroid/APKEditor/releases/download/V1.3.9/APKEditor-1.3.9.jar. File already exists or dry running.
2024-09-06 21:33:27.763 | DEBUG    | src.utils:check_java:212 - Cool!! Java is available
2024-09-06 21:33:27.966 | INFO     | __main__:main:36 - Will Patch only ['infinity']
2024-09-06 21:33:27.966 | INFO     | __main__:main:38 - Trying to build infinity
2024-09-06 21:33:27.967 | INFO     | src.app:download_patch_resources:148 - Downloading resources for patching.
2024-09-06 21:33:28.242 | DEBUG    | src.downloader.github:_get_release_assets:97 - Found revanced-integrations-1.13.0.apk to be downloaded from https://github.com/ReVanced/revanced-integrations/releases/download/v1.13.0/revanced-integrations-1.13.0.apk
2024-09-06 21:33:28.243 | DEBUG    | src.downloader.download:_download:33 - Skipping download of c0b33a97c2b0236c24e0f77bad44f0cdfc3f03d738224ecd4e1434d84dcfc055.apk from https://github.com/ReVanced/revanced-integrations/releases/download/v1.13.0/revanced-integrations-1.13.0.apk. File already exists or dry running.
2024-09-06 21:33:28.247 | DEBUG    | src.downloader.github:_get_release_assets:97 - Found revanced-cli-4.6.0-all.jar to be downloaded from https://github.com/ReVanced/revanced-cli/releases/download/v4.6.0/revanced-cli-4.6.0-all.jar
2024-09-06 21:33:28.248 | DEBUG    | src.downloader.download:_download:33 - Skipping download of d1dd3f8bdff4c4fbedc02f74dc4a853217af9769fcb559fe394d77806114dc55.jar from https://github.com/ReVanced/revanced-cli/releases/download/v4.6.0/revanced-cli-4.6.0-all.jar. File already exists or dry running.
2024-09-06 21:33:28.261 | DEBUG    | src.downloader.github:_get_release_assets:97 - Found patches.json to be downloaded from https://github.com/ReVanced/revanced-patches/releases/download/v4.13.3/patches.json
2024-09-06 21:33:28.261 | DEBUG    | src.downloader.github:_get_release_assets:97 - Found revanced-patches-4.13.3.jar to be downloaded from https://github.com/ReVanced/revanced-patches/releases/download/v4.13.3/revanced-patches-4.13.3.jar
2024-09-06 21:33:28.262 | DEBUG    | src.downloader.download:_download:33 - Skipping download of ef151e1bbd5a83dc9ad55bf59c7448de78c077a507ab97f34e341cc570d0c855.jar from https://github.com/ReVanced/revanced-patches/releases/download/v4.13.3/revanced-patches-4.13.3.jar. File already exists or dry running.
2024-09-06 21:33:28.262 | DEBUG    | src.downloader.download:_download:33 - Skipping download of aa76f1e09ce1e149d1e710b8e639ea468d7fbcae8102f2c3dbd043d1f7f80cff.json from https://github.com/ReVanced/revanced-patches/releases/download/v4.13.3/patches.json. File already exists or dry running.
2024-09-06 21:33:28.280 | INFO     | src.app:download_apk_for_patching:64 - Downloading apk to be patched by scrapping
2024-09-06 21:33:30.372 | INFO     | src.downloader.apkmirror:specific_version:111 - Trying to guess infinity version.
2024-09-06 21:33:31.344 | INFO     | src.downloader.apkmirror:specific_version:115 - Guessed 7-3-4-183 for infinity
2024-09-06 21:33:31.345 | DEBUG    | src.downloader.apkmirror:extract_download_link:40 - Extracting download link from
https://www.apkmirror.com/apk/docile-alligator/infinity-for-reddit/infinity-for-reddit-7-3-4-release/infinity-for-reddit-7-3-4-android-apk-download/
2024-09-06 21:33:32.786 | INFO     | src.downloader.download:_download:35 - Trying to download infinity.zip from https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=6945939&key=dfc04ec7536be9521556b45273b82c20885355fd
infinity.zip: 100%|██████████| 8.90M/8.90M [00:01<00:00, 9.29MiB/s]
2024-09-06 21:33:35.248 | DEBUG    | src.downloader.download:_download:62 - Downloaded infinity.zip
2024-09-06 21:33:38.051 | INFO     | src.downloader.download:convert_to_apk:106 - Converted zip to apk.
2024-09-06 21:33:38.051 | INFO     | __main__:main:47 - app_name: infinity, app_version: 7-3-4-183, experiment: False, cli_dl: https://github.com/revanced/revanced-cli/releases/latest, patches_dl: https://github.com/revanced/revanced-patches/releases/latest, integrations_dl: https://github.com/revanced/revanced-integrations/releases/latest, patches_json_dl: https://github.com/revanced/revanced-patches/releases/latest, exclude_request: [], include_request: [], resource: {'cli': {'file_name': 'd1dd3f8bdff4c4fbedc02f74dc4a853217af9769fcb559fe394d77806114dc55.jar', 'version': 'v4.6.0'}, 'integrations': {'file_name': 'c0b33a97c2b0236c24e0f77bad44f0cdfc3f03d738224ecd4e1434d84dcfc055.apk', 'version': 'v1.13.0'}, 'patches': {'file_name': 'ef151e1bbd5a83dc9ad55bf59c7448de78c077a507ab97f34e341cc570d0c855.jar', 'version': 'v4.13.3'}, 'patches_json': {'file_name': 'aa76f1e09ce1e149d1e710b8e639ea468d7fbcae8102f2c3dbd043d1f7f80cff.json', 'version': 'v4.13.3'}}, no_of_patches: 2, keystore_name: revanced.keystore, archs_to_build: [], options_file: infinity-options.json, download_file_name: infinity.apk, download_dl: https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=6945939&key=dfc04ec7536be9521556b45273b82c20885355fd, download_source: https://www.apkmirror.com/apk/docile-alligator/infinity-for-reddit/, package_name: ml.docilealligator.infinityforreddit, old_key: True, space_formatted: True
2024-09-06 21:33:38.306 | DEBUG    | src.parser:is_new_cli:149 - New cli
2024-09-06 21:33:38.307 | DEBUG    | src.parser:patch_app:211 - Sending request to revanced cli for building with args java ['-jar', PosixPath('apks/d1dd3f8bdff4c4fbedc02f74dc4a853217af9769fcb559fe394d77806114dc55.jar'), 'patch', PosixPath('apks/infinity.apk'), '-b', PosixPath('apks/ef151e1bbd5a83dc9ad55bf59c7448de78c077a507ab97f34e341cc570d0c855.jar'), '-m', PosixPath('apks/c0b33a97c2b0236c24e0f77bad44f0cdfc3f03d738224ecd4e1434d84dcfc055.apk'), '-o', PosixPath('apks/Re-infinity-7-3-4-183-2024SEP07_0103AM-output.apk'), '--keystore', PosixPath('apks/revanced.keystore'), '--options', PosixPath('apks/infinity-options.json'), '--keystore-entry-alias=alias', '--keystore-entry-password=ReVanced', '--keystore-password=ReVanced', '-i', 'Unlock subscription', '-i', 'Spoof client']
2024-09-06 21:33:38.546 | DEBUG    | src.parser:patch_app:218 - INFO: Loading patches

2024-09-06 21:33:38.969 | DEBUG    | src.parser:patch_app:218 - INFO: Decoding app manifest

2024-09-06 21:33:39.531 | DEBUG    | src.parser:patch_app:218 - INFO: Spoof SIM country excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Spoof Wi-Fi connection excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Remove screenshot restriction excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Export all activities excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Predictive back gesture excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Hide mock location excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Change package name excluded

2024-09-06 21:33:39.532 | DEBUG    | src.parser:patch_app:218 - INFO: Hex excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Change version code excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Spoof build info excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Override certificate pinning excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Enable Android debugging excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Remove share targets excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Remove screen capture restriction excluded

2024-09-06 21:33:39.533 | DEBUG    | src.parser:patch_app:218 - INFO: Setting patch options

2024-09-06 21:33:40.272 | DEBUG    | src.parser:patch_app:218 - INFO: Executing patches

2024-09-06 21:33:40.386 | DEBUG    | src.parser:patch_app:218 - INFO: Spoof client succeeded

2024-09-06 21:33:40.469 | DEBUG    | src.parser:patch_app:218 - INFO: Unlock subscription succeeded

2024-09-06 21:33:40.470 | DEBUG    | src.parser:patch_app:218 - INFO: Compiling patched dex files

2024-09-06 21:33:41.296 | DEBUG    | src.parser:patch_app:218 - INFO: Compiled classes.dex

2024-09-06 21:33:41.313 | DEBUG    | src.parser:patch_app:218 - INFO: Compiled classes2.dex

2024-09-06 21:33:41.316 | DEBUG    | src.parser:patch_app:218 - INFO: Compiled classes3.dex

2024-09-06 21:33:41.336 | DEBUG    | src.parser:patch_app:218 - INFO: Compiled classes4.dex

2024-09-06 21:33:43.242 | DEBUG    | src.parser:patch_app:218 - INFO: Aligning APK

2024-09-06 21:33:43.469 | DEBUG    | src.parser:patch_app:218 - INFO: Signing APK

com.android.apksig.apk.MinSdkVersionException: Failed to determine APK's minimum supported Android platform version
    at com.android.apksig.ApkSigner.getMinSdkVersionFromApk(ApkSigner.java:1006)
    at com.android.apksig.ApkSigner.sign(ApkSigner.java:295)
    at com.android.apksig.ApkSigner.sign(ApkSigner.java:231)
    at app.revanced.library.ApkSigner$Signer.signApk(ApkSigner.kt:337)
    at app.revanced.library.ApkUtils.signApk(ApkUtils.kt:169)
    at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:321)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Caused by: com.android.apksig.zip.ZipFormatException: Data Descriptor presence mismatch between Local File Header and Central Directory for entry AndroidManifest.xml. LFH: true, CD: false
    at com.android.apksig.internal.zip.LocalFileRecord.getRecord(LocalFileRecord.java:180)
    at com.android.apksig.internal.zip.LocalFileRecord.outputUncompressedData(LocalFileRecord.java:427)
    at com.android.apksig.internal.zip.LocalFileRecord.getUncompressedData(LocalFileRecord.java:451)
    at com.android.apksig.ApkSigner.getAndroidManifestFromApk(ApkSigner.java:966)
    at com.android.apksig.ApkSigner.getMinSdkVersionFromApk(ApkSigner.java:1004)
    ... 14 more
2024-09-06 21:33:43.596 | INFO     | src.parser:patch_app:220 - Patching completed for app app_name: infinity, app_version: 7-3-4-183, experiment: False, cli_dl: https://github.com/revanced/revanced-cli/releases/latest, patches_dl: https://github.com/revanced/revanced-patches/releases/latest, integrations_dl: https://github.com/revanced/revanced-integrations/releases/latest, patches_json_dl: https://github.com/revanced/revanced-patches/releases/latest, exclude_request: [], include_request: [], resource: {'cli': {'file_name': 'd1dd3f8bdff4c4fbedc02f74dc4a853217af9769fcb559fe394d77806114dc55.jar', 'version': 'v4.6.0'}, 'integrations': {'file_name': 'c0b33a97c2b0236c24e0f77bad44f0cdfc3f03d738224ecd4e1434d84dcfc055.apk', 'version': 'v1.13.0'}, 'patches': {'file_name': 'ef151e1bbd5a83dc9ad55bf59c7448de78c077a507ab97f34e341cc570d0c855.jar', 'version': 'v4.13.3'}, 'patches_json': {'file_name': 'aa76f1e09ce1e149d1e710b8e639ea468d7fbcae8102f2c3dbd043d1f7f80cff.json', 'version': 'v4.13.3'}}, no_of_patches: 2, keystore_name: revanced.keystore, archs_to_build: [], options_file: infinity-options.json, download_file_name: infinity.apk, download_dl: https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=6945939&key=dfc04ec7536be9521556b45273b82c20885355fd, download_source: https://www.apkmirror.com/apk/docile-alligator/infinity-for-reddit/, package_name: ml.docilealligator.infinityforreddit, old_key: True, space_formatted: True in 5.29 seconds.

ENVS

PATCH_APPS=infinity
GITHUB_REPOSITORY=nikhilbadyal/docker-py-revanced
REDDIT_CLIENT_ID=<REDDIT_CLIENT_ID>
INFINITY_OPTIONS_FILE=infinity-options.json

Additional info

This outputs a 0-byte apk.

infinity-options.json

[
  {
    "patchName": "Spoof client",
    "options": [
      {
        "key": "client-id",
        "value": "<client-id>"
      }
    ]
  }
]
Joseja8 commented 1 week ago

Same for me