1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 08:57:44 +03:00
This commit is contained in:
Anton Afanasyeu
2026-06-12 22:20:48 +02:00
parent 9acbdbc433
commit 8e0cbba416
5 changed files with 599 additions and 100 deletions

View File

@@ -134,6 +134,7 @@ public final class RemoteAccessService extends Service {
hb.put("device_id", DeviceInfo.getDeviceUuid(this));
hb.put("random", loadOrCreateSessionRandom());
hb.put("app_version", com.foxx.androidcast.BuildConfig.VERSION_NAME);
hb.put("device", buildDeviceMeta(this));
hb.put("tunnel_mode", mode.toApiValue());
JSONArray caps = new JSONArray();
if (mode == RemoteAccessMode.WIREGUARD) {
@@ -353,6 +354,24 @@ public final class RemoteAccessService extends Service {
nm.createNotificationChannel(ch);
}
private static JSONObject buildDeviceMeta(Context context) throws Exception {
JSONObject device = new JSONObject();
device.put("name", AppPreferences.getUsername(context));
device.put("manufacturer", Build.MANUFACTURER);
device.put("brand", Build.BRAND);
device.put("model", Build.MODEL);
device.put("device", Build.DEVICE);
device.put("product", Build.PRODUCT);
device.put("sdk_int", Build.VERSION.SDK_INT);
device.put("release", Build.VERSION.RELEASE);
JSONArray abis = new JSONArray();
for (String abi : Build.SUPPORTED_ABIS) {
abis.put(abi);
}
device.put("abis", abis);
return device;
}
@Override
public IBinder onBind(Intent intent) {
return null;