//设置License
public static void setLicense(Context context, String license){
try{
Class<?> clsGlobal = Class.forName("android.provider.Settings$Global");
Method methodGetString = clsGlobal.getDeclaredMethod("putString", ContentResolver.class, String.class, String.class);
methodGetString.setAccessible(true);
methodGetString.invoke(null, context.getContentResolver(), "aa_license", license);
}catch (Exception e){
e.printStackTrace();
}
}
//获取License
public static String getLicense(Context context){
String license = "";
try{
Class<?> clsGlobal = Class.forName("android.provider.Settings$Global");
Method methodGetString = clsGlobal.getDeclaredMethod("getString", ContentResolver.class, String.class);
methodGetString.setAccessible(true);
license = (String)methodGetString.invoke(null, context.getContentResolver(), "aa_license");
}catch (Exception e){
e.printStackTrace();
}
return license;
}
设置获取 系统License
最新推荐文章于 2021-11-02 20:02:22 发布