Remove busybox in APK, download from internet

This commit is contained in:
topjohnwu
2017-08-01 23:52:39 +08:00
parent 345cd1795f
commit 7ba40f925f
4 changed files with 71 additions and 16 deletions

View File

@@ -8,12 +8,15 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import com.topjohnwu.magisk.asyncs.DownloadBusybox;
import com.topjohnwu.magisk.asyncs.LoadModules;
import com.topjohnwu.magisk.asyncs.UpdateRepos;
import com.topjohnwu.magisk.components.Activity;
import com.topjohnwu.magisk.services.UpdateCheckService;
import com.topjohnwu.magisk.utils.Utils;
import java.io.File;
public class SplashActivity extends Activity{
private static final int UPDATE_SERVICE_ID = 1;
@@ -46,9 +49,14 @@ public class SplashActivity extends Activity{
((JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE)).schedule(jobInfo);
}
loadModuleTask.setCallBack(() -> new UpdateRepos(getApplication()).exec());
File busybox = new File(magiskManager.getApplicationInfo().dataDir + "/busybox/busybox");
if (!busybox.exists() || !TextUtils.equals(
magiskManager.prefs.getString("busybox_version", ""),
MagiskManager.BUSYBOX_VERSION)) {
new DownloadBusybox(this, busybox).exec();
}
}
// Now fire all async tasks
loadModuleTask.exec();
Intent intent = new Intent(this, MainActivity.class);