Skip to content

Commit

Permalink
checker-pine
Browse files Browse the repository at this point in the history
  • Loading branch information
simplepeng committed Jun 18, 2022
1 parent 07741b5 commit e1889af
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ public static Context getAppContext(Context context) {
}

public static void showWarn(String text) {
StringBuilder builder = new StringBuilder();
builder.append("Warning!!!").append("\n\n");
builder.append("非法使用了不合规的方法: ").append("\n\n");
builder.append(text);
toast(builder.toString());
log(text);

String builder = "Warning!!!" + " ---> " + text;
toast(builder);
}

static void toast(String text) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.simple.checker.hookers;

import java.net.NetworkInterface;

import me.simple.checker.CheckerHelper;
import top.canyie.pine.Pine;
import top.canyie.pine.callback.MethodHook;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
public class SecureHooker {

public static void hook() throws NoSuchMethodException {
hookAndroidId();
hookGetAndroidId();
}

private static void hookAndroidId() throws NoSuchMethodException {
private static void hookGetAndroidId() throws NoSuchMethodException {
Pine.hook(Settings.Secure.class.getDeclaredMethod("getString", ContentResolver.class, String.class), new MethodHook() {
@Override
public void beforeCall(Pine.CallFrame callFrame) throws Throwable {
super.beforeCall(callFrame);
try {
if (TextUtils.equals(Settings.Secure.ANDROID_ID, (String) callFrame.args[1])) {
CheckerHelper.showWarn("AndroidId");
CheckerHelper.showWarn("getAndroidId");
}
} catch (Throwable throwable) {
throwable.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ public class TelephonyHooker {
public static void hook() throws NoSuchMethodException {
hookGetDeviceId();
hookGetDeviceIdWithInt();

hookGetImei();
hookGetImeiWithInt();

hookGetSubscriberId();
hookGetSubscriberIdWithInt();
}
Expand Down
7 changes: 4 additions & 3 deletions checker/src/main/java/me/simple/checker/CheckerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ public static Context getAppContext(Context context) {
}

public static void showWarn(String text) {
log(text);

StringBuilder builder = new StringBuilder();
builder.append("Warning!!!").append("\n\n");
builder.append("非法使用了不合规的方法: ").append("\n\n");
builder.append("Warning!!!");
builder.append("非法使用了不合规的方法: ");
builder.append(text);
toast(builder.toString());
log(text);
}

static void toast(String text) {
Expand Down

0 comments on commit e1889af

Please sign in to comment.