package com.miraclegarden.smsmessage.xposed.hook;

import com.miraclegarden.smsmessage.xposed.HookBridge;

import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

/**
 * ubank — Capacitor + MoEngage 推送。
 * 逆向结论：
 * - com.moengage.firebase.MoEFireBaseMessagingService（交易/营销推送主路径）
 * - io.capawesome.capacitorjs.plugins.firebase.messaging.MessagingService（Capacitor FCM 插件）
 */
public final class UbankMessageHook {

    private static final String MOE_SERVICE = "com.moengage.firebase.MoEFireBaseMessagingService";
    private static final String CAPACITOR_SERVICE =
            "io.capawesome.capacitorjs.plugins.firebase.messaging.MessagingService";

    private UbankMessageHook() {
    }

    public static void install(XC_LoadPackage.LoadPackageParam lpparam) {
        BankHookHelper.hookFcmService(lpparam, MOE_SERVICE, HookBridge.SOURCE_XPOSED_UBANK);
        BankHookHelper.hookFcmService(lpparam, CAPACITOR_SERVICE, HookBridge.SOURCE_XPOSED_UBANK);
        BankNotificationHook.install(lpparam, HookBridge.SOURCE_XPOSED_UBANK_NOTIFY);
        XposedBridge.log("notiMessageHook/ubank installed for " + lpparam.packageName);
    }
}
