Commit baae3592 authored by topjohnwu's avatar topjohnwu

Small cleanup

parent 2cdb6b81
...@@ -32,10 +32,11 @@ repositories { ...@@ -32,10 +32,11 @@ repositories {
dependencies { dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs') compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:24.2.0' compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.0' compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.0' compile 'com.android.support:design:24.2.1'
compile 'com.jakewharton:butterknife:8.4.0' compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.github.michalis-vitos:aFileChooser:master' compile 'com.github.michalis-vitos:aFileChooser:master'
compile 'com.google.code.gson:gson:2.7'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
} }
...@@ -7,7 +7,6 @@ import android.support.annotation.Nullable; ...@@ -7,7 +7,6 @@ import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.content.FileProvider; import android.support.v4.content.FileProvider;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.Html;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -15,6 +14,7 @@ import android.widget.ImageView; ...@@ -15,6 +14,7 @@ import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import com.topjohnwu.magisk.utils.Async;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Utils;
import java.io.File; import java.io.File;
...@@ -112,7 +112,7 @@ public class MagiskFragment extends Fragment { ...@@ -112,7 +112,7 @@ public class MagiskFragment extends Fragment {
new Utils.DownloadReceiver(getString(R.string.magisk)) { new Utils.DownloadReceiver(getString(R.string.magisk)) {
@Override @Override
public void task(File file) { public void task(File file) {
new Utils.FlashZIP(mContext, mName, file.getPath()).execute(); new Async.FlashZIP(mContext, mName, file.getPath()).execute();
} }
}, },
Utils.magiskLink, "latest_magisk.zip"); Utils.magiskLink, "latest_magisk.zip");
......
...@@ -21,6 +21,7 @@ import android.widget.LinearLayout; ...@@ -21,6 +21,7 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.topjohnwu.magisk.module.Module; import com.topjohnwu.magisk.module.Module;
import com.topjohnwu.magisk.utils.Async;
import com.topjohnwu.magisk.utils.Shell; import com.topjohnwu.magisk.utils.Shell;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Utils;
import com.topjohnwu.magisk.utils.WebWindow; import com.topjohnwu.magisk.utils.WebWindow;
...@@ -109,7 +110,7 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold ...@@ -109,7 +110,7 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
@Override @Override
public void task(File file) { public void task(File file) {
Log.d("Magisk", "Task firing"); Log.d("Magisk", "Task firing");
new Utils.FlashZIP(context, mModule.getId(), file.toString()).execute(); new Async.FlashZIP(context, mModule.getId(), file.toString()).execute();
} }
}; };
String filename = mModule.getId().replace(" ", "") + ".zip"; String filename = mModule.getId().replace(" ", "") + ".zip";
......
...@@ -16,7 +16,7 @@ import android.widget.CheckBox; ...@@ -16,7 +16,7 @@ import android.widget.CheckBox;
import android.widget.TextView; import android.widget.TextView;
import com.topjohnwu.magisk.module.Module; import com.topjohnwu.magisk.module.Module;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Async;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -44,7 +44,7 @@ public class ModulesFragment extends Fragment { ...@@ -44,7 +44,7 @@ public class ModulesFragment extends Fragment {
mSwipeRefreshLayout.setOnRefreshListener(() -> { mSwipeRefreshLayout.setOnRefreshListener(() -> {
recyclerView.setVisibility(View.GONE); recyclerView.setVisibility(View.GONE);
new Utils.LoadModules(getActivity()).execute(); new Async.LoadModules(getActivity()).execute();
new updateUI().execute(); new updateUI().execute();
prefs.edit().putBoolean("ignoreUpdateAlerts", false).apply(); prefs.edit().putBoolean("ignoreUpdateAlerts", false).apply();
......
...@@ -32,7 +32,7 @@ public class QuickSettingTileService extends TileService { ...@@ -32,7 +32,7 @@ public class QuickSettingTileService extends TileService {
Icon iconAuto = Icon.createWithResource(getApplicationContext(), R.drawable.ic_autoroot); Icon iconAuto = Icon.createWithResource(getApplicationContext(), R.drawable.ic_autoroot);
Tile tile = this.getQsTile(); Tile tile = this.getQsTile();
boolean autoRootStatus = Utils.autoRootEnabled(getApplicationContext()); boolean autoRootStatus = Utils.autoRootEnabled(getApplicationContext());
boolean rootStatus = Utils.rootStatus(); boolean rootStatus = Utils.rootEnabled();
Log.d("Magisk", "QST: Auto and root are " + autoRootStatus + " and " + rootStatus); Log.d("Magisk", "QST: Auto and root are " + autoRootStatus + " and " + rootStatus);
if (autoRootStatus) { if (autoRootStatus) {
tile.setLabel("Auto-root"); tile.setLabel("Auto-root");
......
...@@ -21,6 +21,7 @@ import android.widget.TextView; ...@@ -21,6 +21,7 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.topjohnwu.magisk.module.Repo; import com.topjohnwu.magisk.module.Repo;
import com.topjohnwu.magisk.utils.Async;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Utils;
import com.topjohnwu.magisk.utils.WebWindow; import com.topjohnwu.magisk.utils.WebWindow;
...@@ -150,7 +151,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder> ...@@ -150,7 +151,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
@Override @Override
public void task(File file) { public void task(File file) {
Log.d("Magisk", "Task firing"); Log.d("Magisk", "Task firing");
new Utils.FlashZIP(context, repo.getId(), file.toString()).execute(); new Async.FlashZIP(context, repo.getId(), file.toString()).execute();
} }
}; };
String filename = repo.getId().replace(" ", "") + ".zip"; String filename = repo.getId().replace(" ", "") + ".zip";
......
...@@ -17,6 +17,7 @@ import android.widget.TextView; ...@@ -17,6 +17,7 @@ import android.widget.TextView;
import com.topjohnwu.magisk.module.Repo; import com.topjohnwu.magisk.module.Repo;
import com.topjohnwu.magisk.module.RepoHelper; import com.topjohnwu.magisk.module.RepoHelper;
import com.topjohnwu.magisk.utils.Async;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Utils;
import java.io.File; import java.io.File;
...@@ -133,7 +134,7 @@ public class ReposFragment extends Fragment { ...@@ -133,7 +134,7 @@ public class ReposFragment extends Fragment {
@Override @Override
public void task(File file) { public void task(File file) {
Log.d("Magisk", "Task firing"); Log.d("Magisk", "Task firing");
new Utils.FlashZIP(getActivity(), repo.getId(), file.toString()).execute(); new Async.FlashZIP(getActivity(), repo.getId(), file.toString()).execute();
} }
}; };
String filename = repo.getId().replace(" ", "") + ".zip"; String filename = repo.getId().replace(" ", "") + ".zip";
......
...@@ -24,6 +24,7 @@ import android.view.MenuItem; ...@@ -24,6 +24,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import com.topjohnwu.magisk.module.RepoHelper; import com.topjohnwu.magisk.module.RepoHelper;
import com.topjohnwu.magisk.utils.Async;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Utils;
import butterknife.BindView; import butterknife.BindView;
...@@ -72,16 +73,16 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView ...@@ -72,16 +73,16 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
} }
new Utils.Initialize(this).execute(); Utils.init(this);
new Utils.CheckUpdates(this).execute(); new Async.CheckUpdates(this).execute();
RepoHelper.TaskDelegate delegate = result -> { RepoHelper.TaskDelegate delegate = result -> {
//Do a thing here when we get a result we want //Do a thing here when we get a result we want
}; };
new Utils.LoadModules(this).execute(); new Async.LoadModules(this).execute();
new Utils.LoadRepos(this, true, delegate).execute(); new Async.LoadRepos(this, true, delegate).execute();
new Utils.LoadRepos(this, !prefs.contains("hasCachedRepos"), delegate).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new Async.LoadRepos(this, !prefs.contains("hasCachedRepos"), delegate).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new Utils.LoadModules(getApplication()).execute(); new Async.LoadModules(getApplication()).execute();
new Utils.LoadRepos(this, false, delegate).execute(); new Async.LoadRepos(this, false, delegate).execute();
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ buildscript { ...@@ -6,7 +6,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-rc1' classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment