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

From wizarPOS
No edit summary
Line 1: Line 1:
== Get by property ==
=== <big>Methods to Retrieve Firmware Version</big> ===
Get the version number of the firmware through the property name: ro.wp.system.ver. The sample code snippet is as follows:
== Using Property Names ==
    // returned version such as 1.0.0-3928
* Retrieve the firmware version using specific property names.
* Example Code Snippet:
<syntaxhighlight lang="java">
// returned version such as 1.0.0-3928
     String prop = getProperty("ro.wp.system.ver","");  
     String prop = getProperty("ro.wp.system.ver","");  
        
        
Line 16: Line 19:
         }
         }
     }
     }
 
</syntaxhighlight >
The properties of the image version are as follows:
* Sample Property Names and Values:
    '''<big>property names</big>'''    : '''<big>values show in sample terminal</big>'''
** '''ro.wp.system.ver:''' e.g., 1.0.0-3886
    ro.wp.system.ver     : 1.0.0-3886
** '''ro.wp.bootloader.ver:''' e.g., 1.0.0-3020
    ro.wp.bootloader.ver : 1.0.0-3020
** '''ro.wp.hsm.ver:''' e.g., PCBB22
    ro.wp.hsm.ver       : PCBB22
** '''ro.wp.kernel.ver:''' e.g., 1.0.0-3876
    ro.wp.kernel.ver     : 1.0.0-3876
** '''ro.wp.oem.ver:''' e.g., wizarpos-1.0.0-2551
    ro.wp.oem.ver       : wizarpos-1.0.0-2551
== Using Android Build Class ==
 
* Another method to get the firmware version is through the Android Build class.
== Get by android Build class ==
* Use ''''android.os.Build.DISPLAY'''' to access the display ID of the underlying software, which often includes the version.
    android.os.Build.DISPLAY

Revision as of 16:21, 10 January 2024

Methods to Retrieve Firmware Version

Using Property Names

  • Retrieve the firmware version using specific property names.
  • Example Code Snippet:
// 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;
        }
    }
  • Sample Property Names and Values:
    • ro.wp.system.ver: e.g., 1.0.0-3886
    • ro.wp.bootloader.ver: e.g., 1.0.0-3020
    • ro.wp.hsm.ver: e.g., PCBB22
    • ro.wp.kernel.ver: e.g., 1.0.0-3876
    • ro.wp.oem.ver: e.g., wizarpos-1.0.0-2551

Using Android Build Class

  • Another method to get the firmware version is through the Android Build class.
  • Use 'android.os.Build.DISPLAY' to access the display ID of the underlying software, which often includes the version.