LSPatch
LSPatch copied to clipboard
[Feature Request] More comprehensive optimization improvements
Is your feature request related to a problem?/你的请求是否与某个问题相关?
Add command-c, --disable-acf Disable app component factory
loader.dex
(org/lsposed/lspatch/loader/LSPApplication)createLoadedApkWithContext()
Confuse all the strings in this method to prevent others from directly viewing my customized path from the unconfused characters.
Constants.java final static public String LOADER_DEX_ASSET_PATH (If you change the path or the loader.dex name, running the Actions CI build will result in an error. I hope to be able to modify this path directly without an error.)
LSPApplication.java
Path originPath = Paths.get(appInfo.dataDir,
(However, Root can easily get origin.apk even if I create thousands of paths from ORIGINAL_APK_ASSET_PATH.
/data/data/[PACKAGE]/cache/lspatch/origin)
I modified the ORIGINAL_APK_ASSET_PATH in the source code 'Constants.java' to thousands of paths with different characters. The purpose is to hide my "origin.apk" from others. Can we delete the Path originPath = Paths.get(appInfo.dataDir)? Or add protection to the .apk file of this path (even if others get it, they can't install it). Can we encrypt the extracted code and decrypt it when the code is running? 360's instruction extraction is to encrypt the protected method code again after extracting it.
Describe the solution you'd like/描述你想要的解决方案
Already explained in the post
Additional context/其他信息
No response
Sorry, could you explain from who you wanna hide your modules?
I meant, why did you want to hide your modules?
Using U code to generate random garbled names Use a two-dimensional array to store two U code ranges, random generates random numbers to select U code ranges, and loops to generate characters of a specified length to generate obfuscated names.
import java.util.Random;
public class Name_Factory {
private static final int[][] UNICODE_RANGES = {
{0x0100, 0x017F}, // Latin Extended-A
{0x0370, 0x03FF}, // Greek and Coptic
{0x0400, 0x04FF} // Cyrillic alphabet
};
public static String generateGlitchName(int length) {
Random random = new Random();
StringBuilder glitchName = new StringBuilder();
for (int i = 0; i < length; i++) {
// Randomly select a Unicode range
int[] range = UNICODE_RANGES[random.nextInt(UNICODE_RANGES.length)];
int start = range[0];
int end = range[1];
// Generate a random character
int codePoint = random.nextInt(end - start + 1) + start;
glitchName.append(Character.toChars(codePoint));
}
return glitchName.toString();
}
}
Details
You may open a pull-request, so I understand better what you want to achieve.
Currently, I feel that it is futile to hide your modules using obfuscations.