3 Replies Latest reply on Jul 25, 2016 7:14 AM by 9ee6e931-c37a-4cfb-b1d3-c8c319072c6e

    How to read the installed "Zebra Patch Version" from within an application?

    9ee6e931-c37a-4cfb-b1d3-c8c319072c6e

      We would like to read the "Zebra Patch Version" to display it on the system/device information screen of our TLmE application on TC75 and to record it it in our reporting files for support/maintenance.

      How can we get this version information?

       

      Motivation for this question is an strange issue we experienced on two different TC75 units this week:

      After installing CFE v02.20.00 Package (CFE_TC75_KK_001404_EN_v022000.zip) on the TC75 we got crashes when our application starts to get access to the EMDK service.

      We had to reflash the base OS version (T75N0KEXXPUEF01404.zip) and reinstall MX/EMDK 4.2 to get it working again.

        • Re: How to read the installed "Zebra Patch Version" from within an application?
          9ee6e931-c37a-4cfb-b1d3-c8c319072c6e

          OK. I got the solution myself.

           

          Using reflection one gets access to the Android "SystemProperties" and then one can invoke the "get" method to read the "persist.sys.cfe.patchver" value.

           

          The name of thevalue is documented in the release notes of the hotfix CFE:

          Run “getprop persist.sys.cfe.patchver” command in ADB Shell.

            • Re: How to read the installed "Zebra Patch Version" from within an application?
              Pietro Francesco Maggi

              Hi Richard,

              do you mind posting a code snippet so that other developer interested can start from there?

               

              thanks

              ~Pietro

                • Re: How to read the installed "Zebra Patch Version" from within an application?
                  9ee6e931-c37a-4cfb-b1d3-c8c319072c6e

                  Hello Pietro

                   

                  The code looks like this:

                   

                  public final String getCurrentRuntimeValue(final String propertyName)

                  {

                      try

                      {

                          Class<?> systemProperties=Class.forName("android.os.SystemProperties");

                   

                          try

                          {

                              Method get=systemProperties.getMethod("get",String.class,String.class);

                              if(get==null)

                              {

                                  return(null);

                              }

                              try

                              {

                                  final String value=(String)get.invoke(systemProperties,propertyName,"");

                   

                                  return(value);

                              }

                              catch (IllegalAccessException e)

                              {

                                  return(null);

                              }

                              catch (IllegalArgumentException e)

                              {

                                  return(null);

                              }

                              catch (InvocationTargetException e)

                              {

                                  return(null);

                              }

                          }

                          catch (NoSuchMethodException e)

                          {

                              return(null);

                          }

                      }

                      catch (ClassNotFoundException e)

                      {

                          return(null);

                      }

                  }

                   

                  I use the same code to query other values - for example 'persist.sys.imagerfwversion' to read the version of the imager firmware.

                   

                  Richard.