mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-03-26 16:20:52 +00:00
52 lines
1.8 KiB
Java
52 lines
1.8 KiB
Java
package com.topjohnwu.magisk;
|
|
|
|
import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.os.Bundle;
|
|
import android.preference.PreferenceManager;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
|
import com.topjohnwu.magisk.utils.Async;
|
|
import com.topjohnwu.magisk.utils.Logger;
|
|
import com.topjohnwu.magisk.utils.Utils;
|
|
|
|
public class SplashActivity extends AppCompatActivity {
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplication());
|
|
if (Utils.isDarkTheme(prefs.getString("theme", null), this)) {
|
|
setTheme(R.style.AppTheme_dh);
|
|
}
|
|
|
|
Logger.devLog = prefs.getBoolean("developer_logging", false);
|
|
Logger.logShell = prefs.getBoolean("shell_logging", false);
|
|
|
|
// Initialize prefs
|
|
prefs.edit()
|
|
.putBoolean("magiskhide", Utils.itemExist(false, "/magisk/.core/magiskhide/enable"))
|
|
.putBoolean("busybox", Utils.commandExists("busybox"))
|
|
.putBoolean("hosts", Utils.itemExist(false, "/magisk/.core/hosts"))
|
|
.apply();
|
|
|
|
// Start all async tasks
|
|
new Async.GetBootBlocks().exec();
|
|
new Async.CheckUpdates().exec();
|
|
Async.checkSafetyNet(getApplicationContext());
|
|
new Async.LoadModules() {
|
|
@Override
|
|
protected void onPostExecute(Void v) {
|
|
super.onPostExecute(v);
|
|
new Async.LoadRepos(getApplicationContext()).exec();
|
|
}
|
|
}.exec();
|
|
|
|
// Start main activity
|
|
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
|
|
startActivity(intent);
|
|
finish();
|
|
}
|
|
}
|