How to get the build.prop values?

后端 未结 8 866
梦谈多话
梦谈多话 2021-01-06 07:03

How do I get the build.prop values that are found in /system/build.prop without root access? How do I edit them?

相关标签:
8条回答
  • 2021-01-06 07:41

    On the setting page of your file manager, set home as /system, then you could browse system folders and copy build.prop and paste to sdcard. I'm still trying to root my phone but I have no problem tweaking on the way (no pun).

    0 讨论(0)
  • 2021-01-06 07:42

    To read properties using reflection on the hidden API :

    static public String getprop(String key){
        try { Class c = Class.forName("android.os.SystemProperties");
            try { Method method = c.getDeclaredMethod("get", String.class);
                try { return (String) method.invoke(null, key);
                }  catch (IllegalAccessException e) {e.printStackTrace();}
                catch (InvocationTargetException e) {e.printStackTrace();}
            } catch (NoSuchMethodException e) {e.printStackTrace();}
        } catch (ClassNotFoundException e) {e.printStackTrace();}
        return null;
    }
    

    To edit them (Root required) manually, you should extract them with adb :

    adb pull /system/build.prop
    

    Edit them on the computer, then "install" the new build.prop :

    adb push build.prop /sdcard/
    adb shell
        mount -o rw,remount -t rootfs /system
        cp /sdcard/build.prop /system/
        chmod 644 /system/build.prop
    

    Would be safer to keep an original build.prop copy.

    0 讨论(0)
提交回复
热议问题