DVDAndroid / XposedInstaller

Materialised Xposed Installer
https://forum.xda-developers.com/xposed/material-design-xposed-installer-t3137758
269 stars 57 forks source link

Add code for installing ZIPs directly via the app #109

Closed rovo89 closed 8 years ago

rovo89 commented 8 years ago

This is compatible with all flashable Xposed ZIPs, probably even with unofficial ones. It obviously requires root access and a modifiable /system partition. Systemless is still WIP and might need a few more changes in the future.

If the interface is usable, other installation methods (auto/manual flashing) could be re-implemented in the same way. Additionally, the checks could be extended to check compatiblility with the current ROM.

rovo89 commented 8 years ago

You can consider this as WIP, feedback is very welcome. I tested it with this:

InstallDirect.install("/sdcard/xposed.zip",new LogCallback(), true);

With the following callback class:

package de.robv.android.xposed.installer.installation;

import android.util.Log;

import de.robv.android.xposed.installer.XposedApp;

public class LogCallback implements InstallCallback {
    @Override
    public void onStarted() {
        Log.i(XposedApp.TAG, "started");
    }

    @Override
    public void onLine(String line) {
        Log.i(XposedApp.TAG, "stdout: " + line);
    }

    @Override
    public void onErrorLine(String line) {
        Log.e(XposedApp.TAG, "stderr: " + line);
    }

    @Override
    public void onDone() {
        Log.i(XposedApp.TAG, "done");
    }

    @Override
    public void onError(int exitCode, String error) {
        Log.e(XposedApp.TAG, "error: " + error);
    }
}

The real implementation should create and display a more or less empty dialog in onStarted() and add more lines to the log in onLine() and onErrorLine() (the latter in red). onDone() could add a final success message/icon and offer to reboot. onError() could be similar. In case root access is denied, only onError() is called.