xposed调用某APP里面的POST方法函数

package com.tools.payhelper.pf;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import com.google.myjson.Gson;
import com.tools.payhelper.utils.LogUtil;
import de.robv.android.xposed.XposedHelpers;

public class PFHook {
    public static String QRCODERECEIVED_ACTION = "com.tools.payhelper.qrcodereceived";
    public static int index = 0;

    public static class PFReceived extends BroadcastReceiver {
        ClassLoader classLoader = null;
        Context context = null;

        public PFReceived(Context context, ClassLoader classLoader) {
            this.context = context;
            this.classLoader = classLoader;
        }

        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals("com.xxxxx.xxxxx.start")) {
                PFHook.checkUser(intent.getStringExtra("phoneNum"), context, this.classLoader);
            }
        }
    }

    public void hook(ClassLoader appClassLoader, Context context) {
    }

    private static void checkUser(final String phoneNum, final Context context, ClassLoader classLoader) {
        try {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append("pf开始查询...");
            stringBuilder.append(index);
            LogUtil.printLog(stringBuilder.toString());
            index++;
            StringBuilder stringBuilder2 = new StringBuilder();
            stringBuilder2.append(((long) index) + 667496031834684L);
            stringBuilder2.append("");
            PFRequestBean pFRequestBean = new PFRequestBean(stringBuilder2.toString(), "", "01", phoneNum, "5.1.7", "");
            XposedHelpers.callMethod(XposedHelpers.callStaticMethod(XposedHelpers.findClass("com.xxxxx.app.network.impl.TxCompatImpl", classLoader), "getInstance", new Object[0]), "post", new Object[]{context, "努力加载中,请稍后...", "https://mbank.spdbccc.com.cn/micrombank/login/check-user.do", new Gson().toJson((Object) pFRequestBean), new Handler() {
                public void handleMessage(Message msg) {
                    super.handleMessage(msg);
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.append("handleMessage:msg.what=");
                    stringBuilder.append(msg.what);
                    stringBuilder.append("|msg.arg1=");
                    stringBuilder.append(msg.arg1);
                    stringBuilder.append("|arg2=");
                    stringBuilder.append(msg.arg2);
                    stringBuilder.append("|obj=");
                    stringBuilder.append(msg.obj);
                    LogUtil.printLog(stringBuilder.toString());
                    Intent broadCastIntent = new Intent();
                    broadCastIntent.putExtra("money", "1");
                    broadCastIntent.putExtra("mark", phoneNum);
                    broadCastIntent.putExtra("type", "PF");
                    broadCastIntent.putExtra("payurl", msg.obj.toString());
                    broadCastIntent.setAction(PFHook.QRCODERECEIVED_ACTION);
                    context.sendBroadcast(broadCastIntent);
                }
            }, Boolean.valueOf(true), Boolean.valueOf(false), Boolean.valueOf(true), Boolean.valueOf(false)});
        } catch (Exception e) {
            e.printStackTrace();
            StringBuilder stringBuilder3 = new StringBuilder();
            stringBuilder3.append("pf,查询异常:");
            stringBuilder3.append(e);
            LogUtil.printLog(stringBuilder3.toString());
        }
    }
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

侠客软件开发

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值