diff --git a/app/src/main/java/com/lahm/easyprotector/TestApplication.java b/app/src/main/java/com/lahm/easyprotector/TestApplication.java index 8cbe92a..1c90928 100644 --- a/app/src/main/java/com/lahm/easyprotector/TestApplication.java +++ b/app/src/main/java/com/lahm/easyprotector/TestApplication.java @@ -2,7 +2,7 @@ import android.app.Application; -import com.lahm.library.CheckCallback; +import com.lahm.library.VirtualCheckCallback; import com.lahm.library.EasyProtectorLib; import com.lahm.library.VirtualApkCheckUtil; @@ -17,7 +17,7 @@ public void onCreate() { super.onCreate(); //AS模拟器的端口检测法会有问题,会抢localhost,所以这里加了个判断,平时真机可以直接调用端口检测 if (!EasyProtectorLib.checkIsRunningInEmulator()) - VirtualApkCheckUtil.getSingleInstance().checkByPortListening(getPackageName(), new CheckCallback() { + VirtualApkCheckUtil.getSingleInstance().checkByPortListening(getPackageName(), new VirtualCheckCallback() { @Override public void findSuspect() { System.out.println("ceshi----"); diff --git a/library/src/main/java/com/lahm/library/VirtualApkCheckUtil.java b/library/src/main/java/com/lahm/library/VirtualApkCheckUtil.java index cbf13f1..b254a84 100644 --- a/library/src/main/java/com/lahm/library/VirtualApkCheckUtil.java +++ b/library/src/main/java/com/lahm/library/VirtualApkCheckUtil.java @@ -182,7 +182,7 @@ private boolean isNumber(String str) { return true; } - public void checkByPortListening(String secret, CheckCallback callback) { + public void checkByPortListening(String secret, VirtualCheckCallback callback) { if (callback == null) throw new IllegalArgumentException("you have to set a callback to deal with suspect"); this.checkCallback = callback; @@ -224,7 +224,7 @@ private void startServer(String secret) { } } - private CheckCallback checkCallback; + private VirtualCheckCallback checkCallback; private class ReadThread extends Thread { private ReadThread(String secret, Socket socket) { diff --git a/library/src/main/java/com/lahm/library/CheckCallback.java b/library/src/main/java/com/lahm/library/VirtualCheckCallback.java similarity index 80% rename from library/src/main/java/com/lahm/library/CheckCallback.java rename to library/src/main/java/com/lahm/library/VirtualCheckCallback.java index 80755e4..919fc8d 100644 --- a/library/src/main/java/com/lahm/library/CheckCallback.java +++ b/library/src/main/java/com/lahm/library/VirtualCheckCallback.java @@ -5,6 +5,6 @@ * Package Name:com.lahm.library * Created by lahm on 2018/7/25 14:22 . */ -public interface CheckCallback { +public interface VirtualCheckCallback { void findSuspect(); }