Skip to content

Commit

Permalink
taskAffinity? should it change or not? idk rn.
Browse files Browse the repository at this point in the history
  • Loading branch information
Veha0001 committed Dec 29, 2024
1 parent 46b1937 commit 68e6e7f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ exclude-too-few-public-methods=
ignored-parents=

# Maximum number of arguments for function / method.
max-args=5
max-args=10

# Maximum number of attributes for a class (see R0902).
max-attributes=7
max-attributes=10

# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5
Expand All @@ -308,7 +308,7 @@ max-locals=30
max-parents=7

# Maximum number of positional arguments for function / method.
max-positional-arguments=5
max-positional-arguments=10

# Maximum number of public methods for a class (see R0904).
max-public-methods=20
Expand Down Expand Up @@ -442,7 +442,8 @@ disable=raw-checker-failed,
missing-class-docstring,
use-symbolic-message-instead,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero
use-implicit-booleaness-not-comparison-to-zero,
R1702

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
36 changes: 33 additions & 3 deletions autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,22 @@ def rename_package_in_manifest(
[
(
f'android:taskAffinity="{old_package_name}"',
f'android:taskAffinity="{new_package_name}"',
'android:taskAffinity=""',
),
]
)

if level == 2:
replacements.extend(
[
(
f'android:taskAffinity="{old_package_name}"',
f'android:taskAffinity="{new_package_name}"',
),
]
)

if level == 3:
replacements.extend(
[
(
Expand All @@ -275,6 +286,25 @@ def rename_package_in_manifest(
]
)

if level == 4:
replacements.extend(
[
(
f'android:taskAffinity="{old_package_name}"',
'android:taskAffinity=""',
),
(
f'android:host="{old_package_name}"',
f'android:host="{new_package_name}"',
),
(
f'android:host="cct\\.{old_package_name}"',
f'android:host="cct.{new_package_name}"',
),
]
)



# Perform replacements
for pattern, replacement in replacements:
Expand All @@ -283,7 +313,7 @@ def rename_package_in_manifest(
with open(manifest_file, "w", encoding="utf-8") as file:
file.write(content)

msg.success(f"Updated package name in AndroidManifest.xml")
msg.success("Updated package name in AndroidManifest.xml")

except FileNotFoundError:
msg.error(f"The manifest file '{manifest_file}' was not found.")
Expand Down Expand Up @@ -659,7 +689,7 @@ def main():

msg.info("APK modification finished!", bold=True)


if __name__ == "__main__":
print_rainbow_art("DemodAPK", bold=True, font="small")
main()

0 comments on commit 68e6e7f

Please sign in to comment.