From 41e239c4bd0fab985738ce5824a62046edf87e24 Mon Sep 17 00:00:00 2001 From: Rikko Date: Sun, 18 Sep 2022 17:07:29 +0530 Subject: [PATCH 1/2] Add pro-unlocker --- plugins/utilities.json | 16 +++++++++++++- plugins/utilities/pro_unlocker.py | 36 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 plugins/utilities/pro_unlocker.py diff --git a/plugins/utilities.json b/plugins/utilities.json index 422be0f..f7b76d9 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -183,6 +183,20 @@ "md5sum": "94f67a98a9faed0ece63674c84d40061" } } + }, + "pro_unlocker": { + "description": "Unlocks some pro-only features - custom colors, playlist maker, etc.", + "external_url": "", + "authors": [ + { + "name": "Anonymous", + "email": "", + "discord": "" + } + ], + "versions": { + "1.0.0": null + } } } -} \ No newline at end of file +} diff --git a/plugins/utilities/pro_unlocker.py b/plugins/utilities/pro_unlocker.py new file mode 100644 index 0000000..5603072 --- /dev/null +++ b/plugins/utilities/pro_unlocker.py @@ -0,0 +1,36 @@ +# ba_meta require api 7 +import _ba +import ba + + +def is_game_version_lower_than(version): + """ + Returns a boolean value indicating whether the current game + version is lower than the passed version. Useful for addressing + any breaking changes within game versions. + """ + game_version = tuple(map(int, ba.app.version.split("."))) + version = tuple(map(int, version.split("."))) + return game_version < version + + +if is_game_version_lower_than("1.7.7"): + original_get_purchased = _ba.get_purchased +else: + original_get_purchased = ba.internal.get_purchased + + +def get_purchased(item): + if item.startswith('characters.') or item.startswith('icons.'): + return original_get_purchased(item) + return True + + +# ba_meta export plugin +class Unlock(ba.Plugin): + def on_app_running(self): + ba.app.accounts_v1.have_pro = lambda: True + if is_game_version_lower_than("1.7.7"): + _ba.get_purchased = get_purchased + else: + ba.internal.get_purchased = get_purchased From 2cc3115e42efa364c59b58ec7fddc8e776d24e90 Mon Sep 17 00:00:00 2001 From: rikkolovescats Date: Sun, 18 Sep 2022 11:37:59 +0000 Subject: [PATCH 2/2] [ci] apply-version-metadata --- plugins/utilities.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index f7b76d9..7881a58 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -195,8 +195,13 @@ } ], "versions": { - "1.0.0": null + "1.0.0": { + "api_version": 7, + "commit_sha": "41e239c", + "released_on": "18-09-2022", + "md5sum": "bbaee5f133b41d2eb53e3b726403a75e" + } } } } -} +} \ No newline at end of file