mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-25 04:08:37 -06:00
fix: Work with the new API
This commit is contained in:
parent
64ab240a8a
commit
ad125bfb7b
3 changed files with 7 additions and 12 deletions
|
@ -96,9 +96,7 @@ def get_apks(appstate):
|
|||
# Get latest patches using the ReVanced API
|
||||
try:
|
||||
# Get the first result
|
||||
patches_json = next(filter(
|
||||
lambda x: x['repository'] == 'revanced/revanced-patches', appstate['tools']))
|
||||
patches = session.get(patches_json['browser_download_url']).json()
|
||||
patches = session.get('https://api.revanced.app/v4/patches/list').json()
|
||||
except session.exceptions.RequestException as e:
|
||||
err_exit(f"Error fetching patches, {e}", appstate)
|
||||
|
||||
|
@ -123,13 +121,10 @@ def get_apks(appstate):
|
|||
hard_version = False
|
||||
compatible_vers = []
|
||||
for patch in patches:
|
||||
if patch['compatiblePackages'] is not None:
|
||||
for pkg in patch['compatiblePackages']:
|
||||
if pkg['name'] == apk:
|
||||
try:
|
||||
compatible_vers.append(pkg['versions'][-1])
|
||||
except TypeError:
|
||||
pass
|
||||
try:
|
||||
compatible_vers.append(patch['compatiblePackages'][apk][-1])
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
|
||||
if not compatible_vers:
|
||||
required_ver = Version('0')
|
||||
|
|
|
@ -36,7 +36,7 @@ def build_apps(appstate):
|
|||
continue
|
||||
|
||||
# Build the command to be run
|
||||
cmd = 'java -jar revanced-cli.jar patch -b revanced-patches.jar -m revanced-integrations.apk'
|
||||
cmd = 'java -jar revanced-cli.jar patch -p revanced-patches.rvp'
|
||||
|
||||
try:
|
||||
root = build_config[app].getboolean('root')
|
||||
|
|
|
@ -21,7 +21,7 @@ from ReVancedBuilder.Cleanup import move_apps, err_exit
|
|||
|
||||
# Update the ReVanced tools, if needed
|
||||
def update_tools(appstate):
|
||||
for item in ['revanced-cli', 'revanced-integrations', 'revanced-patches']:
|
||||
for item in ['revanced-cli', 'revanced-patches']:
|
||||
print(f"Checking updates for {item}...")
|
||||
tools = appstate['tools']
|
||||
tool = next(filter(lambda x: x['repository'] == 'revanced/'+item and x['content_type'] not in ['application/pgp-keys', 'application/json'], tools))
|
||||
|
|
Loading…
Reference in a new issue