SDK Requirements
Android Requirements:
- Minimum SDK: API Level 26 (Android 8.0)
- Target SDK: API Level 35 recommended
- Java 8+ or Kotlin support
Permissions:
The SDK’s AAR declares every permission it needs and Android’s manifest merger adds them to your app automatically - you do not need to add any permissions manually. For transparency, the merged permissions are:
<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.READ_PHONE_STATE" /><uses-permission android:name="com.android.keystore.CERTIFICATE_ACCESS" /><uses-permission android:name="android.permission.USE_CREDENTIALS" /><uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />Note: the SDK deliberately does not declare
QUERY_ALL_PACKAGES. Google Play rejects it for the security use case and it forces every integrator into a policy review. Package visibility is requested by generic intent through a<queries>block the SDK ships instead. Do not add it yourself.
SDK Installation
Section titled “SDK Installation”The recommended way to integrate is the Alphyn CLI: alphyn-cli integrate --android-api-key <key> wires the SDK dependency, initialization, and the build registration hook automatically. It resolves the SDK from the Alphyn package registry, so set your app API key in the build environment; see SDK Registry Access:
export ALPHYN_REGISTRY_KEY=<YOUR_APP_API_KEY>Manual installation (offline):
If your build cannot reach the registry, use the self-contained AAR instead. It carries the native inside it and needs no registry key.
Step 1: Add the SDK AAR
Download the Alphyn SDK AAR from your app’s SDK Downloads page in the Alphyn dashboard, place it under app/libs/, and add it to your app’s build.gradle:
dependencies { implementation(files("libs/alphyn-sdk-<version>.aar"))}Step 2: Native libraries
The SDK ships native libraries for arm64-v8a, armeabi-v7a, and x86_64 - no extra ABI configuration is needed. The SDK links its C++ runtime statically and ships no shared libc++_shared.so, so no pickFirst rule is required for it.
Quick Start Integration
Section titled “Quick Start Integration”Basic Integration Example:
public class MainActivity extends AppCompatActivity { private AlphynSecurityListener securityListener;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
// Create security listener createSecurityListener();
// Initialize SDK try { AlphynSDK.initialize(this); } catch (IllegalArgumentException e) { Log.e("Byteria", "SDK initialization failed: " + e.getMessage()); } }
private void createSecurityListener() { securityListener = new AlphynSecurityListener() { @Override public void onSuccess(AlphynCallbackResult result) { Log.i("Byteria", "Success: " + result.getMessage());
if (result.getOriginalEventType() == AlphynEventType.INIT_COMPLETE) { Log.i("Byteria", "SDK initialized successfully"); } }
@Override public void onFailure(AlphynCallbackResult result) { Log.w("Byteria", "Failure: " + result.getMessage()); }
@Override public void onThreatDetected(AlphynCallbackResult result) { Log.w("Byteria", "Threat detected: " + result.getMessage()); // Handle security threat handleSecurityThreat(result); } };
AlphynSDK.addSecurityListener(securityListener); }
private void handleSecurityThreat(AlphynCallbackResult result) { // Implement your threat response logic AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Security Alert") .setMessage("A security threat has been detected.") .setPositiveButton("OK", null) .show(); }
@Override protected void onDestroy() { super.onDestroy(); AlphynSDK.removeSecurityListener(securityListener); }}