Skip to content

Commit

Permalink
Fix FlashActivity crash
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Sep 15, 2018
1 parent 78534de commit af7c6f9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/src/full/java/com/topjohnwu/magisk/ViewBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static void bind(FlashActivity target) {
target.toolbar = target.findViewById(R.id.toolbar);
target.flashLogs = target.findViewById(R.id.txtLog);
target.buttonPanel = target.findViewById(R.id.button_panel);
target.sv = target.findViewById(R.id.scrollView);
target.findViewById(R.id.no_thanks).setOnClickListener(v -> target.finish());
target.findViewById(R.id.reboot).setOnClickListener(v -> target.reboot());
target.findViewById(R.id.save_logs).setOnClickListener(v -> target.saveLogs());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.FlashActivity;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.components.BaseActivity;
import com.topjohnwu.magisk.components.SnackbarMaker;
Expand Down Expand Up @@ -141,7 +140,7 @@ protected void onPostExecute(Boolean result) {
if (result) {
Uri uri = Uri.fromFile(mFile);
if (mInstall) {
Intent intent = new Intent(activity, FlashActivity.class);
Intent intent = new Intent(activity, a.f.class);
intent.setData(uri).putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_ZIP);
activity.startActivity(intent);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.google.android.material.snackbar.Snackbar;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.FlashActivity;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.receivers.DownloadReceiver;
import com.topjohnwu.magisk.utils.Download;
Expand Down Expand Up @@ -38,7 +37,7 @@ class InstallMethodDialog extends AlertDialog.Builder {
(requestCode, resultCode, data) -> {
if (requestCode == Const.ID.SELECT_BOOT &&
resultCode == BaseActivity.RESULT_OK && data != null) {
Intent i = new Intent(activity, FlashActivity.class)
Intent i = new Intent(activity, a.f.class)
.putExtra(Const.Key.FLASH_SET_BOOT, data.getData())
.putExtra(Const.Key.FLASH_ACTION, Const.Value.PATCH_BOOT);
activity.startActivity(i);
Expand All @@ -56,7 +55,7 @@ public void onDownloadDone(Context context, Uri uri) {
}, Data.magiskLink, filename);
break;
case 2:
intent = new Intent(activity, FlashActivity.class)
intent = new Intent(activity, a.f.class)
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_MAGISK);
activity.startActivity(intent);
break;
Expand All @@ -66,7 +65,7 @@ public void onDownloadDone(Context context, Uri uri) {
.setMessage(R.string.install_inactive_slot_msg)
.setCancelable(true)
.setPositiveButton(R.string.yes, (d, i) -> {
Intent it = new Intent(activity, FlashActivity.class)
Intent it = new Intent(activity, a.f.class)
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_INACTIVE_SLOT);
activity.startActivity(it);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.FlashActivity;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.receivers.DownloadReceiver;
Expand Down Expand Up @@ -45,7 +44,7 @@ public UninstallDialog(@NonNull Activity activity) {
Download.receive(activity, new DownloadReceiver() {
@Override
public void onDownloadDone(Context context, Uri uri) {
Intent intent = new Intent(context, FlashActivity.class)
Intent intent = new Intent(context, a.f.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setData(uri)
.putExtra(Const.Key.FLASH_ACTION, Const.Value.UNINSTALL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import android.widget.TextView;

import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.FlashActivity;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.ViewBinder;
import com.topjohnwu.magisk.adapters.ModulesAdapter;
Expand Down Expand Up @@ -91,7 +90,7 @@ public void onPublish(int topic, Object[] result) {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == Const.ID.FETCH_ZIP && resultCode == Activity.RESULT_OK && data != null) {
// Get the URI of the selected file
Intent intent = new Intent(getActivity(), FlashActivity.class);
Intent intent = new Intent(getActivity(), a.f.class);
intent.setData(data.getData()).putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_ZIP);
startActivity(intent);
}
Expand Down

0 comments on commit af7c6f9

Please sign in to comment.