mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Update pro_unlocker.py
This commit is contained in:
parent
8194e98f65
commit
c7ebadbe56
1 changed files with 15 additions and 12 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# ba_meta require api 7
|
||||
import _ba
|
||||
import ba
|
||||
# ba_meta require api 8
|
||||
import bascenev1 as bs
|
||||
import _baplus
|
||||
import babase
|
||||
|
||||
|
||||
def is_game_version_lower_than(version):
|
||||
|
|
@ -9,15 +10,16 @@ def is_game_version_lower_than(version):
|
|||
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(".")))
|
||||
game_version = tuple(map(int, babase.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
|
||||
if is_game_version_lower_than("1.7.20"):
|
||||
original_get_purchased = _baplus.get_purchased
|
||||
else:
|
||||
original_get_purchased = ba.internal.get_purchased
|
||||
assert bs.app.plus is not None
|
||||
original_get_purchased = bs.app.plus.get_purchased
|
||||
|
||||
|
||||
def get_purchased(item):
|
||||
|
|
@ -27,10 +29,11 @@ def get_purchased(item):
|
|||
|
||||
|
||||
# ba_meta export plugin
|
||||
class Unlock(ba.Plugin):
|
||||
class Unlock(babase.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
|
||||
babase.app.classic.accounts.have_pro = lambda: True
|
||||
if is_game_version_lower_than("1.7.20"):
|
||||
_baplus.get_purchased = get_purchased
|
||||
else:
|
||||
ba.internal.get_purchased = get_purchased
|
||||
assert bs.app.plus is not None
|
||||
bs.app.plus.get_purchased = get_purchased
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue