Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the build.prop values?

Tags:

android

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

like image 766
Binoy Babu Avatar asked Nov 30 '22 02:11

Binoy Babu


1 Answers

You can probably consider using SystemProperties.get("someKey") as suggested by @kangear in your application using reflection like:

public String getSystemProperty(String key) {
    String value = null;

    try {
        value = (String) Class.forName("android.os.SystemProperties")
                .getMethod("get", String.class).invoke(null, key);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return value;
}

And then you can use it any where like:

getSystemProperty("someKey");
like image 112
Kamran Ahmed Avatar answered Dec 01 '22 15:12

Kamran Ahmed