admin
2025-02-26 daea6f9a47aae244b5fa02b5c790519934711760
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.lcjian.library.util.common;
 
import android.content.Context;
import android.os.Build;
 
import com.lcjian.library.util.ManifestDataUtil;
 
public class AndroidManifestUtil {
 
    public static String getChannel(Context context) {
        String channel = ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL");
        if ("huawei".equalsIgnoreCase(channel)) {
            String deviceModel = Build.BRAND;
            if ("honor".equalsIgnoreCase(deviceModel)) {
                return "honor";
            }
        }
        return channel;
    }
 
    public static boolean isHuaWeiChannel(Context context) {
        return "huawei".equalsIgnoreCase(getChannel(context));
    }
 
    public static boolean isOppoChannel(Context context) {
        return "oppo".equalsIgnoreCase(getChannel(context));
    }
 
    public static boolean isVIVOChannel(Context context) {
        return "vivo".equalsIgnoreCase(getChannel(context));
    }
 
}