Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon: some samsung devices using incorrect mediatek-res path #8493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vvb2060
Copy link
Collaborator

@vvb2060 vvb2060 commented Oct 21, 2024

    private static final String MEDIATEK_APK_PATH = "/system/app/mediatek-res/mediatek-res.apk";
    private static final String PROPERTY_MTK_MODEL = "ro.vendor.mtk_model";

    public static void createSystemAssetsInZygoteLocked(boolean reinitialize, String frameworkPath) {
        if (sSystem != null && !reinitialize) {
            return;
        }
        try {
            ArrayList<ApkAssets> apkAssets = new ArrayList<>();
            apkAssets.add(ApkAssets.loadFromPath(frameworkPath, 1));
            String[] systemIdmapPaths = OverlayConfig.getZygoteInstance().createImmutableFrameworkIdmapsInZygote();
            for (String idmapPath : systemIdmapPaths) {
                apkAssets.add(ApkAssets.loadOverlayFromPath(idmapPath, 1));
            }
            if ("1".equals(SystemProperties.get(PROPERTY_MTK_MODEL))) {
                apkAssets.add(ApkAssets.loadFromPath(MEDIATEK_APK_PATH, 1));
            }
            sSystemApkAssetsSet = new ArraySet<>(apkAssets);
            sSystemApkAssets = (ApkAssets[]) apkAssets.toArray(new ApkAssets[apkAssets.size()]);
            if (sSystem == null) {
                sSystem = new AssetManager(true);
            }
            sSystem.setApkAssets(sSystemApkAssets, false);
        } catch (IOException e) {
            throw new IllegalStateException("Failed to create system AssetManager", e);
        }
    }

@vvb2060 vvb2060 linked an issue Oct 21, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

magisk does not open after One Ui 6 update
1 participant