public Bitmap getBitmap(String resName) {
        if (!PkgUtils.isPkgInstalled(this.context, appPackageName)) {
            return BitmapFactory.decodeResource(this.context.getResources(), android.R.drawable.stat_sys_warning);
        }
        if (DEBUG) {
            Log.d(LOG_TAG, "getBitmap, resName: " + resName);
        }
        try {
            Context appContext = getAppContext();
            if (appContext != null) {
                Resources res = appContext.getResources();
                if (DEBUG) {
                    Log.d(LOG_TAG, "getBitmap, res: " + res);
                }
                if (res != null) {
                    int id = res.getIdentifier(resName, "drawable", appPackageName);
                    if (DEBUG) {
                        Log.d(LOG_TAG, "getBitmap, id: " + id);
                    }
                    if (id > 0) {
                        Bitmap bitmap = BitmapFactory.decodeResource(res, id);
                        if (DEBUG) {
                            Log.d(LOG_TAG, "getBitmap, bitmap: " + bitmap);
                        }
                        if (bitmap != null) {
                            return bitmap;
                        } else {
                            return BitmapFactory.decodeResource(this.context.getResources(), android.R.drawable.stat_sys_warning);
                        }
                    }
                }
            }
        } catch (Throwable e) {
            Log.e(LOG_TAG, "Fail getBitmap: " + Log.getStackTraceString(e));
        }
        return null;
    }
Created by Tornaco on 2018/4/4 10:56.
God bless no bug!
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/AppResources.java