mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-21 14:28:52 +00:00
Several small fixes
This commit is contained in:
@@ -49,7 +49,7 @@ public class FlashActivity extends Activity {
|
||||
|
||||
@OnClick(R.id.reboot)
|
||||
void reboot() {
|
||||
Shell.su_raw("reboot");
|
||||
Shell.su_raw("/system/bin/reboot");
|
||||
}
|
||||
|
||||
@OnClick(R.id.save_logs)
|
||||
|
@@ -230,20 +230,20 @@ public class MagiskFragment extends Fragment
|
||||
if (mm.remoteMagiskVersionCode < 0) {
|
||||
color = colorNeutral;
|
||||
image = R.drawable.ic_help;
|
||||
magiskUpdateText.setText(R.string.cannot_check_updates);
|
||||
magiskUpdateText.setText(R.string.invalid_update_channel);
|
||||
installButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
color = colorOK;
|
||||
image = R.drawable.ic_check_circle;
|
||||
magiskUpdateText.setText(getString(R.string.install_magisk_title, "v" + mm.remoteMagiskVersionString));
|
||||
}
|
||||
|
||||
installButton.setVisibility(View.VISIBLE);
|
||||
if (mm.remoteManagerVersionCode > BuildConfig.VERSION_CODE) {
|
||||
installText.setText(getString(R.string.update, getString(R.string.app_name)));
|
||||
} else if (mm.magiskVersionCode > 0 && mm.remoteMagiskVersionCode > mm.magiskVersionCode) {
|
||||
installText.setText(getString(R.string.update, getString(R.string.magisk)));
|
||||
} else {
|
||||
installText.setText(R.string.install);
|
||||
installButton.setVisibility(View.VISIBLE);
|
||||
if (mm.remoteManagerVersionCode > BuildConfig.VERSION_CODE) {
|
||||
installText.setText(getString(R.string.update, getString(R.string.app_name)));
|
||||
} else if (mm.magiskVersionCode > 0 && mm.remoteMagiskVersionCode > mm.magiskVersionCode) {
|
||||
installText.setText(getString(R.string.update, getString(R.string.magisk)));
|
||||
} else {
|
||||
installText.setText(R.string.install);
|
||||
}
|
||||
}
|
||||
|
||||
if (!shownDialog && (mm.remoteMagiskVersionCode > mm.magiskVersionCode
|
||||
|
@@ -85,12 +85,16 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
||||
// Check if we are linked globally
|
||||
List<String> ret = Shell.sh("ls -l " + suDbFile);
|
||||
if (Utils.isValidShellResponse(ret)) {
|
||||
int links = Integer.parseInt(ret.get(0).trim().split("\\s+")[1]);
|
||||
if (links < 2) {
|
||||
mm.suDB.close();
|
||||
suDbFile.delete();
|
||||
new File(suDbFile + "-journal").delete();
|
||||
mm.suDB = new SuDatabaseHelper();
|
||||
try {
|
||||
int links = Integer.parseInt(ret.get(0).trim().split("\\s+")[1]);
|
||||
if (links < 2) {
|
||||
mm.suDB.close();
|
||||
suDbFile.delete();
|
||||
new File(suDbFile + "-journal").delete();
|
||||
mm.suDB = new SuDatabaseHelper();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,6 @@ import com.topjohnwu.magisk.utils.Shell;
|
||||
public class RebootReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Shell.su_raw("reboot");
|
||||
Shell.su_raw("/system/bin/reboot");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user