Merc_Enary
Lurker
Hi guys,
I have got a BBQ thermometer which runs through an app and measures temperature to a certain point when it gives an alarm. Unfortunately the app is a bit short on functionality so I wanted to pair the thermomenter with my phone.
I cannot do this since I do not know the bluetooth pin. It seems that the pin is transmitted automatically by the app to the thermometer.
I had a look at the code and I think I found the place where the pin is generated, but it is not in clear text.
Could you have a look at it and help me in finding out the bluetooth pin?
I think the pin is generated in this section pasted below but I have also attached the java file to the post:
The translation of those Chinese characters close to the top of the code actually means "pairing key" which I think is quite a hot clue...
Also I think the actuall pin is generated in line I made bold.
Thanks a lot in advance
Merc
I have got a BBQ thermometer which runs through an app and measures temperature to a certain point when it gives an alarm. Unfortunately the app is a bit short on functionality so I wanted to pair the thermomenter with my phone.
I cannot do this since I do not know the bluetooth pin. It seems that the pin is transmitted automatically by the app to the thermometer.
I had a look at the code and I think I found the place where the pin is generated, but it is not in clear text.
Could you have a look at it and help me in finding out the bluetooth pin?
I think the pin is generated in this section pasted below but I have also attached the java file to the post:
The translation of those Chinese characters close to the top of the code actually means "pairing key" which I think is quite a hot clue...
Also I think the actuall pin is generated in line I made bold.
Thanks a lot in advance
Merc
Code:
public void onCharacteristicChanged(BluetoothGatt bluetoothGatt, BluetoothGattCharacteristic bluetoothGattCharacteristic) {
int i = 0;
String str = bluetoothGattCharacteristic.getUuid() + ":";
String str2 = str;
for (byte toHexString : bluetoothGattCharacteristic.getValue()) {
str2 = str2 + Integer.toHexString(toHexString) + ", ";
}
byte[] value;
short a;
if (bluetoothGattCharacteristic.getUuid().equals(this.f1272a.f1294C.getUuid())) {
value = bluetoothGattCharacteristic.getValue();
if (value[0] == (byte) 32) {
Log.i("value[0]", "0x20 配对密钥");
this.f1272a.f1309R = C0463d.m1682a(value, 1);
this.f1272a.aa.putInt("MIYAO", this.f1272a.f1309R).apply();
this.f1272a.f1315X.add(new C04732(this));
if (this.f1272a.f1315X.size() == 1) {
this.f1272a.m1772i();
}
} else if (value[0] == (byte) 33) {
Log.i("TAG", "0x21");
if (value[1] == (byte) 0) {
this.f1272a.sendBroadcast(new Intent("com.example.bbqtemperature.SERVICE_PAIR_MIYAO"));
Log.e("value[1]", "0x00");
if (!this.f1272a.f1343z.equals(this.f1272a.f1306O.m1695c())) {
this.f1272a.f1306O.m1690a(this.f1272a.f1343z);
}
this.f1272a.m1742a("com.example.bbqtemperature.SERVICE_YANZHENG");
this.f1272a.aa.putInt("MIYAO", C0463d.m1682a(new byte[]{(byte) -72, (byte) 34, (byte) 0, (byte) 0}, 0));
this.f1272a.aa.commit();
this.f1272a.m1789r();
this.f1272a.f1320c.m1660b(0);
this.f1272a.f1306O.m1696c(true);
this.f1272a.f1306O.m1691a(false);
Log.e(this.f1272a.f1318a, "connect success!");
this.f1272a.ae.sendEmptyMessageDelayed(20, 1500);
this.f1272a.f1305N = true;
} else if (value[1] == (byte) 1) {
Log.i(this.f1272a.f1318a, "connect fail");
} else {
Log.i(this.f1272a.f1318a, "what's this");
this.f1272a.m1742a("com.example.bbqtemperature.SERVICE_CONNECT_FAILED");
}
} else if (value[0] == (byte) 35) {
this.f1272a.f1339v = value[1];
this.f1272a.f1340w = value[2];
if (this.f1272a.f1339v > 3 || (this.f1272a.f1339v == 3 && this.f1272a.f1340w >= 2)) {
this.f1272a.f1338u = 0;
} else {
this.f1272a.f1338u = 1;
}
if (this.f1272a.f1339v >= 3 && "easybbq".equals("newbbqtest")) {
this.f1272a.f1338u = -20;
}
this.f1272a.aa.putInt("mainVersions", value[1]);
this.f1272a.aa.putInt("secondVersions", value[2]);
this.f1272a.aa.commit();
} else if (value[0] == (byte) 36) {
a = MyBbqBleService.m1730a(value, 1);
short a2 = MyBbqBleService.m1730a(value, 3);
Log.i(this.f1272a.f1318a, "onCharacteristicChanged: fullBattery: " + a2);
if (a2 == (short) 0) {
a2 = (short) 6550;
}
this.f1272a.aa.putInt("FULL_DIAN", a2).commit();
Intent intent = new Intent("com.example.bbqtemperature.SERVICE_DIANYA");
intent.putExtra("INTENT_DIANYA", a);
intent.putExtra("INTENT_FULL_DIANYA", a2);
this.f1272a.sendBroadcast(intent);
} else if (value[0] != (byte) -1 && value[0] == (byte) 4 && value[1] == (byte) -1) {
this.f1272a.f1320c.m1657a();
}
} else if (bluetoothGattCharacteristic.getUuid().equals(this.f1272a.f1296E.getUuid())) {
value = bluetoothGattCharacteristic.getValue();
if (this.f1272a.f1298G) {
this.f1272a.aa.putInt("PROBE_COUNT", value.length / 2);
this.f1272a.aa.commit();
this.f1272a.f1298G = false;
this.f1272a.sendBroadcast(new Intent("INTENT_GET_TEMP"));
}
while (i < value.length) {
a = (short) ((int) Math.round(((double) MyBbqBleService.m1730a(value, i)) / 10.0d));
Log.i(this.f1272a.f1318a, "onCharacteristicChanged: t: " + a);
if (a < this.f1272a.f1338u || a > this.f1272a.f1337t) {
this.f1272a.m1742a(this.f1272a.f1334q[i / 2]);
} else {
this.f1272a.m1743a(this.f1272a.f1333p[i / 2], a);
this.f1272a.f1321d.m1666a((i / 2) + 1, a);
}
i += 2;
}
}
}
Attachments
Last edited by a moderator: