nikhilbadyal/docker-py-revanced

[Bug] CLI v4 Support

Closed this issue ยท 20 comments

Request guidelines

Name

sync,trakt,twitter

Error log or link to the logs if using Github Action

https://github.com/IMXEren/rvx-builds/actions/runs/6424702072/job/17445874341#step:6:598
https://github.com/IMXEren/rvx-builds/actions/runs/6424838497/job/17446309277

revanced-builder | 2023-10-05 21:53:18.679 | DEBUG    | src.downloader.download:_download:62 - Downloaded sync.apk
revanced-builder | 2023-10-05 21:53:18.680 | INFO     | __main__:main:42 - app_name: sync, app_version: v23.06.30-13:39, 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': '8afdf1bc1e7c1bdfae44925815e1125b580d3fa29aef1b0ca3ac2bc1ca48040f.jar', 'integrations': '86b0a48fdfac72a209a52f4e7087a5512dd0a200117ac4d7bc5819ea2d2ae166.apk', 'patches': '56d04c6c214c14ac14550289a7f35ccd0724a67b91123dd1134b80b9198db6a8.jar', 'patches_json': 'f0487449d2b7718c87eddeb647e96c21b8d85be26a47d3803795930a238df839.json'}, no_of_patches: 3, keystore_name: revanced.keystore, archs_to_build: ['arm64-v8a'], download_file_name: sync.apk, download_dl: https://www.apkmirror.com/wp-content/themes/APKMirror...
revanced-builder | 2023-10-05 21:53:18.964 | DEBUG    | src.parser:is_new_cli:133 - Old cli
revanced-builder | 2023-10-05 21:53:18.964 | DEBUG    | src.parser:patch_app:1[84](https://github.com/IMXEren/rvx-builds/actions/runs/6424838497/job/17446309277#step:6:84) - Sending request to revanced cli for building with args java ['-jar', PosixPath('apks/8afdf1bc1e7c1bdfae44925815e1125b580d3fa29aef1b0ca3ac2bc1ca48040f.jar'), '-a', PosixPath('apks/sync.apk'), '-b', PosixPath('apks/56d04c6c214c14ac14550289a7f35ccd0724a67b91123dd1134b80b9198db6a8.jar'), '-m', PosixPath('apks/86b0a48fdfac72a209a52f4e7087a5512dd0a200117ac4d7bc5819ea2d2ae166.apk'), '-o', PosixPath('apks/Re-sync-v230630-1339-output.apk'), '--keystore', PosixPath('apks/revanced.keystore'), '--options', PosixPath('apks/options.json'), '-i', 'disable-ads', '-i', 'disable-sync-for-lemmy-bottom-sheet', '-i', 'spoof-client']
revanced-builder | Unknown options: '-a', 'apks/sync.apk', '-b', 'apks/56d04c6c214c14ac14550289a7f35ccd0724a67b91123dd1134b80b9198db6a8.jar', '-m', 'apks/86b0a48fdfac72a209a52f4e7087a5512dd0a200117ac4d7bc5819ea2d2ae166.apk', '-o', 'apks/Re-sync-v230630-1339-output.apk', '--keystore', 'apks/revanced.keystore', '--options', 'apks/options.json', '-i', 'disable-ads', '-i', 'disable-sync-for-lemmy-bottom-sheet', '-i', 'spoof-client'
nced-builder | Usage: revanced-cli [-hV] [COMMAND]
revanced-builder | Command line application to use ReVanced
revanced-builder |   -h, --help      Show this help message and exit.
revanced-builder |   -V, --version   Print version information and exit.
revanced-builder | Commands:
revanced-builder |   list-patches  List patches from supplied patch bundles
revanced-builder |   patch         Patch an APK file
revanced-builder |   options       Generate options file from patches
revanced-builder |   utility       Commands for utility purposes
revanced-builder | 2023-10-05 21:53:19.252 | INFO     | src.parser:patch_app:193 - Patching completed for app app_name: sync, app_version: v23.06.30-13:39, 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': '8afdf1bc1e7c1bdfae44925815e1125b580d3fa29aef1b0ca3ac2bc1ca48040f.jar', 'integrations': '86b0a48fdfac72a209a52f4e7087a5512dd0a200117ac4d7bc5819ea2d2ae166.apk', 'patches': '56d04c6c214c14ac14550289a7f35ccd0724a67b91123dd1134b80b9198db6a8.jar', 'patches_json': 'f0487449d2b7718c87eddeb647e96c21b8d[85](https://github.com/IMXEren/rvx-builds/actions/runs/6424838497/job/17446309277#step:6:85)be26a47d3803795[93](https://github.com/IMXEren/rvx-builds/actions/runs/6424838497/job/17446309277#step:6:93)0a238df839.json'}, no_of_patches: 3, keystore_name: revanced.keystore, archs_to_build: ['arm64-v8a'], download_file_name: sync.apk, download_dl: https://www.apkmir.../
revanced-builder exited with code 0

ENVS

### Global:
DRY_RUN=False
GLOBAL_ARCHS_TO_BUILD=arm64-v8a
PATCH_APPS=sync,trakt,twitter
EXTRA_FILES=https://github.com/kazimmt/mmicrog/releases/latest@kazimmt_mMicroG.apk

# Default config for apps

Additional info

This only happens for apps using patch resources of ReVanced, inferred out of 3-5 runs of same .env.

Can you also confirm, @Spacellary?

Somehow the builder is think you are using old cli which has old syntax. Will take look.

It's because v4 is out now and had a check only for v3. I think it's time to remove v2 CLI support.

/cib

@nikhilbadyal Possible to keep V2, V3 and V4 supported with additional, more scalable tests?

The fact that your tool is so easy to use just by pointing to the correct resources is such a nice thing, ideally that shouldn't be lost.

"Please support my unsupported use case"

Jk, but well... :')

@nikhilbadyal

Worst case scenario maybe automatic detection can only be V3 or higher...

But maybe add a manual .env variable, that if present can override the automatic version check, as in CLI_VERSION=V2, V3, V4, V5

This would serve as a Legacy/backwards compatibility option for that specific use case. Will also serve as a failsafe/backup for situations where the version can't be properly determined (eg.: a problematic CLI release)

And have the set command line behaviors for each VERSION value applied during patching?

Hmm

@IMXEren Does this sound too bloated?

Kinda... although I'd prefer functionality over complexities.

This can be a possible solution while ReVanced CLI is being experimented.

Let's see what dev thinks.

Every piece of code has some life. I'll try to keep it for now. But someday will remove it when it becomes a burden to maintain. Basically where there is 3rd variant of command options.

They also for some reason decided to make old keystore unusable without patch work. Handled that as well.

Acceptable. Thanks

@Spacellary , Just to let you know this breaks inotia00/revanced-cli. Would he do something about it?

I have added a temp patch for now. I hope he handles it. It's a pain to maintain so many things.

Understandable and that's why I didn't request you directly.

Looks like they also broke how patch names are expected. Earlier Revanced CLI worked with both format - and space. Now it doesn't.

Damn, I just created another issue for that.

Looks like they also broke how patch names are expected. Earlier Revanced CLI worked with both format - and space. Now it doesn't.

More brilliant decisions...

Fixed in v4 branch. Check if working @Spacellary @IMXEren

Users now need to specify the type of patches, whether they are space separated or - separated. The default is space separated.

Inoria00 users need to provide GLOBAL_SPACE_FORMATTED_PATCHES=False. Check readme to understand requirements.

I'm currently unavailable to test & report.

@nikhilbadyal Thanks you so much for the patch! Enjoy your weekend ๐Ÿฅณ

Working here -- actions/runs/6442014436/job/17492391715 -- patching with both RV and RVX, using per APP_SPACE_FORMATTED_PATCHES=False for applications with inotia00 source.

@nikhilbadyal @IMXEren

Already been a few hours since latest rvx-patches released, tested and inotia00 has moved to the CLI-v4, and thus his patches can be referenced without the need for APP_SPACE_FORMATTED_PATCHES=False anymore.


Using only the GLOBAL_SPACE_FORMATTED_PATCHES=True = โœ…

@inotia00 ๐Ÿ‘€ ๐Ÿฅณ

@nikhilbadyal

CLI v4.0.2 I released today referred to this and changed the default keystore alias and password to the old values

Welp. Still handy check is already in place.