Full clienthax setup (#2)

- [x] Folder structure
- [x] Script updates
- [x] XML patches
- [x] Move all patches to this repo
- [x] Make sure jenkins is ready for new build system

Reviewed-on: https://booba.tech/CutTheCord/cutthecord/pulls/2
Co-authored-by: 46620 <46620osu@gmail.com>
Co-committed-by: 46620 <46620osu@gmail.com>
This commit is contained in:
46620 2021-08-21 21:04:13 +00:00
parent cecd764639
commit 0f8f3bcbb3
342 changed files with 1948 additions and 81 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
* text=auto eol=lf

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
patches/*/*-custom.patch
patches/*/*.patch-failed
patches/*/*.patch-failed

View file

@ -1,68 +0,0 @@
diff --color -crB com.discord-base/res/menu/menu_chat_toolbar.xml com.discord/res/menu/menu_chat_toolbar.xml
*** com.discord-base/res/menu/menu_chat_toolbar.xml 2021-06-03 15:00:13.923995379 +0000
--- com.discord/res/menu/menu_chat_toolbar.xml 2021-06-03 15:06:45.358117680 +0000
***************
*** 1,12 ****
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
! <item android:icon="@drawable/ic_call_24dp" android:id="@id/menu_chat_start_call" android:visible="false" android:title="@string/start_call" app:iconTint="?colorInteractiveNormal" app:showAsAction="ifRoom" />
<item android:icon="@drawable/ic_call_disconnect_24dp" android:id="@id/menu_chat_stop_call" android:visible="false" android:title="@string/leave_call" app:iconTint="@color/status_red" app:showAsAction="ifRoom" />
<item android:icon="@drawable/ic_group_add_white_24dp" android:id="@id/menu_chat_start_group" android:visible="false" android:title="@string/create_group_dm" app:iconTint="?colorInteractiveNormal" app:showAsAction="ifRoom" />
<item android:icon="@drawable/ic_header_members_add_white_24dp" android:id="@id/menu_chat_add_friend" android:visible="false" android:title="@string/add_friend" app:iconTint="?colorInteractiveNormal" app:showAsAction="always" />
! <item android:icon="@drawable/ic_videocam_white_24dp" android:id="@id/menu_chat_start_video_call" android:visible="false" android:title="@string/start_video_call" app:iconTint="?colorInteractiveNormal" app:showAsAction="ifRoom" />
<item android:id="@id/menu_chat_thread_browser" android:visible="false" app:actionLayout="@layout/icon_thread_browser_layout" app:showAsAction="ifRoom" />
! <item android:icon="@drawable/ic_search_white_24dp" android:id="@id/menu_chat_search" android:visible="false" android:title="@string/search" app:iconTint="?colorInteractiveNormal" app:showAsAction="ifRoom" />
<item android:icon="@drawable/ic_members_24dp" android:id="@id/menu_chat_side_panel" android:visible="false" android:title="@string/members" app:iconTint="?colorInteractiveNormal" app:showAsAction="always" />
! </menu>
\ No newline at end of file
--- 1,12 ----
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
! <item android:icon="@drawable/ic_call_24dp" android:id="@id/menu_chat_start_call" android:visible="false" android:title="@string/start_call" app:iconTint="?colorInteractiveNormal" app:showAsAction="never" />
<item android:icon="@drawable/ic_call_disconnect_24dp" android:id="@id/menu_chat_stop_call" android:visible="false" android:title="@string/leave_call" app:iconTint="@color/status_red" app:showAsAction="ifRoom" />
<item android:icon="@drawable/ic_group_add_white_24dp" android:id="@id/menu_chat_start_group" android:visible="false" android:title="@string/create_group_dm" app:iconTint="?colorInteractiveNormal" app:showAsAction="ifRoom" />
<item android:icon="@drawable/ic_header_members_add_white_24dp" android:id="@id/menu_chat_add_friend" android:visible="false" android:title="@string/add_friend" app:iconTint="?colorInteractiveNormal" app:showAsAction="always" />
! <item android:icon="@drawable/ic_videocam_white_24dp" android:id="@id/menu_chat_start_video_call" android:visible="false" android:title="@string/start_video_call" app:iconTint="?colorInteractiveNormal" app:showAsAction="never" />
<item android:id="@id/menu_chat_thread_browser" android:visible="false" app:actionLayout="@layout/icon_thread_browser_layout" app:showAsAction="ifRoom" />
! <item android:icon="@drawable/ic_search_white_24dp" android:id="@id/menu_chat_search" android:visible="false" android:title="@string/search" app:iconTint="?colorInteractiveNormal" app:showAsAction="always" />
<item android:icon="@drawable/ic_members_24dp" android:id="@id/menu_chat_side_panel" android:visible="false" android:title="@string/members" app:iconTint="?colorInteractiveNormal" app:showAsAction="always" />
! </menu>
diff -crB com.discord-base/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali com.discord/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali
*** com.discord-base/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali 2021-06-03 15:00:16.264008075 +0000
--- com.discord/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali 2021-06-03 15:12:19.415927487 +0000
***************
*** 181,187 ****
invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
! invoke-interface {v3, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;
.line 7
invoke-interface {p1, v8}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem;
--- 181,187 ----
invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
! invoke-interface {v3, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;
.line 7
invoke-interface {p1, v8}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem;
***************
*** 260,266 ****
xor-int/2addr v4, v2
! invoke-interface {v3, v4}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;
.line 13
invoke-interface {p1, v6}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem;
--- 260,266 ----
xor-int/2addr v4, v2
! invoke-interface {v3, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;
.line 13
invoke-interface {p1, v6}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem;

View file

@ -10,7 +10,7 @@ import shutil
# Example invocation:
# python3 patchport.py /home/ave/apks/com.discord-900/
with open("patchport-state.json", "r") as f:
with open("resources/patchport-state.json", "r") as f:
jin = json.load(f)
from_versioncode = jin["versioncode"]
from_versionname = jin["versionname"]
@ -134,36 +134,36 @@ with open(os.path.join(apk_folder, "res", "values", "strings.xml")) as f:
failures = []
for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
for patch in os.listdir(os.path.join(cutthecord_folder, "resources/patches")):
if debug:
print(f"going over patch: {patch}")
# Ignore non-dirs
if not os.path.isdir(os.path.join(cutthecord_folder, "patches", patch)):
if not os.path.isdir(os.path.join(cutthecord_folder, "resources/patches", patch)):
if debug:
print(f"patch is not a folder, skipping: {patch}")
continue
pre_in_path = os.path.join(cutthecord_folder, "patches", patch,
pre_in_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{from_versioncode}-pre.sh")
post_in_path = os.path.join(cutthecord_folder, "patches", patch,
post_in_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{from_versioncode}-post.sh")
pre_out_path = os.path.join(cutthecord_folder, "patches", patch,
pre_out_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{to_versioncode}-pre.sh")
post_out_path = os.path.join(cutthecord_folder, "patches", patch,
post_out_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{to_versioncode}-post.sh")
patch_path = os.path.join(cutthecord_folder, "patches", patch,
patch_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{from_versioncode}.patch")
out_path = os.path.join(cutthecord_folder, "patches", patch,
out_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{to_versioncode}.patch")
readme_path = os.path.join(cutthecord_folder, "patches", patch, "README.md")
readme_path = os.path.join(cutthecord_folder, "resources/patches", patch, "README.md")
# Handle copying of versioned scripts, untested and dirty!
script_path = os.path.join(cutthecord_folder, "patches", patch,
script_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{from_versioncode}.sh")
if os.path.exists(script_path):
script_out_path = os.path.join(cutthecord_folder, "patches", patch,
script_out_path = os.path.join(cutthecord_folder, "resources/patches", patch,
f"{to_versioncode}.sh")
with open(script_path) as f:
with open(script_out_path, "w") as f2:

Some files were not shown because too many files have changed in this diff Show more