Skip to content

Instantly share code, notes, and snippets.

@AzureFlow
Created May 7, 2024 00:09
Show Gist options
  • Save AzureFlow/38788d6ee3eb5b2b811f88415bfa8d78 to your computer and use it in GitHub Desktop.
Save AzureFlow/38788d6ee3eb5b2b811f88415bfa8d78 to your computer and use it in GitHub Desktop.

Arkose Mobile Info

TL;DR:

  1. Collect Android environment information + (string escape + base64 encode)
  2. Send data to fingerprintData function in WebView via WebView.evaluateJavascript
  3. Forward data sent into the WebView to arkoseEnforcement.dataResponse(dataCollection) in the JavaScript api.js
  4. Emit the event from api.js to enforcement.version_hash.js
    Le.emit("data_response", {message: "data_response", data: eventData, key: Jt.config.publicKey});
  5. Base64 decode + JSON.parse: _o.sdkData.ef = parsed;
  6. Append to BDA payload: n.ef[t.key] = t.value;

Signals:

mobile_sdk__build_version

2.4.1(11)

mobile_sdk__errors

try
{
    // [...]
}
catch(Exception e)
{
    errors += key + ":" + e.getMessage() + ";";
}

mobile_sdk__biometrics_proximity

proximitySensor2.hasProximitySensor + "," + proximitySensor2.hasProximitySensorNum

mobile_sdk__biometrics_motion

TODO

mobile_sdk__biometrics_orientation

TODO

mobile_sdk__keyboard

boolean keyboard = this.context.getResources().getConfiguration().keyboard != 1;

mobile_sdk__adb_enabled

Settings.Global.getInt(this.context.getContentResolver(), "adb_enabled", 0)

mobile_sdk__app_id

this.context.getPackageManager().getPackageInfo(this.context.getPackageName(), 0).packageName;

mobile_sdk__app_version

this.context.getPackageManager().getPackageInfo(this.context.getPackageName(), 0).versionName;

mobile_sdk__app_signing_credential

public final String getSigningCredentials() throws PackageManager.NameNotFoundException
{
    StringBuilder results = new StringBuilder();
    for(Signature signature : this.context.getPackageManager().getPackageInfo(this.context.getPackageName(), PackageManager.GET_SIGNATURES).signatures)
    {
        results.append(new String(signature.toByteArray()));
    }

    return BaseSignalGroup.sha256AsHex(results.toString());
}

mobile_sdk__board

Build.BOARD

mobile_sdk__cpu_abi

Build.SUPPORTED_ABIS

mobile_sdk__hardware

Build.HARDWARE

mobile_sdk__soc_manufacturer

Build.SOC_MANUFACTURER

mobile_sdk__soc_model

Build.SOC_MODEL

mobile_sdk__device_arch

System.getProperty("os.arch", "");

mobile_sdk__cpu_cores

Runtime.getRuntime().availableProcessors();

mobile_sdk__gpu

Prefs.sharedPreferences.getString("gpuInfo", "");

mobile_sdk__storage_info

public final ArrayList<Long> getStorageInfo()
{
    ArrayList<Long> results = new ArrayList<>();
    StatFs statFs = new StatFs(Environment.getDataDirectory().getPath());
    results.add(statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong());
    results.add(statFs.getBlockCountLong() * statFs.getBlockSizeLong());

    if(Environment.isExternalStorageRemovable())
    {
        StatFs statFs2 = new StatFs(Environment.getExternalStorageDirectory().getPath());
        results.add(statFs2.getAvailableBlocksLong() * statFs2.getBlockSizeLong());
        results.add(statFs2.getBlockCountLong() * statFs2.getBlockSizeLong());
    }

    return results;
}

mobile_sdk__screen_width & mobile_sdk__screen_height

