-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom_enc_key.py
47 lines (31 loc) · 1.15 KB
/
custom_enc_key.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import tbcml
# following code is just an example of a modification:
class NewForm(tbcml.CatForm):
def __init__(self):
super().__init__(form_type=tbcml.CatFormType.FIRST)
self.name = "cool name"
self.description = ["cat that does stuff...", "example cat for tbcml"]
class NewCat(tbcml.Cat):
def __init__(self):
super().__init__(cat_id=0)
self.set_form(NewForm())
loader = tbcml.ModLoader("en", "12.3.0") # can be changed for other versions
loader.initialize_apk()
game_data = loader.get_game_packs()
apk = loader.get_apk()
mod = tbcml.Mod(
"Custom Key Example",
"fieryhenry",
"Changes basic cat first form name and description + apk encryption key and iv",
)
cat = NewCat()
mod.add_modification(cat)
apk.set_app_name("Custom Key")
apk.set_package_name("jp.co.ponos.battlecatsen.customkey")
# this code is where you can customize iv and key:
# strings are sha256 hashed so they are the correct length
key = apk.create_key("somesupersecretkey")
iv = apk.create_iv("somesupersecretiv")
loader.apply(mod, custom_enc_key=key, custom_enc_iv=iv)
# loader.initialize_adb()
# loader.install_adb(run_game=True)