Skip to content

Commit

Permalink
添加规则文件
Browse files Browse the repository at this point in the history
  • Loading branch information
maoabc committed Jun 20, 2021
1 parent f035d0b commit 50c8d67
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.nmmedit.apkprotect.obfus;
package com.nmmedit.apkprotect.deobfus;

public interface MappingProcessor {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.nmmedit.apkprotect.obfus;
package com.nmmedit.apkprotect.deobfus;

import java.io.BufferedReader;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.nmmedit.apkprotect.obfus;
package com.nmmedit.apkprotect.deobfus;

public class Pair<T> {
public final T first;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.nmmedit.apkprotect.dex2c.filters;

import com.nmmedit.apkprotect.obfus.MappingReader;
import com.nmmedit.apkprotect.deobfus.MappingReader;
import org.jf.dexlib2.iface.ClassDef;
import org.jf.dexlib2.iface.Method;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nmmedit.apkprotect.dex2c.filters;

import com.nmmedit.apkprotect.obfus.MappingProcessor;
import com.nmmedit.apkprotect.obfus.MappingReader;
import com.nmmedit.apkprotect.deobfus.MappingProcessor;
import com.nmmedit.apkprotect.deobfus.MappingReader;
import org.jf.dexlib2.iface.ClassDef;
import org.jf.dexlib2.iface.Method;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.nmmedit.apkprotect.dex2c.filters;

import org.jf.dexlib2.iface.ClassDef;
import org.jf.dexlib2.iface.Method;

import java.io.File;

/**
* class * extends android.app.Activity
* class * implements java.io.Serializable
*/
public class RegexKeepConfig implements ClassAndMethodFilter {
private ClassAndMethodFilter filter;

public RegexKeepConfig(ClassAndMethodFilter filter, File ruleFile) {
this.filter = filter;
}

@Override
public boolean acceptClass(ClassDef classDef) {
if (filter != null && !filter.acceptClass(classDef)) {
return false;
}
//todo
return true;
}

@Override
public boolean acceptMethod(Method method) {
if (filter != null && !filter.acceptMethod(method)) {
return false;
}
//todo
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.nmmedit.apkprotect.obfus;
package com.nmmedit.apkprotect.deobfus;

import com.nmmedit.apkprotect.util.ApkUtils;
import org.junit.Test;
Expand Down
4 changes: 2 additions & 2 deletions nmm-protect/src/main/java/com/nmmedit/protect/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.nmmedit.apkprotect.dex2c.filters.BasicKeepConfig;
import com.nmmedit.apkprotect.dex2c.filters.ClassAndMethodFilter;
import com.nmmedit.apkprotect.dex2c.filters.ProguardMappingConfig;
import com.nmmedit.apkprotect.obfus.MappingReader;
import com.nmmedit.apkprotect.deobfus.MappingReader;
import com.nmmedit.apkprotect.sign.ApkVerifyCodeGenerator;
import org.jf.dexlib2.iface.ClassDef;
import org.jf.dexlib2.iface.Method;
Expand All @@ -19,7 +19,7 @@ public class Main {
public static void main(String[] args) throws IOException {
if (args.length < 1) {
System.err.println("No Input apk.");
System.err.println("<inApk> ");
System.err.println("<inApk> [<keepRuleFile> [mapping.txt]]");
System.exit(-1);
}
final File apk = new File(args[0]);
Expand Down

0 comments on commit 50c8d67

Please sign in to comment.