DisplayMetrics displayMetrics = new DisplayMetrics();
((WindowManager) this.context.getSystemService("window")).getDefaultDisplay().getRealMetrics(displayMetrics);
Pair<Integer, Integer> pair = new Pair<>(displayMetrics.widthPixels, displayMetrics.heightPixels);
arrayList.add(new SignalResult("mobile_sdk__screen_width", pair.first));
arrayList.add(new SignalResult("mobile_sdk__screen_height", pair.second));

mobile_sdk__input_devices_hash

public final String getInputDevicesHash()
{
    StringBuilder result = new StringBuilder();
    int[] deviceIds = InputDevice.getDeviceIds();
    if(deviceIds.length > 0)
    {
        for(int i : deviceIds)
        {
            InputDevice device = InputDevice.getDevice(i);
            result.append(device.getName() + "," + device.getVendorId() + ";");
        }
        
        String str = deviceIds.length + "#" + result.toString();
        return BaseSignalGroup.sha256AsHex(str.substring(str.indexOf("#") + 1));
    }
    
    return "";
}

mobile_sdk__sensors_hash

public final String getSensorsHash()
{
    StringBuilder result = new StringBuilder();
    List<Sensor> sensorList = ((SensorManager) this.context.getSystemService("sensor")).getSensorList(-1);
    if(sensorList.size() > 0)
    {
        for(int i = 0; i < sensorList.size(); i++)
        {
            result.append(sensorList.get(i).getName() + "," + sensorList.get(i).getVendor() + ";");
        }

        return BaseSignalGroup.sha256AsHex(result.toString());
    }

    return null;
}

mobile_sdk__camera_lens_info

[
        CameraCharacteristics.LENS_FACING_FRONT,
        CameraCharacteristics.LENS_FACING_BACK,
        CameraCharacteristics.LENS_FACING_EXTERNAL, // other
]

mobile_sdk__bio_fingerprint

BiometricManager.from(this.context).canAuthenticate(255);
// returns based on result

mobile_sdk__battery_status & mobile_sdk__battery_capacity

Pair pair2 = new Pair(str, Integer.valueOf(((BatteryManager) this.context.getSystemService("batterymanager")).getIntProperty(4)));
arrayList.add(new SignalResult("mobile_sdk__battery_status", (String) pair2.first));
arrayList.add(new SignalResult("mobile_sdk__battery_capacity", (Integer) pair2.second));

mobile_sdk__device_orientation

"Un", "LR", "PU", "LL", or "P"

mobile_sdk__os_version

Build.VERSION.RELEASE

mobile_sdk__os_sdk_version

Build.VERSION.SDK_INT

mobile_sdk__kernel

System.getProperty("os.version", "")

mobile_sdk__bootloader

Build.BOOTLOADER

mobile_sdk__os_build_tags

Build.TAGS.split(",")

mobile_sdk__os_build_type

Build.TYPE

mobile_sdk__codec_hash

MediaCodecInfo.getSupportedTypes() encoded into JSON and sha256 hashed

mobile_sdk__id_for_vendor

Settings.Secure.getString(this.context.getContentResolver(), "android_id")

mobile_sdk__locale_hash

sha256(Arrays.asList(this.context.getAssets().getLocales()).toString())

mobile_sdk__country_region

context.getResources().getConfiguration().locale.getCountry()

mobile_sdk__language

Locale.getDefault().getLanguage()

mobile_sdk__timezone_offset

TimeZone.getDefault().getOffset(new Date().getTime()) / 60000

mobile_sdk__device_name

sha256(Settings.Global.getString(this.context.getContentResolver(), "device_name"))

mobile_sdk__screen_brightness

(Settings.System.getInt(this.context.getContentResolver(), "screen_brightness", -1) * 100) / 255

mobile_sdk__manufacturer

Build.MANUFACTURER

mobile_sdk__model

Build.MODEL

mobile_sdk__brand

Build.BRAND

mobile_sdk__product

Build.PRODUCT

mobile_sdk__device

Build.DEVICE

mobile_sdk__sku

Build.SKU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment