// Path: utilslibrary/src/main/java/com/devin/UtilManager.java
// public class UtilManager {
// 
//     private static Context mContext;
// 
//     /**
//      * 初始化工具类集合
//      * @param context  context
//      */
//     public static void init(Context context) {
//         mContext = context.getApplicationContext();
//     }
// 
//     public static Context getContext() {
//         return mContext;
//     }
// }


import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import com.devin.UtilManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
     * @return
     */
    public static List<String> getPermissionsList() {
        List<String> permissionsList = new ArrayList<>();
        try {
            PackageInfo packageInfo = UtilManager.getContext().getPackageManager()
                    .getPackageInfo(UtilManager.getContext().getPackageName(),
                            PackageManager.GET_PERMISSIONS);
            String[] permissions = packageInfo.requestedPermissions;
            Collections.addAll(permissionsList, permissions);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return permissionsList;
    }




    /**
     * 获取manifest里的meta-data 数据，可以用来获取渠道名称等
     *
     * @return 失败时会返回null
     */
    public static String getMetaData(String keyName) {

        try {
            ApplicationInfo packageInfo = UtilManager.getContext().getPackageManager()
                    .getApplicationInfo(UtilManager.getContext().getPackageName(),
                            PackageManager.GET_META_DATA);
// Path: utilslibrary/src/main/java/com/devin/UtilManager.java
// public class UtilManager {
// 
//     private static Context mContext;
// 
//     /**
//      * 初始化工具类集合
//      * @param context  context
//      */
//     public static void init(Context context) {
//         mContext = context.getApplicationContext();
//     }
// 
//     public static Context getContext() {
//         return mContext;
//     }
// }


// Path: utilslibrary/src/main/java/com/devin/util/AppInfo.java
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import com.devin.UtilManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

     * @return
     */
    public static List<String> getPermissionsList() {
        List<String> permissionsList = new ArrayList<>();
        try {
            PackageInfo packageInfo = UtilManager.getContext().getPackageManager()
                    .getPackageInfo(UtilManager.getContext().getPackageName(),
                            PackageManager.GET_PERMISSIONS);
            String[] permissions = packageInfo.requestedPermissions;
            Collections.addAll(permissionsList, permissions);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return permissionsList;
    }




    /**
     * 获取manifest里的meta-data 数据，可以用来获取渠道名称等
     *
     * @return 失败时会返回null
     */
    public static String getMetaData(String keyName) {

        try {
            ApplicationInfo packageInfo = UtilManager.getContext().getPackageManager()
                    .getApplicationInfo(UtilManager.getContext().getPackageName(),
                            PackageManager.GET_META_DATA);
            Object o = packageInfo.metaData.get(keyName);