Initial commit - Custom theme and logo
commit
d67e7e3017
|
@ -0,0 +1,9 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = true
|
|
@ -0,0 +1,7 @@
|
||||||
|
/discord.apk
|
||||||
|
/discord
|
||||||
|
__pycache__
|
||||||
|
|
||||||
|
*.keystore
|
||||||
|
*.keystore.pw
|
||||||
|
discord*.apk*
|
|
@ -0,0 +1 @@
|
||||||
|
from .custom_theme import patch_theme
|
|
@ -0,0 +1,22 @@
|
||||||
|
import shutil
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def apply_custom_theme(colors_file: str) -> str:
|
||||||
|
return colors_file \
|
||||||
|
.replace("36393f", "292841") \
|
||||||
|
.replace("292b2f", "413f66") \
|
||||||
|
.replace("2f3136", "242338") \
|
||||||
|
.replace("202225", "1c1b29") \
|
||||||
|
.replace("18191c", "1c1b29")
|
||||||
|
|
||||||
|
|
||||||
|
def patch_theme():
|
||||||
|
with open("discord/res/values/colors.xml") as f:
|
||||||
|
color_theme = f.read()
|
||||||
|
color_theme = apply_custom_theme(color_theme)
|
||||||
|
with open("discord/res/values/colors.xml", "w") as f:
|
||||||
|
f.write(color_theme)
|
||||||
|
|
||||||
|
os.remove("discord/res/drawable-xxxhdpi/img_logo.png")
|
||||||
|
shutil.copy("lesbibabs.png", "discord/res/drawable-xxxhdpi/img_logo.png")
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -0,0 +1,32 @@
|
||||||
|
from android_discord_patches import patch_theme
|
||||||
|
import shutil
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def disassemble():
|
||||||
|
shutil.rmtree("discord", ignore_errors=True)
|
||||||
|
os.system("apktool d ./discord.apk -o discord")
|
||||||
|
|
||||||
|
|
||||||
|
def patch():
|
||||||
|
patch_theme()
|
||||||
|
|
||||||
|
input("[hit enter]")
|
||||||
|
|
||||||
|
|
||||||
|
def reassemble():
|
||||||
|
os.system("apktool b discord -o discord-patched.apk")
|
||||||
|
|
||||||
|
os.system(
|
||||||
|
"apksigner sign "
|
||||||
|
"--ks discord.keystore "
|
||||||
|
"--ks-pass file:discord.keystore.pw "
|
||||||
|
"--in discord-patched.apk "
|
||||||
|
"--out discord-patched-signed.apk "
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
disassemble()
|
||||||
|
patch()
|
||||||
|
reassemble()
|
Loading…
Reference in New Issue