Skip to content

Commit

Permalink
优化系统应用卸载的remount过程
Browse files Browse the repository at this point in the history
  • Loading branch information
ichtj committed Jul 2, 2024
1 parent b60a427 commit 2cc4ee9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ public static boolean uninstallSilent(boolean isSys, boolean isReboot, String ap
}catch(Throwable throwable){
}
}
ShellUtils.CommandResult mount=ShellUtils.execCommand("mount -o rw,remount -t ext4 /system",true);
if (mount.result!=0){
mount=ShellUtils.execCommand("mount -o rw,remount /",true);
}
String[] cmd = new String[]{
"mount -o rw,remount -t ext4 /system",
"rm -rf /system/priv-app/" + appName,
"rm -rf /system/app/" + appName,
"pm uninstall " + packageName,
(!apkPath.equals("")&&isSys)?"rm -rf "+apkPath+"*":"",
isSys?(!apkPath.equals("")?"rm -rf "+apkPath+"*":""):"pm uninstall " + packageName,
isReboot ? "reboot" : ""
};
ShellUtils.CommandResult commandResult = ShellUtils.execCommand(cmd, isRoot());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static void reset() {
}

private static void createDialog(Context context, @DrawableRes int icon, String title,
String content, final boolean needEnter) {
String content, final boolean isInput) {
if (instance().mDialog == null) {
instance().isClickBtn=false;
AlertDialog.Builder builder = new AlertDialog.Builder(context);
Expand All @@ -110,21 +110,22 @@ public void onDismiss(DialogInterface dialog) {
}
});
instance().etContent = view.findViewById(R.id.etContent);
instance().etContent.setBackground(needEnter?ContextCompat.getDrawable(context,R.drawable.ic_dialogalert_bg):null);
instance().etContent.setBackground(isInput?ContextCompat.getDrawable(context,R.drawable.ic_dialogalert_bg):null);
instance().tvTitle = view.findViewById(R.id.tvTitle);
if(!needEnter){
if(!isInput){
instance().tvTitle.setFocusable(true);
instance().etContent.setGravity(Gravity.CENTER);
instance().etContent.setLongClickable(false);
instance().etContent.setClickable(false);
instance().etContent.setEnabled(false);
instance().mDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
instance().etContent.setText(needEnter?"":content);
instance().etContent.setText(isInput?"":content);
instance().tvTitle.setText(title);
instance().etContent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(needEnter){
if(isInput){
if(instance().isShowBoard){
KeyBoardUtils.openKeybord(instance().etContent);
instance().isShowBoard=false;
Expand Down

0 comments on commit 2cc4ee9

Please sign in to comment.