-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dex Modification Modes #19
Conversation
- 在 LSPatch 中增加 dexMode 参数,用于选择 Dex 处理模式 - 在 AppManageViewModel 和 NewPatchViewModel 中添加 Dex 模式的相关逻辑 - 更新 NewPatchScreen UI,增加 Dex 模式选择功能 - 在 Patcher 中处理 Dex 模式参数 - 更新相关资源文件,添加 Dex 模式的字符串定义
Thanks for you work!
Its Chinese translation could be
For command line description, use
|
- 移除 Dex 模式选项,改为直接注入 loader Dex 文件 - 更新相关 UI 和字符串资源 - 修改 NewPatchViewModel 中的 dexMod 属性类型
Sorry, I am very busy with my thesis recently. Thanks again for you help, I appreciate it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to change few variable names to keep consistent and easy to understand for others.
|
||
object Patcher { | ||
|
||
class Options( | ||
private val dexMod: Boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change dexMod
to injectDex
@@ -90,4 +90,6 @@ | |||
<string name="settings_keystore_wrong_alias">Wrong alias name</string> | |||
<string name="settings_keystore_wrong_alias_password">Wrong alias password</string> | |||
<string name="settings_detail_patch_logs">Detail patch logs</string> | |||
<string name="patch_dex_mod">Inject loader dex</string> | |||
<string name="patch_dex_desc">For applications with isolated services, such as the render engines of browsers, please turn on option to ensure that they work properly.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please turn on option
-> please turn on this option
@@ -79,6 +78,9 @@ public PatchError(String message, Throwable cause) { | |||
@Parameter(names = {"-l", "--sigbypasslv"}, description = "Signature bypass level. 0 (disable), 1 (pm), 2 (pm+openat). default 0") | |||
private int sigbypassLevel = 0; | |||
|
|||
@Parameter(names = {"-dex", "--dexmod"}, description = "Inject directly the loder dex file into the original application package") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For argument option name, it is better to use only {"--injectdex"}
@@ -239,7 +241,8 @@ public void patch(File srcApkFile, File outputFile) throws PatchError, IOExcepti | |||
for (StoredEntry entry : srcZFile.entries()) { | |||
String name = entry.getCentralDirectoryHeader().getName(); | |||
if (dstZFile.get(name) != null) continue; | |||
if (name.startsWith("META-INF") && (name.endsWith(".SF") || name.endsWith(".MF") || name.endsWith(".RSA"))) continue; | |||
if (name.startsWith("META-INF") && (name.endsWith(".SF") || name.endsWith(".MF") || name.endsWith(".RSA"))) | |||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a newline here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDEA code optimization
return name.startsWith("classes") && name.endsWith(".dex"); | ||
}).collect(Collectors.toList()).size() + 1; | ||
dstZFile.add("classes" + dexCount + ".dex", is); | ||
if (!dexMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the variable dexMode
…iated code - rename the --dexmod argument to --injectdex - Update related variables in the LSPatch, NewPatchScreen, NewPatchViewModel, and Patcher classes - Modify the description in the string resource file
Congratulations to your contributions, it is merge! Thanks for your patience, I appreciate it! |
This pull request introduces a new feature to handle different dex modification modes in the patching process, along with some minor updates and refactoring. The most important changes include adding support for dex modification modes in the
Patcher
andLSPatch
classes, updating the UI to allow users to select the dex modification mode, and adding corresponding string resources.New Feature: Dex Modification Modes
dexMod
to thePatcher.Options
class and updated thePatcher
methods to handle this parameter (manager/src/main/java/org/lsposed/lspatch/Patcher.kt
). [1] [2]dexModLvStr
to map dex modification levels to user-friendly strings (manager/src/main/java/org/lsposed/lspatch/ui/page/NewPatchScreen.kt
).PatchOptionsBody
composable to include a dropdown for selecting the dex modification mode (manager/src/main/java/org/lsposed/lspatch/ui/page/NewPatchScreen.kt
).dexMod
to theNewPatchViewModel
class and updated the patch submission logic to include this property (manager/src/main/java/org/lsposed/lspatch/ui/viewmodel/NewPatchViewModel.kt
). [1] [2]Updates to
LSPatch
ClassdexMode
to theLSPatch
class and updated the patching logic to handle different dex modes (patch/src/main/java/org/lsposed/patch/LSPatch.java
). [1] [2] [3] [4]String Resources
manager/src/main/res/values/strings.xml
,manager/src/main/res/values-zh-rCN/strings.xml
,manager/src/main/res/values-zh-rTW/strings.xml
). [1] [2] [3]