public String getString(String resName, Object... args) {
        if (!PkgUtils.isPkgInstalled(this.context, appPackageName)) {
            // Return cache.
            String cachedString = S_STRING_RES_CACHE.get(resName);
            if (cachedString != null) {
                return String.format(cachedString, args);
            }
            return resName;
        }
        Context context = getContext();
        if (context == null) {
            Log.e(LOG_TAG, "Context is null!!!");
            return null;
        }
        try {
            Context appContext =
                    context.createPackageContext(appPackageName, CONTEXT_IGNORE_SECURITY);
            Resources res = appContext.getResources();
            int id = res.getIdentifier(resName, "string", appPackageName);
            Log.d(LOG_TAG, "getString get id: " + id + ", for res: " + resName);
            if (id != 0) {
                String string = res.getString(id, args);
                S_STRING_RES_CACHE.put(resName, string);
                return string;
            }
        } catch (Throwable e) {
            Log.e(LOG_TAG, "Fail createPackageContext: " + 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