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
|
# Get latest patches using the ReVanced API
|
||||||
try:
|
try:
|
||||||
# Get the first result
|
# Get the first result
|
||||||
patches_json = next(filter(
|
patches = session.get('https://api.revanced.app/v4/patches/list').json()
|
||||||
lambda x: x['repository'] == 'revanced/revanced-patches', appstate['tools']))
|
|
||||||
patches = session.get(patches_json['browser_download_url']).json()
|
|
||||||
except session.exceptions.RequestException as e:
|
except session.exceptions.RequestException as e:
|
||||||
err_exit(f"Error fetching patches, {e}", appstate)
|
err_exit(f"Error fetching patches, {e}", appstate)
|
||||||
|
|
||||||
|
@ -123,13 +121,10 @@ def get_apks(appstate):
|
||||||
hard_version = False
|
hard_version = False
|
||||||
compatible_vers = []
|
compatible_vers = []
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
if patch['compatiblePackages'] is not None:
|
try:
|
||||||
for pkg in patch['compatiblePackages']:
|
compatible_vers.append(patch['compatiblePackages'][apk][-1])
|
||||||
if pkg['name'] == apk:
|
except (KeyError, TypeError):
|
||||||
try:
|
pass
|
||||||
compatible_vers.append(pkg['versions'][-1])
|
|
||||||
except TypeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if not compatible_vers:
|
if not compatible_vers:
|
||||||
required_ver = Version('0')
|
required_ver = Version('0')
|
||||||
|
|
|
@ -36,7 +36,7 @@ def build_apps(appstate):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Build the command to be run
|
# 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:
|
try:
|
||||||
root = build_config[app].getboolean('root')
|
root = build_config[app].getboolean('root')
|
||||||
|
|
|
@ -21,7 +21,7 @@ from ReVancedBuilder.Cleanup import move_apps, err_exit
|
||||||
|
|
||||||
# Update the ReVanced tools, if needed
|
# Update the ReVanced tools, if needed
|
||||||
def update_tools(appstate):
|
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}...")
|
print(f"Checking updates for {item}...")
|
||||||
tools = appstate['tools']
|
tools = appstate['tools']
|
||||||
tool = next(filter(lambda x: x['repository'] == 'revanced/'+item and x['content_type'] not in ['application/pgp-keys', 'application/json'], 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