Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Android中调用Android su命令修改/system时,该命令不起作用_Java_Android_Checkbox_Root - Fatal编程技术网

Java 在Android中调用Android su命令修改/system时,该命令不起作用

Java 在Android中调用Android su命令修改/system时,该命令不起作用,java,android,checkbox,root,Java,Android,Checkbox,Root,我基本上有一个简单的android导航抽屉,里面有一些片段,我有一个复选框,从主活动中放置的片段中调用,然后单击该复选框时执行一个根命令,该命令应该修改/system中的build.prop文件,但不幸的是,它似乎不起作用,我在日志中看到了--> 这是我片段的代码 /* * Copyright (C) 2013 Carbon Development * * Licensed under the Apache License, Version 2.0 (the "License"); *

我基本上有一个简单的android导航抽屉,里面有一些片段,我有一个复选框,从主活动中放置的
片段中调用,然后单击该复选框时执行一个根命令,该命令应该修改/system中的build.prop文件,但不幸的是,它似乎不起作用,我在日志中看到了-->

这是我片段的代码

/*
 * Copyright (C) 2013 Carbon Development
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.adromo.tweaker.fragments;

import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.adromo.tweaker.R;

public class InitD extends PreferenceFragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.initd, container, false);


    }

    }
我使用的库名为
rootcommands
(我认为这不重要,因为我尝试的每个库都会给出相同的精确结果)
我正在SGS4上运行android lolipop 5.0.1,请确保您已以读写方式挂载/系统

运行此命令以安装r/w:

mount -o remount,rw /system
要再次安装只读,请执行以下操作:

mount -o remount,ro /system
永远不要忘记这一点,否则您将无法向/system写入信息。

请检查此链接,它会有所帮助。。
mount -o remount,rw /system
mount -o remount,ro /system