How to Retrieve the Firmware (OS) Version: Difference between revisions

From wizarPOS
Line 1: Line 1:
== By system property ==
== By property ==
    property name: ro.wp.system.ver
Get the version number of the firmware through the property name: ro.wp.system.ver. The sample code snippet is as follows:
snippet code of get property:
     // returned version such as 1.0.0-3928
     // returned version such as 1.0.0-3928
     String prop = getProperty("ro.wp.system.ver","");  
     String prop = getProperty("ro.wp.system.ver","");  
Line 17: Line 16:
         }
         }
     }
     }
other related properties  
 
By the way, other related properties are as follows:
     '''<big>property names</big>'''    : '''<big>values show in sample terminal</big>'''
     '''<big>property names</big>'''    : '''<big>values show in sample terminal</big>'''
     ro.wp.bootloader.ver : 1.0.0-3020
     ro.wp.bootloader.ver : 1.0.0-3020
Line 23: Line 23:
     ro.wp.kernel.ver    : 1.0.0-3876
     ro.wp.kernel.ver    : 1.0.0-3876
     ro.wp.oem.ver        : wizarpos-1.0.0-2551
     ro.wp.oem.ver        : wizarpos-1.0.0-2551
== By android Build Class ==
== By android Build Class ==
     android.os.Build.DISPLAY
     android.os.Build.DISPLAY

Revision as of 05:07, 29 March 2020

By property

Get the version number of the firmware through the property name: ro.wp.system.ver. The sample code snippet is as follows:

   // returned version such as 1.0.0-3928
   String prop = getProperty("ro.wp.system.ver",""); 
      
   public static String getProperty(String key, String defaultValue) {
       String value = defaultValue;
       try {
           Class<?> c = Class.forName("android.os.SystemProperties");
           Method get = c.getMethod("get", String.class, String.class);
           value = (String)(get.invoke(c, key, defaultValue ));
       } catch (Exception e) {
           e.printStackTrace();
       }finally {
           return value;
       }
   }

By the way, other related properties are as follows:

   property names    : values show in sample terminal
   ro.wp.bootloader.ver : 1.0.0-3020
   ro.wp.hsm.ver        : PCBB22
   ro.wp.kernel.ver     : 1.0.0-3876
   ro.wp.oem.ver        : wizarpos-1.0.0-2551

By android Build Class

   android.os.Build.DISPLAY