|
33 | 33 | import android.os.Environment; |
34 | 34 | import android.provider.OpenableColumns; |
35 | 35 | import android.view.Menu; |
36 | | -import android.view.View; |
37 | | -import android.widget.CheckBox; |
38 | 36 |
|
39 | 37 | import com.smartpack.kernelmanager.R; |
40 | 38 | import com.smartpack.kernelmanager.activities.FlashingActivity; |
@@ -631,23 +629,16 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { |
631 | 629 | Utils.snackbar(getRootView(), getString(R.string.wrong_extension, ".zip")); |
632 | 630 | return; |
633 | 631 | } |
634 | | - if (mPath.contains("(") || mPath.contains(")")) { |
635 | | - Utils.snackbar(getRootView(), getString(R.string.file_name_error)); |
636 | | - } |
637 | | - if (SmartPack.fileSize(new File(mPath)) >= 100000000) { |
638 | | - Utils.snackbar(getRootView(), getString(R.string.file_size_limit, (SmartPack.fileSize(new File(mPath)) / 1000000))); |
639 | | - } |
640 | | - Dialog manualFlash = new Dialog(requireActivity()); |
641 | | - manualFlash.setIcon(R.mipmap.ic_launcher); |
642 | | - manualFlash.setTitle(getString(R.string.flasher)); |
643 | | - manualFlash.setMessage(getString(R.string.sure_message, new File(mPath).getName()) + ("\n\n") + |
644 | | - getString(R.string.warning) + (" ") + getString(R.string.flasher_warning)); |
645 | | - manualFlash.setNeutralButton(getString(R.string.cancel), (dialogInterface, i) -> { |
646 | | - }); |
647 | | - manualFlash.setPositiveButton(getString(R.string.flash), (dialogInterface, i) -> { |
648 | | - flashingTask(new File(mPath)); |
649 | | - }); |
650 | | - manualFlash.show(); |
| 632 | + new Dialog(requireActivity()) |
| 633 | + .setIcon(R.mipmap.ic_launcher) |
| 634 | + .setTitle(getString(R.string.flasher)) |
| 635 | + .setMessage(getString(R.string.sure_message, new File(mPath).getName()) + (SmartPack.fileSize(new File(mPath)) >= 100000000 ? |
| 636 | + ("\n\n") + getString(R.string.file_size_limit, (SmartPack.fileSize(new File(mPath)) / 1000000)) : "")) |
| 637 | + .setNegativeButton(getString(R.string.cancel), (dialogInterface, i) -> { |
| 638 | + }) |
| 639 | + .setPositiveButton(getString(R.string.flash), (dialogInterface, i) -> { |
| 640 | + flashingTask(new File(mPath)); |
| 641 | + }).show(); |
651 | 642 | } |
652 | 643 | } |
653 | 644 |
|
|
0 commit comments