导航菜单

页面标题

页面副标题

AdaModal v1.4.0 - InstallReferrerReceiver.java 源代码

正在查看: AdaModal v1.4.0 应用的 InstallReferrerReceiver.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.common.fine.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.blankj.utilcode.util.LogUtils;
import com.common.fine.instance.ParamsInstance;
import com.common.fine.utils.preference.ESPUtils;
import java.net.URLDecoder;

public class InstallReferrerReceiver extends BroadcastReceiver {
    public static final String REFERRER_KEY = "referrer";

    public static void saveReferrer(String str) {
        ESPUtils.getInstance().put(REFERRER_KEY, str);
        ParamsInstance.getInstance().updateRefer(str);
    }

    public static String readReferrer() {
        return ESPUtils.getInstance().getString(REFERRER_KEY);
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        String stringExtra = intent.getStringExtra(REFERRER_KEY);
        if (stringExtra != null) {
            try {
                String decode = URLDecoder.decode(stringExtra, "UTF-8");
                LogUtils.d("Referrer: " + decode);
                saveReferrer(decode);
                return;
            } catch (Exception unused) {
                return;
            }
        }
        LogUtils.e("Referrer is null");
    }
}