manymuch / Xgimi-4-Home-Assistant

XGIMI integration for home assistant
MIT License
161 stars 21 forks source link

Is z6x equal to new z6x? I am unable to use z6x's token #32

Closed zack-sys closed 6 months ago

zack-sys commented 1 year ago

Is there a token available for my device, New z6x? I am Android and I have tried many methods but cannot catch Bluetooth

helgek commented 1 year ago

I've only been successful with iOS. Do you maybe have somebody in reach with an iOS device?

zack-sys commented 1 year ago

No I've tried a lot of Google Play Bluetooth scanners So are the Z6X and the New Z6X two models?

zack-sys commented 1 year ago

Can I get a token by grabbing packets or reversing XGIMI APP?

zack-sys commented 1 year ago

public final void startOpenTv(String mac, OnStateCallBack onStateCallBack) { BluetoothLeAdvertiser bluetoothLeAdvertiser; Object[] array; Intrinsics.checkNotNullParameter(mac, "mac"); this.mOnStateCallBack = onStateCallBack; byte[] bArr = {0, 70, 0, 0, 80, 19, -107, -1, -1, -1, 50, 67, 82, 75, 84, 77}; try { array = StringsKt.split$default((CharSequence) mac, new String[]{":"}, false, 0, 6, (Object) null).toArray(new String[0]); } catch (Exception e) { e.printStackTrace(); } if (array != null) { String[] strArr = (String[]) array; int length = strArr.length - 1; if (length >= 0) { int i = 1; while (true) { int i2 = length - 1; bArr[i] = (byte) Integer.parseInt(strArr[length], CharsKt.checkRadix(16)); i++; if (i2 < 0) { break; } length = i2; } } bArr[7] = -1; bArr[8] = -1; bArr[9] = -1; bArr[10] = 50; bArr[11] = 67; bArr[12] = 82; bArr[13] = 75; bArr[14] = 84; bArr[15] = 77; AdvertiseSettings build = new AdvertiseSettings.Builder().setConnectable(true).setAdvertiseMode(2).setTxPowerLevel(3).setTimeout(Querier.DEFAULT_TIMEOUT).build(); AdvertiseData.Builder builder = new AdvertiseData.Builder(); builder.addServiceUuid(new ParcelUuid(UUID_SERVER)); builder.addManufacturerData(70, bArr); builder.setIncludeTxPowerLevel(false); AdvertiseData build2 = builder.build(); BluetoothAdapter bluetoothAdapter = mBluetoothAdapter; if (bluetoothAdapter == null || (bluetoothLeAdvertiser = bluetoothAdapter.getBluetoothLeAdvertiser()) == null) { return; } bluetoothLeAdvertiser.startAdvertising(build, build2, null, this.rightCallback); return; } throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>"); }

Here seems to be the code for the app to start the projector

helgek commented 1 year ago

You need to get an iOS device ad install Bluetooth Smart Scanner App. With a PC I was successful with nRF52840 USB device.

On Linux you could try these instructions: https://github.com/manymuch/Xgimi-4-Home-Assistant/issues/5#issuecomment-1752887102

pnam-ng commented 6 months ago

@zack-sys Do you have the token, I also having a new z6x and can not figure out the token

manymuch commented 6 months ago

@pnam-ng Token is different even for the same model, so you need to figure out your own device token