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

Bypassing authorization #79

Open
ScreamZ opened this issue May 5, 2023 · 1 comment
Open

Bypassing authorization #79

ScreamZ opened this issue May 5, 2023 · 1 comment

Comments

@ScreamZ
Copy link

ScreamZ commented May 5, 2023

Hi @mikehardy (you're everywhere ! RN Firebase, here, ;))

Thank you for this awesome library that is doing well.
I'm currently working on improving the doc a bit and adding typescript support.

I'm using this library for a kiosk station far away from the company headquarters and while I'm using Expo with code push updates, I would like someday to be able to update the native code.
Everything works well, despite I would like to bypass the modal asking for installing the APK ("Would you kike to update this application? Your data won't be lost).
As the tablet is black-boxed, there is no interaction on it from the user, you need to use a screwdriver and wire USB peripherals to gain access to the interface, which is something I would like to avoid.

I have no access to the Play Store, do you have any idea how to proceed?

Thanks

@ScreamZ
Copy link
Author

ScreamZ commented May 10, 2023

Have something like that, maybe we could add it to this library, will do some tests

    public static void rootInstallApk(File file) {
        PrintWriter printWriter;
        Process process = null;
        try {
            process = Runtime.getRuntime().exec("su");
            printWriter = new PrintWriter(process.getOutputStream());
//            printWriter.println("pm install -r " + file.toString()+"; reboot");
            String packageName = Global.application.getPackageName();
            printWriter.println("pm install -r " + file.toString()+"; am start -n "+packageName+"/com.app.FullscreenActivity");
            printWriter.flush();
            printWriter.close();
            process.waitFor();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (process != null){
                process.destroy();
            }
        }
    }

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

1 participant