diff --git a/ctcci/ctcci.py b/ctcci/ctcci.py index a8d5330..e7bdf53 100644 --- a/ctcci/ctcci.py +++ b/ctcci/ctcci.py @@ -128,11 +128,35 @@ for patch_name in PATCHES: os.path.join(WORK_APK_PATH, "res", "mipmap-xxxhdpi", "logo_debug.png")) + if BRANCH in DYN_ICONS: + shutil.copyfile(DYN_ICONS[BRANCH]["bg"], + os.path.join(WORK_APK_PATH, "res", + "mipmap-xxxhdpi", + "ic_launcher_background.png")) + shutil.copyfile(DYN_ICONS[BRANCH]["fg"], + os.path.join(WORK_APK_PATH, "res", + "mipmap-xxxhdpi", + "ic_launcher_foreground.png")) + elif "default" in ICONS: + shutil.copyfile(DYN_ICONS["default"]["bg"], + os.path.join(WORK_APK_PATH, "res", + "mipmap-xxxhdpi", + "ic_launcher_background.png")) + shutil.copyfile(DYN_ICONS["default"]["fg"], + os.path.join(WORK_APK_PATH, "res", + "mipmap-xxxhdpi", + "ic_launcher_foreground.png")) + patch_script = os.path.join(REPO_FOLDER, "patches", patch_name, "customicon.sh") subprocess.run(f"bash {patch_script}", shell=True, cwd=WORK_APK_PATH) + patch_script = os.path.join(REPO_FOLDER, "patches", + patch_name, "customdynamicicon.sh") + + subprocess.run(f"bash {patch_script}", shell=True, cwd=WORK_APK_PATH) + patch_script = os.path.join(REPO_FOLDER, "patches", patch_name, "addpatch.py") diff --git a/ctcci/ctcconfig.example.py b/ctcci/ctcconfig.example.py index 1624858..893a91e 100644 --- a/ctcci/ctcconfig.example.py +++ b/ctcci/ctcconfig.example.py @@ -51,6 +51,12 @@ RINGTONES = {"ave": "/home/ave/sans.mp3", ICONS = {"ave": "/home/ave/ctclogoave.png", "default": "/home/ave/ctclogo.png"} +# Custom dynamic icons, default = applied to all the ones not explicitly stated +DYN_ICONS = {"ave": {"bg": "/home/ave/distokrepos/cutthecord/icons/bg.png", + "fg": "/home/ave/distokrepos/cutthecord/icons/fg.png"}, + "default": {"bg": "/home/ave/dcbg.png", + "fg": "/home/ave/dcfg.png"}} + # Custom app names, default = applied to all the ones not explicitly stated # Needs to be one word, __ gets replaced with space APP_NAMES = {"ave": "CutTheCord__Ave", diff --git a/icons/README.md b/icons/README.md new file mode 100644 index 0000000..493c7b4 --- /dev/null +++ b/icons/README.md @@ -0,0 +1,3 @@ +## CutTheCord: Icons + +Thanks to mary for creating the svg for the zhu zhu pet. diff --git a/icons/bg.png b/icons/bg.png new file mode 100644 index 0000000..c97ea34 Binary files /dev/null and b/icons/bg.png differ diff --git a/icons/ctc.xcf b/icons/ctc.xcf new file mode 100644 index 0000000..824eb9a Binary files /dev/null and b/icons/ctc.xcf differ diff --git a/icons/fg.png b/icons/fg.png new file mode 100644 index 0000000..31326a8 Binary files /dev/null and b/icons/fg.png differ diff --git a/icons/full.png b/icons/full.png new file mode 100644 index 0000000..a9ab408 Binary files /dev/null and b/icons/full.png differ diff --git a/icons/zhuzhu.svg b/icons/zhuzhu.svg new file mode 100644 index 0000000..34dd134 --- /dev/null +++ b/icons/zhuzhu.svg @@ -0,0 +1,455 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/patches/branding/README.md b/patches/branding/README.md index 3b3da74..ef2d177 100644 --- a/patches/branding/README.md +++ b/patches/branding/README.md @@ -6,14 +6,17 @@ It also enables debuggability (`android:debuggable`) and backupability (`android You'll need to run "addpatch.py" with syntax of `python3 addpatch.py $in_patch_filename $app_name $branch_name` and use the `-custom.patch` version, or else it'll fail. You'll need to put a valid directory for storing hacky build counters to it. -Running customicon.sh (while on root of the extracted folder) will also change the icon to the debug icon: +Running `customicon.sh` (while on root of the extracted folder) will also change the icon to the debug icon: ![](https://elixi.re/i/48nc2je7.png) +If you want a different icon, replace `res/mipmap-xxxhdpi/logo_debug.png` with the icon you want before running `customicon.sh`. If you don't want dynamic icon to be shown instead of the custom icon, delete the folder `res/mipmap-anydpi-v26/` (or if you want to replace it too, look at the next line instead). + +If you want a custom dynamic icon replace `res/mipmap-xxxhdpi/ic_launcher_foreground.png` (optionally transparent image with only the foreground of the icon) and `res/mipmap-xxxhdpi/ic_launcher_background.png` (optionally transparent image with only the background of the icon), both images should be square and of same size, and then run `customdynamicicon.sh`. You can use the following line to patch authorities: -`sed -i 's/android:authorities="com.discord./android:authorities="top.distok.cutthecord.CTCBRANCH./g' AndroidManifest.xml` +`sed -i 's/android:authorities="com.discord./android:authorities="com.cutthecord.CTCBRANCH./g' AndroidManifest.xml` #### Available and tested on: - 8.3.3 diff --git a/patches/branding/customdynamicicon.sh b/patches/branding/customdynamicicon.sh new file mode 100644 index 0000000..6dd57c3 --- /dev/null +++ b/patches/branding/customdynamicicon.sh @@ -0,0 +1,11 @@ +\cp res/mipmap-xxxhdpi/ic_launcher_background.png res/mipmap-hdpi/ic_launcher_background.png +\cp res/mipmap-xxxhdpi/ic_launcher_background.png res/mipmap-mdpi/ic_launcher_background.png +\cp res/mipmap-xxxhdpi/ic_launcher_background.png res/mipmap-xhdpi/ic_launcher_background.png +\cp res/mipmap-xxxhdpi/ic_launcher_background.png res/mipmap-xxhdpi/ic_launcher_background.png +\cp res/mipmap-xxxhdpi/ic_launcher_background.png res/mipmap-xxxhdpi/ic_launcher_background.png + +\cp res/mipmap-xxxhdpi/ic_launcher_foreground.png res/mipmap-hdpi/ic_launcher_foreground.png +\cp res/mipmap-xxxhdpi/ic_launcher_foreground.png res/mipmap-mdpi/ic_launcher_foreground.png +\cp res/mipmap-xxxhdpi/ic_launcher_foreground.png res/mipmap-xhdpi/ic_launcher_foreground.png +\cp res/mipmap-xxxhdpi/ic_launcher_foreground.png res/mipmap-xxhdpi/ic_launcher_foreground.png +\cp res/mipmap-xxxhdpi/ic_launcher_foreground.png res/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/patches/branding/customicon.sh b/patches/branding/customicon.sh index 462945d..0c71f9f 100644 --- a/patches/branding/customicon.sh +++ b/patches/branding/customicon.sh @@ -8,4 +8,5 @@ \cp res/mipmap-xxxhdpi/logo_debug.png res/mipmap-xhdpi/ic_logo_round.png \cp res/mipmap-xxxhdpi/logo_debug.png res/mipmap-xxhdpi/ic_logo_round.png \cp res/mipmap-xxxhdpi/logo_debug.png res/mipmap-xxxhdpi/ic_logo_round.png -rm -rf res/mipmap-anydpi-v26/ + +#rm -rf res/mipmap-anydpi-v26/