Skip to content

Commit

Permalink
Added new identifiers helpers:
Browse files Browse the repository at this point in the history
Product Model, Identity Device ID, wifi mac address, wifi API mac address, wifi SSID, ethernet mac address
Update to version 0.12.0
  • Loading branch information
ltrudu committed Sep 19, 2024
1 parent d0ae108 commit 0cf62ec
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DeviceIdentifiersWrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 34
versionCode 110
versionName "0.11.0"
versionCode 120
versionName "0.12.0"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ public class DIHelper {

protected static String sIMEI = null;
protected static String sSerialNumber = null;

protected static String sBtMacAddress = null;
protected static String sProductModel = null;
protected static String sIdentityDeviceID = null;
protected static String sWifiMac = null;
protected static String sWifiAPMac = null;
protected static String sWifiSSID= null;
protected static String sEthernetMac = null;


public static final long SEC_IN_MS = 1000;
public static final long MIN_IN_MS = SEC_IN_MS * 60;
Expand Down Expand Up @@ -215,4 +221,213 @@ private static void returnBtMacAddressUsingAndroidAPIs(Context context, IDIResul
callbackInterface.onSuccess(macAddress);
}
}

public static void getProductModel(Context context, IDIResultCallbacks callbackInterface)
{
if(sProductModel != null)
{
if(callbackInterface != null)
{
callbackInterface.onDebugStatus("Product Model already in cache.");
}
callbackInterface.onSuccess(sProductModel);
return;
}

IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks() {
@Override
public void onSuccess(String message) {
sProductModel = message;
callbackInterface.onSuccess(message);
}

@Override
public void onError(String message) {
callbackInterface.onError(message);
}

@Override
public void onDebugStatus(String message) {
callbackInterface.onDebugStatus(message);
}
};

new RetrieveOEMInfoTask().executeAsync(context, Uri.parse("content://oem_info/oem.zebra.secure/ro_product_model"),
tempCallbackInterface);

}

public static void getIdentityDeviceID(Context context, IDIResultCallbacks callbackInterface)
{
if(sIdentityDeviceID != null)
{
if(callbackInterface != null)
{
callbackInterface.onDebugStatus("IdentityDeviceID already in cache.");
}
callbackInterface.onSuccess(sIdentityDeviceID);
return;
}

IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks() {
@Override
public void onSuccess(String message) {
sIdentityDeviceID = message;
callbackInterface.onSuccess(message);
}

@Override
public void onError(String message) {
callbackInterface.onError(message);
}

@Override
public void onDebugStatus(String message) {
callbackInterface.onDebugStatus(message);
}
};

new RetrieveOEMInfoTask().executeAsync(context, Uri.parse("content://oem_info/oem.zebra.secure/identity_device_id"),
tempCallbackInterface);

}

public static void getWifiMacAddress(Context context, IDIResultCallbacks callbackInterface)
{
if(sWifiMac != null)
{
if(callbackInterface != null)
{
callbackInterface.onDebugStatus("Wifi Mac Address already in cache.");
}
callbackInterface.onSuccess(sWifiMac);
return;
}

IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks() {
@Override
public void onSuccess(String message) {
sWifiMac = message;
callbackInterface.onSuccess(message);
}

@Override
public void onError(String message) {
callbackInterface.onError(message);
}

@Override
public void onDebugStatus(String message) {
callbackInterface.onDebugStatus(message);
}
};

new RetrieveOEMInfoTask().executeAsync(context, Uri.parse("content://oem_info/oem.zebra.secure/wifi_mac"),
tempCallbackInterface);

}

public static void getWifiAPMacAddress(Context context, IDIResultCallbacks callbackInterface)
{
if(sWifiAPMac != null)
{
if(callbackInterface != null)
{
callbackInterface.onDebugStatus("Wifi AP Mac Address already in cache.");
}
callbackInterface.onSuccess(sWifiAPMac);
return;
}

IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks() {
@Override
public void onSuccess(String message) {
sWifiAPMac = message;
callbackInterface.onSuccess(message);
}

@Override
public void onError(String message) {
callbackInterface.onError(message);
}

@Override
public void onDebugStatus(String message) {
callbackInterface.onDebugStatus(message);
}
};

new RetrieveOEMInfoTask().executeAsync(context, Uri.parse("content://oem_info/oem.zebra.secure/wifi_ap_mac"),
tempCallbackInterface);
}

public static void getWifiSSID(Context context, IDIResultCallbacks callbackInterface)
{
if(sWifiSSID != null)
{
if(callbackInterface != null)
{
callbackInterface.onDebugStatus("Wifi SSID already in cache.");
}
callbackInterface.onSuccess(sWifiSSID);
return;
}

IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks() {
@Override
public void onSuccess(String message) {
sWifiSSID = message;
callbackInterface.onSuccess(message);
}

@Override
public void onError(String message) {
callbackInterface.onError(message);
}

@Override
public void onDebugStatus(String message) {
callbackInterface.onDebugStatus(message);
}
};

new RetrieveOEMInfoTask().executeAsync(context, Uri.parse("content://oem_info/oem.zebra.secure/wifi_ssid"),
tempCallbackInterface);
}

public static void getEthernetMacAddress(Context context, IDIResultCallbacks callbackInterface)
{
if(sEthernetMac != null)
{
if(callbackInterface != null)
{
callbackInterface.onDebugStatus("Ethernet Mac Address already in cache.");
}
callbackInterface.onSuccess(sEthernetMac);
return;
}

IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks() {
@Override
public void onSuccess(String message) {
sEthernetMac = message;
callbackInterface.onSuccess(message);
}

@Override
public void onError(String message) {
callbackInterface.onError(message);
}

@Override
public void onDebugStatus(String message) {
callbackInterface.onDebugStatus(message);
}
};

new RetrieveOEMInfoTask().executeAsync(context, Uri.parse("content://oem_info/oem.zebra.secure/ethernet_mac"),
tempCallbackInterface);
}


}

0 comments on commit 0cf62ec

Please sign in to comment.