forked from distok/cutthecord
Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
ave | 69700dacaf | |
ave | fb587755da | |
ave | 1b99304a05 | |
ave | c60d13a690 | |
ave | 1cc00f6a48 | |
ave | f3ee05255c | |
ave | 4db6c07a04 |
|
@ -2,7 +2,7 @@
|
|||
|
||||
#### Toolchain setup
|
||||
|
||||
- Get apktool (due to 2 bugs present in v2.3.4, you're strongly recommended to use v2.4.0 or higher, I compile latest from source).
|
||||
- Get apktool (use [this self-built version](//f001.backblazeb2.com/file/avepub/apktool-cli-all.jar) which is master + [this pr](https://github.com/iBotPeaches/Apktool/pull/2463)).
|
||||
- Get a keystore, see [here](https://stackoverflow.com/a/14994354/3286892), step 1.
|
||||
- Get apksigner, it's part of android build tools.
|
||||
- If you want Mutant Standard emoji patches, get 72x72 PNG copies of latest version of mutant standard emojis with codepoints. I have a zip [here](https://mutant.lavatech.top/72x72.zip).
|
||||
|
|
|
@ -69,7 +69,7 @@ if DO_GITPULL:
|
|||
|
||||
# Extract the APK if it's not already extracted to base cache
|
||||
if not os.path.exists(BASE_APK_PATH):
|
||||
subprocess.run(f"{APKTOOL_BIN} d {INPUT_FILE} -o {BASE_APK_PATH} -f",
|
||||
subprocess.run(f"{APKTOOL_BIN} d --no-dummy {INPUT_FILE} -o {BASE_APK_PATH} -f",
|
||||
shell=True,
|
||||
cwd=WORK_FOLDER)
|
||||
|
||||
|
|
|
@ -469,13 +469,13 @@ diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$setO
|
|||
|
||||
+ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
|
||||
+
|
||||
+ move-result-object v0
|
||||
+ move-result-object v2
|
||||
+
|
||||
+ invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getShowTyping()Z
|
||||
+ invoke-virtual {v2}, Lcom/discord/stores/StoreUserSettings;->getShowTyping()Z
|
||||
+
|
||||
+ move-result v0
|
||||
+ move-result v2
|
||||
+
|
||||
+ if-eqz v0, :cond_1
|
||||
+ if-eqz v2, :cond_1
|
||||
+
|
||||
.line 5
|
||||
iget-boolean v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputEditText$setOnTextChangedListener$1;->empty:Z
|
||||
|
|
12
patchport.py
12
patchport.py
|
@ -54,6 +54,8 @@ def fix_offset(patch_contents):
|
|||
for line in patch_lines:
|
||||
if "diff -crB" in line:
|
||||
patch_target = line.split(" ")[2].replace("from/", "")
|
||||
if not os.path.exists(os.path.join(apk_folder, patch_target)):
|
||||
return False
|
||||
os.makedirs(os.path.dirname(os.path.join(tmp_folder, patch_target)), exist_ok=True)
|
||||
shutil.copy(os.path.join(apk_folder, patch_target), os.path.join(tmp_folder, patch_target))
|
||||
# shutil.copytree(apk_folder, tmp_folder)
|
||||
|
@ -199,13 +201,19 @@ for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
|
|||
capture_output=True)
|
||||
|
||||
# Check for issues
|
||||
if "FAILED" in out.stdout:
|
||||
if "FAILED" in out.stdout or "can't find file to patch" in out.stdout:
|
||||
print(f"FAILED: {patch} failed, please fix by hand.")
|
||||
failures.append(patch)
|
||||
out_path += "-failed"
|
||||
elif "offset" in out.stdout:
|
||||
patch_contents = fix_offset(patch_contents)
|
||||
temp_patch_contents = fix_offset(patch_contents)
|
||||
if temp_patch_contents:
|
||||
patch_contents = temp_patch_contents
|
||||
print(f"WARNING: {patch} has offsets which were auto corrected.")
|
||||
else:
|
||||
print(f"FAILED: {patch} is missing files, please fix by hand.")
|
||||
failures.append(patch)
|
||||
out_path += "-failed"
|
||||
|
||||
if debug:
|
||||
print(out.stdout)
|
||||
|
|
Loading…
Reference in New Issue