试玩
支付失败,请检查网络设置
Hook成功
Hook代码
import android.app.Application;
import android.content.Context;import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;public class HookComYoDo1Ctr2A4399_1 extends HookImpl {@Overridepublic String packageName() {return "com.yodo1.ctr2.A4399_1";}@Overridepublic String appName() {return "割绳子";}@Overridepublic void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {// 先hookApplicationXposedHelpers.findAndHookMethod(Application.class,"attach",Context.class,new XC_MethodHook() {@Overrideprotected void beforeHookedMethod(MethodHookParam param) throws Throwable {super.beforeHookedMethod(param);// 获取上下文Context context = (Context) param.args[0];// 获取类加载器ClassLoader classLoader = context.getClassLoader();// 获取自定义的类final Class<?> productData = XposedHelpers.findClass("com.yodo1.android.sdk.helper.ProductData",classLoader);// 获取自定义的类final Class<?> payType = XposedHelpers.findClass("com.yodo1.android.sdk.constants.PayType",classLoader);// @Override // com.yodo1.android.sdk.callback.Yodo1PurchaseListener// public void purchased(int code, String orderId, ProductData productData, PayType payType) {// String productId = productData.getProductId();// if (code == 1) {// Yodo1GameSDK.paySuccess(productId);// YLog.d("sdk通知支付成功,开始和ops校验订单... ");// } else if (code == 2) {// YLog.d("sdk通知取消支付 ");// Yodo1GameSDK.payCancel(productId);// } else {// YLog.d("sdk通知支付失败 ");// Yodo1GameSDK.payFail(productId);// }// }XposedHelpers.findAndHookMethod("com.zeptolab.sdk.ui.Yodo1Pay$8",classLoader,"purchased",int.class,String.class,productData,payType,new XC_MethodHook() {@Overrideprotected void beforeHookedMethod(MethodHookParam param) throws Throwable {super.beforeHookedMethod(param);param.args[0] = 1;}});}});}private static final class TestApplication extends Application {/*final void attach(Context context) {attachBaseContext(context);mLoadedApk = ContextImpl.getImpl(context).mPackageInfo;}*/@Overrideprotected void attachBaseContext(Context base) {super.attachBaseContext(base);}}
}