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

Fix OTA updates possible? #40

Closed
high3eam opened this issue Aug 6, 2023 · 2 comments
Closed

Fix OTA updates possible? #40

high3eam opened this issue Aug 6, 2023 · 2 comments

Comments

@high3eam
Copy link

high3eam commented Aug 6, 2023

I was wondering if it was possible to bring back OTA updates with this module or if there is a way to bring it back to life using lsposed modules? Would this be a good feature for KnoxPatch?

@salvogiangri
Copy link
Owner

salvogiangri commented Aug 6, 2023

Receiving (and also downloading) OTA updates is possible when spoofing the bootloader lock prop (ro.boot.flash.locked) since that's all the FotaAgent app checks for:

package com.idm.fotaagent.enabler.utils;

import android.os.SemSystemProperties;
import com.samsung.android.fotaagent.common.log.Log;

enum BinaryStatusByFlashLocked implements BinaryStatus {
    OFFICIAL,
    CUSTOM,
    UNKNOWN;

    static final String KEY_PROPERTY = "ro.boot.flash.locked";

    static final int FLASH_UNKNOWN = -1;
    static final int FLASH_UNLOCKED = 0;
    static final int FLASH_LOCKED = 1;

    static BinaryStatus getBinaryStatus() {
        return valueOf(getFlashLocked());
    }

    private static int getFlashLocked() {
        return SemSystemProperties.getInt(KEY_PROPERTY, FLASH_UNKNOWN);
    }

    @Override
    public String toString() {
        return name().charAt(0) + name().substring(1).toLowerCase() + " (checked by " + KEY_PROPERTY + ")";
    }

    private static BinaryStatus valueOf(int flashLocked) {
        switch(flashLocked) {
            case FLASH_UNKNOWN:
                return UNKNOWN;
            case FLASH_UNLOCKED:
                return CUSTOM;
            case FLASH_LOCKED:
                return OFFICIAL;
            default:
                Log.W("unexpected flashLocked (" + flashLocked + "), fallback as FLASH_UNKNOWN");
                return UNKNOWN;
        }
    }
}

Issue is they can't be installed due to how block-based OTAs work, so the only way to update a rooted device is via flashing a full firmware package with Odin (BL+CP+AP+HOME_CSC).

@salvogiangri salvogiangri closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2023
@high3eam
Copy link
Author

high3eam commented Aug 6, 2023

@blackmesa123 Thanks for the detailed explanation.

@salvogiangri salvogiangri pinned this issue Sep 4, 2023
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

No branches or pull requests

2 participants