Skip to content

Commit 0533882

Browse files
chore: fix deobfuscation issues
Signed-off-by: androidacy-user <[email protected]>
1 parent 7c489ad commit 0533882

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99

1010
allprojects {
1111
group = "com.github.Androidacy.LSParanoid"
12-
version = "0.9.7"
12+
version = "0.9.9"
1313

1414
plugins.withType(JavaPlugin::class.java) {
1515
extensions.configure(JavaPluginExtension::class.java) {

processor/src/main/kotlin/org/lsposed/lsparanoid/processor/ParanoidProcessor.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,19 @@ class ParanoidProcessor(
4343

4444
private val logger = getLogger()
4545

46-
private val grip: Grip = GripFactory.newInstance(asmApi).create(classpath + inputs)
46+
private val sortedInputs = inputs.distinct().sorted()
47+
private val grip: Grip = GripFactory.newInstance(asmApi).create(classpath + sortedInputs)
4748

4849
fun process() {
4950
dumpConfiguration()
5051
StringRegistryImpl(seed).use { stringRegistry ->
51-
val analysisResult = Analyzer(grip, classFilter).analyze(inputs)
52+
val analysisResult = Analyzer(grip, classFilter).analyze(sortedInputs)
5253
analysisResult.dump()
5354

5455
val deobfuscator = createDeobfuscator()
5556
logger.info("Prepare to generate {}", deobfuscator)
5657

57-
val sources = inputs.asSequence().map { input ->
58+
val sources = sortedInputs.asSequence().map { input ->
5859
IoFactory.createFileSource(input)
5960
}
6061

processor/src/main/kotlin/org/lsposed/lsparanoid/processor/Patcher.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ class Patcher(
5353
logger.info("Patching...")
5454
logger.info(" Input: {}", source)
5555

56+
val entries = mutableListOf<Pair<String, FileSource.EntryType>>()
5657
source.listFiles { name, type ->
58+
entries.add(Pair(name, type))
59+
}
60+
61+
entries.sortedBy { it.first }.forEach { (name, type) ->
5762
when (type) {
5863
FileSource.EntryType.CLASS -> copyAndPatchClass(source, jar, name)
5964
FileSource.EntryType.FILE -> jar.createFile(name, source.readFile(name))

0 commit comments

Comments
 (0)