Problem solved: Look into http://forum.xda-developers.com/showthread.php?t=1558089
Hello,
this ussd problem with gingerbread-roms drives me nuts. Codes like *100# won't work. I have to stay on froyo to check my prepaid balance and recharge.
Thanks to nop who narrowed the problem down to libril-qc-1.so, I (s)traced rild and found the following difference:
2.2.2 rild:
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril.c 2079] UI --- RIL_REQUEST_SEND_USSD (29) ---> RIL [token id 256, data len 4]\n\0"..., 86}], 3) = 93
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 14003] USSD string in UTF8 format = *100# length = 5\n\0"..., 66}], 3) = 73
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 14008] USSD string is in ASCII format, converting to 7BIT format\0"..., 78}], 3) = 85
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 14023] USSD string after conversion = *100# length = 5\n\0"..., 68}], 3) = 75
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 216] Not found ReqList entry waiting for CM_SUPS_EVENT_USS_IND (86035)\n\0"..., 89}], 3) = 96
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 169] Not found ReqList entry : token id 256\n\0"..., 62}], 3) = 69
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 400] Event RIL_REQUEST_SEND_USSD (29) pending receipt of CM_SUPS_EVENT_PROCESS_USS_CONF, token id 256 [0x2ae68]\n\0"..., 130}], 3) = 137
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 1065] ReqList entries : \n\0"..., 43}], 3) = 50
[pid 138] writev(11, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 1071] RIL_REQUEST_SEND_USSD (29), token id 256\n\0"..., 69}], 3) = 76
[pid 138] write(17, "\n\0\1\200\0\0\0\0\375\1\0\0\0\0\0000C\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
[pid 138] write(24, "\0\0\1\375\0\0\0\0\0\0\0\0020\0\0\0\263\277\333\31\0\0\0C\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\27\0\2\256h\0\0\0\27\0\0\0\1\0\0\0\6\0\0\0\1\0\0\0\17\0\0\0\5\0\0\0\5*100#\0\0\0"..., 84) = 84
2.3.3 rild:
[pid 3372] writev(10, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril.c 2577] UI --- RIL_REQUEST_SEND_USSD (29) ---> RIL [RID 0, token id 59, data len 4]\n\0"..., 92}], 3) = 99
[pid 3372] writev(10, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_arb.c 1437] RID 0 voice srv: modem id=0, ma=Multimode(0), net_pref=GSM WCDMA preferred(0)\n\0"..., 98}], 3) = 105
[pid 3372] writev(10, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 22350] USSD string in UTF8 format = *100# length = 5\n\0"..., 66}], 3) = 73
[pid 3372] writev(10, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 22358] USSD string is in ASCII format, converting to 7BIT format\0"..., 78}], 3) = 85
[pid 3372] writev(10, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 22375] USSD string after conversion = *100# length = 5\n\0"..., 68}], 3) = 75
[pid 3372] writev(10, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 331] [RID 0] Not found ReqList entry waiting for CM_SUPS_EVENT_USS_IND (86035)\n\0"..., 97}], 3) = 104
[pid 3372] write(18, "\n\0\1\200\0\0\0\0\354\0\0\0\0\0\0000\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
[pid 3372] write(23, "\0\0\0\354\0\0\0\0\0\0\0\0020\0\0\0\263\277\333\31\0\0\0\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\4*100\0\0\0\4\0\0\0\1"..., 60) = 60
[pid 3372] futex(0x80317f74, FUTEX_WAIT_PRIVATE, -40, NULL <unfinished ...>
[pid 3377] <... select resumed> ) = 1 (in [23])
[pid 3377] rt_sigprocmask(SIG_SETMASK, [TRAP BUS FPE KILL SEGV USR2 PIPE ALRM TERM CHLD TTIN TTOU RTMIN], NULL, 4) = -1 EINVAL (Invalid argument)
[pid 3377] read(23, "\0\0\0\354\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\4*100\0\0\0\4\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 17408) = 84
Basically the rild on gingerbread 2.3.x isn't sending the last character '#' to end the ussd correctly. Ironically in "logcat -b radio" rild states that the ussd it will send is 5 chars long, but it sends only 4 chars over to the character device /dev/oncrpc/30000000:b3bfdb19
I think, this is done in libril-qc-1.so in function qcril_cm_supsvc_request_send_ussd but I was missing at school when they tought us arm-assembler, so I'm stuck reading objdump -d libril-qc-1.so.
So my first questions: Is this really a off by one bug? How can I circumvent it without the sourcecode of libril-qc-1? Is there a Qisda SDK out there for the austin baseband or libril?
On the other hand I read at http://code.google.com/p/synergy-evo3d/wiki/Radio and http://fabiensanglard.net/cellphoneModem/index2.php how to talk to the baseband without rild. And on a 2.3.x I got a positive result with
# cat /dev/smd0 &
# echo -e 'AT+CUSD=1,"*100#",15\r' >/dev/smd0
OK
+CUSD: 0," Aktuelles Guthaben: 20.10 EUR.",15
So ussd with /dev/smd0 works, but it seems libril-qc-1 doesn't use it at all. At least I can't find any AT-commands in it.
Second question: Is /dev/smd0 some obsolete way of communicating with the baseband-radio?
I appreciate any help, cause I'm somewhat stuck and can't find the loophole.
Reg. hunderteins
hunderteins, +1
--
More, in radio log you will see "Rejected on protocol layer" message.
--
Heck, it actually works!
I'd give a 1000 thanks if i could!
I think now of following:
Why does USSD codes work on some provides?
What if we supply an extra char on USSD request on framework level?
_n0p_ said:
I think now of following:
Why does USSD codes work on some provides?
Click to expand...
Click to collapse
*135# is working here, too. I think *135 unambiguous. There is no code like *135#1# or something like that. Whereas *100#1# is a legal code, and the network-provider can just not know whether *100 is complete, for *135 it knows it is complete.
What if we supply an extra char on USSD request on framework level?
Click to expand...
Click to collapse
When you can do that, try it please. I'm looking for a wrapper for libril-qc-1.so to add an extra
#-char. At the end we can use the way that will circumvent the bug.
Too bad arm devices started to appear after i finished my reversing carrier. Just if it would be x86
--
It seems this part should be modded:
.method sendUssd(Ljava/lang/StringV
.registers 4
.parameter "ussdMessage"
.prologue
.line 897
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/telephony/gsm/GsmMmiCode;->isPendingUSSD:Z
.line 904
iget-object v0, p0, Lcom/android/internal/telephony/gsm/GsmMmiCode;->phone:Lcom/android/internal/telephony/gsm/GSMPhone;
iget-object v0, v0, Lcom/android/internal/telephony/PhoneBase;->mCM:Lcom/android/internal/telephony/CommandsInterface;
const/4 v1, 0x4
invoke-virtual {p0, v1, p0}, Lcom/android/internal/telephony/gsm/GsmMmiCode;->obtainMessage(ILjava/lang/ObjectLandroid/os/Message;
move-result-object v1
invoke-interface {v0, p1, v1}, Lcom/android/internal/telephony/CommandsInterface;->sendUSSD(Ljava/lang/String;Landroid/os/MessageV
.line 906
return-void
.end method
I got my wrapper libril ready. But I didn't work. I put in *100## and got again out *100
[pid 2818] clock_gettime(CLOCK_MONOTONIC, {2001, 359584848}) = 0
[pid 2818] read(37, "\0\0\0\30\35\0\0\0$\0\0\0\5\0\0\0*\0001\0000\0000\0#\0\0\0"..., 8196) = 28
[pid 2818] writev(9, [{"\5"..., 1}, {"RILW\0"..., 5}, {"onRequest: RIL_REQUEST_SEND_USSD: \"*100#\", LEN: 4\0"..., 50}], 3) = 56
[pid 2818] writev(9, [{"\5"..., 1}, {"RILW\0"..., 5}, {"onRequest: RIL_REQUEST_SEND_USSD: out \"*100##\", LEN: 5\0"..., 55}], 3) = 61
[pid 2818] writev(9, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril.c 2577] UI --- RIL_REQUEST_SEND_USSD (29) ---> RIL [RID 0, token id 36, data len 5]\n\0"..., 92}], 3) = 99
[pid 2818] writev(9, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_arb.c 1437] RID 0 voice srv: modem id=0, ma=Multimode(0), net_pref=GSM WCDMA preferred(0)\n\0"..., 98}], 3) = 105
[pid 2818] writev(9, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 22350] USSD string in UTF8 format = *100## length = 6\n\0"..., 67}], 3) = 74
[pid 2818] writev(9, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 22358] USSD string is in ASCII format, converting to 7BIT format\0"..., 78}], 3) = 85
[pid 2818] writev(9, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_cm.c 22375] USSD string after conversion = *100## length = 6\n\0"..., 69}], 3) = 76
[pid 2818] writev(9, [{"\3"..., 1}, {"QCRIL\0"..., 6}, {"[qcril_reqlist.c 331] [RID 0] Not found ReqList entry waiting for CM_SUPS_EVENT_USS_IND (86035)\n\0"..., 97}], 3) = 104
[pid 2818] write(18, "\n\0\1\200\0\0\0\0\252\0\0\0\0\0\0000\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40
[pid 2818] write(23, "\0\0\0\252\0\0\0\0\0\0\0\0020\0\0\0\263\277\333\31\0\0\0\201\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\4*100\0\0\0\4\0\0\0\1"..., 60) = 60
I hate it, when that happens.
hunderteins, that's fast!
So it seems not the bug, but intended symbol strip proc.
_n0p_ said:
hunderteins, that's fast!
Click to expand...
Click to collapse
it has been done before. I even tried to implement RIL_REQUEST_SEND_USSD by talking to /dev/smd0. There I must have missed some message-send/receive mechanism. I attached the wrapper for interessted uses.
So it seems not the bug, but intended symbol strip proc.
Click to expand...
Click to collapse
that brings me to my initial questions.
I've decided to take a shortcut right now:
http://forum.xda-developers.com/showpost.php?p=23607014&postcount=3234
_n0p_ said:
I've decided to take a shortcut right now:
http://forum.xda-developers.com/showpost.php?p=23607014&postcount=3234
Click to expand...
Click to collapse
efficient one. But you need root to do that and no other ussd-app from the market will run. At least it solves the problem for the end-user.
The guess with that off-by-one-bug was wrong. I tried *101*123456789# ( a code that is used to recharge) and guess what the libril-qc-1.so sends? Only the first 4 bytes. The length of the message is hardcoded to 4 bytes! So my new guess is, that someone used sizeof(data) instead of strlen(data).
root is actually not needed, just a correct permissions.
Say, this kind of bug shouldn't pass unnoticed or there's no QA at all in Quisda.
--
I also cannot seem to update dialog text in consequent updates, i'm not a Java coder anyway.
--
I'm lookin through code via IDA, dunno if i'll succeed.
--
Actually, setting 666 to /dev/smd0 opens a security hole, so i decided DSC USSD to requre root and set permissions itself and after request restore to 644.
Thanks to both of you.... Done a great Job!!!!!
/dev/smd7, qmi and radiooptions
_n0p_ said:
I've decided to take a shortcut right now:
http://forum.xda-developers.com/showpost.php?p=23607014&postcount=3234
Click to expand...
Click to collapse
I got a little step further: http://blogs.gnome.org/dcbw/2010/04/15/mobile-broadband-and-qualcomm-proprietary-protocols/ tells me, that there are multiple ways to talk to the radio.
The AT-commands port /dev/smd0 you use for the ussd workaround. And a proprietary protocol named qmi that works via shared memory. I guess our proprietary libril-qc-1.so uses this protocol and the kernel-process qmi is the other end of the communication.
The article talks about a second AT-Command port most cdma modems have, and indeed the streak 5 has that one in /dev/smd7.
sh-4.1# cat /dev/smd7 &
4729
sh-4.1# echo -e 'ATI\r' > /dev/smd7
sh-4.1# ATI
Manufacturer: Qisda Corporation
Model: Streak
Revision: GAUSB1A1406214 1 [Aug 18 2010 04:00:00]
IMEI: xxxxxxxxxxxxxxx
+GCAP: +CGSM,+DS,+ES
OK
So if /dev/smd0 is locked, use /dev/smd7 I'm now working, how this shared memory communication will look like.
There is a program in the gingerbread sources called radiooptions. That talks to the debug-api of the rild in /dev/socket/rild-debug. Users in the system group can trigger some radio related events with it:
Usage: radiooptions [option] [extra_socket_args]
0 - RADIO_RESET,
1 - RADIO_OFF,
2 - UNSOL_NETWORK_STATE_CHANGE,
3 - QXDM_ENABLE,
4 - QXDM_DISABLE,
5 - RADIO_ON,
6 apn- SETUP_PDP apn,
7 - DEACTIVE_PDP,
8 number - DIAL_CALL number,
9 - ANSWER_CALL,
10 - END_CALL
It was included in older dell roms, but not any more. I wonder why.
thanks to hunderteins for USSD patch..
Gingerbread and USSD QuD fix
Hello!
My name is noob, and since I can't post reply in the DEV threads, I'm trying here, in order to get some help;
I recently installed the stock 407 ROM and bumped into this USSD issue; following the threads in this forum i got to the USSD QuD fix and tried to install it via the Custom Recovery boot mode... where I'm currently stuck as the update process halts on the following error messages:
"E:failed to verify whole-file signature
E:signature verification failed"
Can anyone give me a push!? thanx!
Help
I'm new member here. I already fix the USSD problem but I have new problem that is I can't receive any SMS from Bank that sending me TAC code. The Bank will send SMS using short number (I don't know what to call) example 66628 to my number. Before upgrade I can receive the SMS from Bank. Thanks for help.
Related
ECHO is off.
Plug USB cable
wait 4 seconds and put battery back in.
waiting for OMAP44xx device...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
reading ASIC ID
usb_write 4
usb_read 81
[*] read 0 bytes
NumOfSubblocks: 0x5
Subblock ID: 0x1
Subblock Size: 0x5
CH enabled: 0x7
ROM revision: 0x4
Checksum Subblock: 0x15
CHIP: 4430
IDEN: 2fdb0e6e6889d0c9c305e350253785ffb2b874f7
MPKH: 5f4092eccddf90fa43f546adf89508b31b9c74795e9516194c0ea6412fdcb7f6
CRC0: 9c669ad9
CRC1: 682adccf
sending 2ndstage to target... f0030002
usb_write 4
usb_write 4
wait 5-lelelel...
[*] msg size = 4
usb_write 21552
[*] data size = 21552
usb_close
Reopen usb...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
waiting for 2ndstage response...
usb_read 4
usb_read got: 0, expected: 4, errno: 31
usb_read got GEN_FAILURE - got: 0, expected: 4, errno: 31
usb_read failed: 31
usb read = 0
unexpected 2ndstage response
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
how to fix it?
Hello,
After flashing CWM using "Rom Manager" I am stuck at the LG logo and below appears a text "security error";
Please advise. Thank you!
Try the offline fix in the general section. Or simply look around that forum
Sent from my LG-P769 using XDA Premium 4 mobile app
I'm having the same issue. I flashed fastboot and looks like it did it, but if I try to boot it it just won't go.. I have followed all the post regarding the issue but unfortunately nothing seems to be working for me.
ECHO is off.
Plug USB cable
wait 4 seconds and put battery back in.
waiting for OMAP44xx device...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
reading ASIC ID
usb_write 4
usb_read 81
[*] read 0 bytes
NumOfSubblocks: 0x5
Subblock ID: 0x1
Subblock Size: 0x5
CH enabled: 0x7
ROM revision: 0x4
Checksum Subblock: 0x15
CHIP: 4430
IDEN: d8a7f2b92c56cf93c5d33b11b7add3dce9718e3d
MPKH: 5f4092eccddf90fa43f546adf89508b31b9c74795e9516194c0ea6412fdcb7f6
CRC0: 9c669ad9
CRC1: 682adccf
sending 2ndstage to target... f0030002
usb_write 4
usb_write 4
wait 5-lelelel...
[*] msg size = 4
usb_write 21552
[*] data size = 21552
usb_close
Reopen usb...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
waiting for 2ndstage response...
usb_read 4
usb read = aabbccdd
accepted 2ndstage response
sending image to target...
size = 246272
usb_write 4
usb_write 246272
** Done **
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\fastboot\bin>fastboot.exe devices
C:\fastboot\bin>fastboot.exe devices
If I try either option 5 or 7, I get the same error:
ECHO is off.
Plug USB cable
wait 4 seconds and put battery back in.
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
reading ASIC ID
usb_write 4
AdbWriteEndpointSync returned 0, errno: 1167
usb_read 81
[*] read 0 bytes
NumOfSubblocks: 0x45
Subblock ID: 0x0
Subblock Size: 0x31
CH disabled: 0x34
ROM revision: 0x0
Checksum Subblock: 0x63
CHIP: 3300
IDEN: 003000390031002d003100340031003700300030
MPKH: 3300330033002d003500300030005c0044007200690076006500720043006100
CRC0: 00650000
CRC1: 00000000
sending 2ndstage to target... f0030002
usb_write 4
AdbWriteEndpointSync returned 0, errno: 1167
usb_write 4
AdbWriteEndpointSync returned 0, errno: 1167
wait 5-lelelel...
[*] msg size = 4
usb_write 21552
AdbWriteEndpointSync returned 0, errno: 1167
[*] data size = 21552
usb_close
Reopen usb...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
waiting for 2ndstage response...
usb_read 4
usb read = 2430010
unexpected 2ndstage response ***** <-----------------------
< waiting for device > ***** <-----------------------
.. and does not do anything more. I also tried using S/W upgrade mode however the KDZ tool does not recognize it no matter what. I doesn't even detect it as LG Mobile modem.
Any ideas?
saboteaur said:
I'm having the same issue. I flashed fastboot and looks like it did it, but if I try to boot it it just won't go.. I have followed all the post regarding the issue but unfortunately nothing seems to be working for me.
ECHO is off.
Plug USB cable
wait 4 seconds and put battery back in.
waiting for OMAP44xx device...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
reading ASIC ID
usb_write 4
usb_read 81
[*] read 0 bytes
NumOfSubblocks: 0x5
Subblock ID: 0x1
Subblock Size: 0x5
CH enabled: 0x7
ROM revision: 0x4
Checksum Subblock: 0x15
CHIP: 4430
IDEN: d8a7f2b92c56cf93c5d33b11b7add3dce9718e3d
MPKH: 5f4092eccddf90fa43f546adf89508b31b9c74795e9516194c0ea6412fdcb7f6
CRC0: 9c669ad9
CRC1: 682adccf
sending 2ndstage to target... f0030002
usb_write 4
usb_write 4
wait 5-lelelel...
[*] msg size = 4
usb_write 21552
[*] data size = 21552
usb_close
Reopen usb...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
waiting for 2ndstage response...
usb_read 4
usb read = aabbccdd
accepted 2ndstage response
sending image to target...
size = 246272
usb_write 4
usb_write 246272
** Done **
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\fastboot\bin>fastboot.exe devices
C:\fastboot\bin>fastboot.exe devices
If I try either option 5 or 7, I get the same error:
ECHO is off.
Plug USB cable
wait 4 seconds and put battery back in.
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
reading ASIC ID
usb_write 4
AdbWriteEndpointSync returned 0, errno: 1167
usb_read 81
[*] read 0 bytes
NumOfSubblocks: 0x45
Subblock ID: 0x0
Subblock Size: 0x31
CH disabled: 0x34
ROM revision: 0x0
Checksum Subblock: 0x63
CHIP: 3300
IDEN: 003000390031002d003100340031003700300030
MPKH: 3300330033002d003500300030005c0044007200690076006500720043006100
CRC0: 00650000
CRC1: 00000000
sending 2ndstage to target... f0030002
usb_write 4
AdbWriteEndpointSync returned 0, errno: 1167
usb_write 4
AdbWriteEndpointSync returned 0, errno: 1167
wait 5-lelelel...
[*] msg size = 4
usb_write 21552
AdbWriteEndpointSync returned 0, errno: 1167
[*] data size = 21552
usb_close
Reopen usb...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
waiting for 2ndstage response...
usb_read 4
usb read = 2430010
unexpected 2ndstage response ***** <-----------------------
< waiting for device > ***** <-----------------------
.. and does not do anything more. I also tried using S/W upgrade mode however the KDZ tool does not recognize it no matter what. I doesn't even detect it as LG Mobile modem.
Any ideas?
Click to expand...
Click to collapse
Maybe a hard reset then s/w mode
Sent from my LG-P769 using XDA Premium 4 mobile app
OK, I found the solution that worked for me at least:
Initially I followed this tutorial: http://forum.xda-developers.com/showthread.php?t=2085344
After following step by step for many many hours, I did something else. I removed the lines from host file and I stopped that web server.
Somehow(I don't know how exactly - it was 5am) I installed "LG Mobile Support Tool"(I think it has something to do with "LG Mobile United Mobile Driver" tool). Also, from what I remember, i deleted all old drivers.
Then, I removed the battery from phone, pressed the "vol+" button(and hold it) followed by inserting the usb cable; when in s/w mode I added the battery;
Using this tool "LG Mobile Support Tool" the phone was connected to PC, therefore, the application downloaded the original soft from LG site.
The installer began, some magic happened, at 95% phone restarted and an android with a red triangle appeared on screen.
After the upgrade process was finished(at 100% I pressed the power button 'till the phone shut down;
Then I started it; the phone was working fine, original recovery tool was installed, root was removed, but all programs and settings were still there; nothing was lost.
Reference:
http://forum.xda-developers.com/showpost.php?p=40483954&postcount=2
http://forum.xda-developers.com/showthread.php?t=2085344
Q&A for [FASTBOOT][RECOVERY] omap4boot for P940
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer. Thanks for understanding and for helping to keep XDA neat and tidy! :smile:
milaq said:
1.3 - Initial release
Click to expand...
Click to collapse
The file seems to be unavailable.
Milaq can you do something about that?
Thanks
Hi Milaq, the omap4tool seems to be unavailable for download. Can you help me with that?
Thanks
Still Stuck in < waiting for device >
I have done this step a lot of times, but it stays stuck in:
--------------------------------------------
OMAP4boot for P940/SU540
--------------------------------------------
by wkpark <[email protected]>
modified by milaq <[email protected]>
[1] p940 - Prada 3.0 (P940)
[2] su540 - Prada 3.0 for asian market (SU540/KU5400)
[x] exit
-------------------------------------------
Select your device: 1
p940 selected
****** plug in usb with the phone powered off and the battery NOT inserted ****
**
waiting for OMAP44xx device...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
reading ASIC ID
usb_write 4
usb_read 81
[*] read 0 bytes
NumOfSubblocks: 0x5
Subblock ID: 0x1
Subblock Size: 0x5
CH enabled: 0x7
ROM revision: 0x4
Checksum Subblock: 0x15
CHIP: 4430
IDEN: 86fc18680b8fc8c812852decc918bcd922c5fcd3
MPKH: 5f4092eccddf90fa43f546adf89508b31b9c74795e9516194c0ea6412fdcb7f6
CRC0: 9c669ad9
CRC1: 682adccf
sending 2ndstage to target... f0030002
usb_write 4
usb_write 4
wait 5-seconds...
[*] msg size = 4
usb_write 21552
[*] data size = 21552
usb_close
Reopen usb...
Device descriptor:
bLength = 18
bDescriptorType = 1
bcdUSB = 528
bDeviceClass = 255
bDeviceSubClass = 255
bDeviceProtocol = 255
bMaxPacketSize0 = 64
idVendor = 451
idProduct = D00F
bcdDevice = 0
iManufacturer = 33
iProduct = 37
iSerialNumber = 0
bNumConfigurations = 1
waiting for 2ndstage response...
usb_read 4
usb read = aabbccdd
accepted 2ndstage response
sending image to target...
size = 246272
usb_write 4
usb_write 246272
** Done **
****** insert battery NOW ******
looking for attached fastboot devices...
===============================
===============================
is your phone displaying the lg logo (fastboot v0.5) and did your device show up
above? (Y/n) ?y
do you want to flash a custom recovery? (y/N) ?y
****************************
< waiting for device >
Did you do samoething diferent to pass this?
Hello,
Can someone explain to me, how to change files of a rom so the ir remote control works again?
thx,
Mark-1978
if you have root you can change the file from system/etc/remote.conf
drakulaboy said:
if you have root you can change the file from system/etc/remote.conf
Click to expand...
Click to collapse
Tried that, rebooted, but remote still not working. Used the original remote.conf file. Maybe it's a combination of firmware and remote.conf. Or there is another keylayout file. Tried a lot, just not again all the different remote.conf files.
mark-1978 said:
Tried that.
Click to expand...
Click to collapse
from what device is the remote and what device do you want to use with the remote?
it's this remote(picture): http://mxqproject.com/tutorial-andr...r-remote-control-after-firmware-installation/
And the rom is android 7.1.2 for p212.
The led of the box does light up when i press a button on the remote, but the software doesn't respond.
mark-1978 said:
Tried that, rebooted, but remote still not working. Used the original remote.conf file. Maybe it's a combination of firmware and remote.conf. Or there is another keylayout file. Tried a lot, just not again all the different remote.conf files.
Click to expand...
Click to collapse
Have you grabbed the remote.conf while the Stock Firmware was actually installed and copied that file over? Or have you only tried the files linked from the Video? Also, I don't know if you already have or not, but make sure the box has Root Access first with Magisk and enable show hidden files through ES File Explorer to look for the Remote.conf file.
whiteak said:
Have you grabbed the remote.conf while the Stock Firmware was actually installed and copied that file over? Or have you only tried the files linked from the Video? Also, I don't know if you already have or not, but make sure the box has Root Access first with Magisk and enable show hidden files through ES File Explorer to look for the Remote.conf file.
Click to expand...
Click to collapse
Took a rom for another device, but p212 and flashed that. For the remote, only down arrow works, up arrow gives right arrow, and youtube open app works, and music player app open works with remote. Tried pasting all kinds of remote.conf files, didn't work. Did replace the complete usr folder with stock 7.1.2 one, didn't work. Replaced remotecfg file, didn't work. Always the remote control has the same behaviour, with all the changes i made.
mark-1978 said:
Took a rom for another device, but p212 and flashed that. For the remote, only down arrow works, up arrow gives right arrow, and youtube open app works, and music player app open works with remote. Tried pasting all kinds of remote.conf files, didn't work. Did replace the complete usr folder with stock 7.1.2 one, didn't work. Replaced remotecfg file, didn't work. Always the remote control has the same behaviour, with all the changes i made.
Click to expand...
Click to collapse
I would try flashing back your Stock firmware for your device where you know the Remote works, Root with Magisk, install ES File, and grab the remote.conf from your actual working Stock Rom and try that file. Do you even have your original Stock Firmware or only another Rom from another device? If you don't have your original Stock firmware for your device, that's your first step, find it and flash that, you need it, not a Rom from another device regardless if it is P212 or not, you've already proven that it doesn't work.
the box does respond a bit(light led goes off and on) when i press a button. The dmesg -c command tells something about led going off and on too.
I always have a wireless keyboard connected to the box. Isn't it posible to use that to power on the box?
For now, it's a rf wireless turn on and off system i use for the android box.
Added the remote.conf from the installed rom. The 'volume -'button turns the android box off. Another press of the button doesn't turn on the box.
remote.conf from rom installed on box:
#*********************************************************************************************************
#this file is configuration for each factory remote device
# work_mode 0 :software mode 1 :hardware mode
# repeat_enable 0 :disable repeat 1 :enable repeat
#
# factory_code each device has it's unique factory code.
# pattern:custom_code(16bit)+index_code(16bit)
# examble: 0xff000001 = 0xff00(custom cod) 0001 (index)
#
# release_delay unit:ms.release will report from kernel to user layer after this period of time
# from press or repeat triggered.
#
# debug_enable 0 :debug disable 1 :debug disable
#
# SW MODE:
# bit_count how many bits in each frame
# tw_leader_act time window for leader active
# tw_bit0 time window for bit0 time.
# tw_bit1 time window for bit1 time
# tw_repeat_leader time window for repeat leader
# REG
# reg_base_gen set value for PREG_IR_DEC_BASE_GEN
# reg_control set value for PREG_IR_DEC_CONTROL
# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE
# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE
# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME
#*************************************************************************************************************
#amlogic NEC remote
work_mode = 0
repeat_enable = 1
repeat_delay = 130
repeat_peroid = 120
release_delay = 20
debug_enable = 1
fn_key_scancode = 0x44
left_key_scancode = 0x10
right_key_scancode = 0x11
up_key_scancode = 0x0b
down_key_scancode = 0x0e
ok_key_scancode = 0x0d
pageup_key_scancode = 0x1e
pagedown_key_scancode = 0x1f
custom_begin
factory_infcode = 0
factory_code = 0x40400001
mouse_begin
0 0x10
1 0x11
2 0x0b
3 0x0e
mouse_end
key_begin
0x4d 116
0x43 113
0x53 226
0x5b 0x179
0x57 150
0x54 0x16a
0x1c 114
0x1e 0x19c
0x1f 0x197
0x15 115
0x1a 102
0x42 158
0x45 139
# 0x44 0
0x0b 103
0x0e 108
0x10 105
0x11 106
0x0d 28
0x01 2
0x02 3
0x03 4
0x04 5
0x05 6
0x06 7
0x07 8
0x08 9
0x09 10
0x0f 0x175
0x00 11
0x0c 14
key_end
repeat_key_begin
0x4d 116
0x43 113
0x53 226
0x5b 0x179
0x57 150
0x54 0x16a
0x1c 114
0x1e 0x19c
0x1f 0x197
0x15 115
0x1a 102
0x42 158
0x45 139
# 0x44 0
0x0b 103
0x0e 108
0x10 105
0x11 106
0x0d 28
0x01 2
0x02 3
0x03 4
0x04 5
0x05 6
0x06 7
0x07 8
0x08 9
0x09 10
0x0f 0x175
0x00 11
0x0c 14
repeat_key_end
custom_end
custom_begin
factory_infcode = 1
factory_code = 0xbd020001
key_begin
0xca 103
0xd2 108
0x99 105
0xc1 106
0xce 97
0x45 116
0xc5 133
0x80 113
0xd0 15
0xd6 125
0x95 102
0xdd 104
0x8c 109
0x89 131
0x9c 130
0x9a 120
0xcd 121
key_end
custom_end
remote.conf from originally rom and remote of the box:
#*********************************************************************************************************
#this file is configuration for each factory remote device
# work_mode 0 :software mode 1 :hardware mode
# repeat_enable 0 :disable repeat 1 :enable repeat
#
# factory_code each device has it's unique factory code.
# pattern:custom_code(16bit)+index_code(16bit)
# examble: 0xff000001 = 0xff00(custom cod) 0001 (index)
#
# release_delay unit:ms.release will report from kernel to user layer after this period of time
# from press or repeat triggered.
#
# debug_enable 0 :debug disable 1 :debug disable
#
# SW MODE:
# bit_count how many bits in each frame
# tw_leader_act time window for leader active
# tw_bit0 time window for bit0 time.
# tw_bit1 time window for bit1 time
# tw_repeat_leader time window for repeat leader
# REG
# reg_base_gen set value for PREG_IR_DEC_BASE_GEN
# reg_control set value for PREG_IR_DEC_CONTROL
# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE
# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE
# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME
#*************************************************************************************************************
#amlogic NEC remote
work_mode = 0
repeat_enable = 1
repeat_delay = 130
repeat_peroid = 120
release_delay = 20
debug_enable = 1
fn_key_scancode = 0x15
left_key_scancode = 0x1c
right_key_scancode = 0x48
up_key_scancode = 0x44
down_key_scancode = 0x1d
ok_key_scancode = 0x1e
pageup_key_scancode = 0x04
pagedown_key_scancode = 0x1b
custom_begin
factory_infcode = 0
factory_code = 0xfb040001
mouse_begin
0 0x1c
1 0x48
2 0x44
3 0x1d
mouse_end
key_begin
0x47 11
0x13 2
0x10 3
0x11 4
0x0F 5
0x0C 6
0x0D 7
0x0B 8
0x08 9
0x09 10
0x5C 97
0x51 65
0x49 14
0x06 130
0x14 131
0x44 103
0x1D 108
0x1C 105
0x48 106
0x53 125
0x45 104
0x19 109
0x16 102
0x52 119
0x05 122
0x59 123
0x1b 120
0x04 121
0x1A 116
0x0A 15
0x0e 113
0x15 63
0x1F 102
0x1e 132
0x07 133
0x12 134
0x54 135
0x02 136
0x4f 30
0x42 48
0x5d 46
0x4c 32
0x58 137
0x55 140
key_end
repeat_key_begin
0x47 11
0x13 2
0x10 3
0x11 4
0x0F 5
0x0C 6
0x0D 7
0x0B 8
0x08 9
0x09 10
0x5C 97
0x51 65
0x49 14
0x06 130
0x14 131
0x44 103
0x1D 108
0x1C 105
0x48 106
0x53 125
0x45 104
0x19 109
0x16 102
0x52 119
0x05 122
0x59 123
0x1b 120
0x04 121
0x1A 116
0x0A 15
0x0e 113
0x15 63
0x1F 102
0x1e 132
0x07 133
0x12 134
0x54 135
0x02 136
0x4f 30
0x42 48
0x5d 46
0x4c 32
0x58 137
0x55 140
repeat_key_end
custom_end
custom_begin
factory_infcode = 1
factory_code = 0xfb000001
mouse_begin
0 0x08
1 0x0b
2 0x17
3 0x0f
mouse_end
key_begin
# < > dn up
0x0b 105
0x17 106
0x1b 108
0x0f 103
#ok back
0x1f 232
0x03 158
#menu home
0x02 125
0x01 102
#v- mute v+
0x09 114
0x0e 113
0x06 115
#out in
0x04 130
0x05 131
#power fn del
0x0a 116
0x08 63
0x07 14
key_end
repeat_key_begin
# < > dn up
0x0b 105
0x17 106
0x1b 108
0x0f 103
#ok back
0x1f 232
0x03 158
#menu home
0x02 125
0x01 102
#v- mute v+
0x09 114
0x0e 113
0x06 115
#out in
0x04 130
0x05 131
#power fn del
0x0a 116
0x08 63
0x07 14
repeat_key_end
custom_end
custom_begin
factory_infcode = 2
factory_code = 0x40400001
mouse_begin
0 0x10
1 0x11
2 0x0b
3 0x0e
mouse_end
key_begin
# 0 - 9
0x00 11
0x01 2
0x02 3
0x03 4
0x04 5
0x05 6
0x06 7
0x07 8
0x08 9
0x09 10
#del
0x0c 14
#recent apps
0x42 149
#web tv all_app
0x53 146
0x5b 147
0x54 145
#switch
0x44 888
# < >
0x10 105
0x11 106
0x0e 108
0x0b 103
#ok back
0x0d 232
0x42 158
#menu home
0x45 125
0x1a 102
#v- mute v+
0x17 114
0x43 113
0x18 115
#|<< >| || >>|
0x1f 122
0x40 119
0x41 128
0x1e 123
#power fn
0x4d 116
0x47 63
key_end
repeat_key_begin
# 0 - 9 del space explorer
0x00 11
0x01 2
0x02 3
0x03 4
0x04 5
0x05 6
0x06 7
0x07 8
0x08 9
0x09 10
#del
0x0c 14
#recent apps
0x42 149
#web tv all_app
0x53 146
0x5b 147
0x54 145
#switch
0x44 888
# < >
0x10 105
0x11 106
0x0e 108
0x0b 103
#ok back
0x0d 232
0x45 158
#menu home
0x1d 125
0x1a 102
#v- mute v+
0x17 114
0x43 113
0x18 115
#|<< >| || >>|
0x1f 122
0x40 119
0x41 128
0x1e 123
#power fn
0x4d 116
0x47 63
repeat_key_end
custom_end
custom_begin
factory_infcode = 3
factory_code = 0xff000001
mouse_begin
0 0x47
1 0x15
2 0x46
3 0x16
mouse_end
key_begin
# < > dn up
0x0e 105
0x1a 106
0x02 108
0x03 103
#ok back
0x07 232
0x5c 158
#menu home
0x13 125
0x48 102
#mute v- v+
0x01 113
0x58 114
0x0b 115
#power
0x14 116
key_end
repeat_key_begin
# < > dn up
0x0e 105
0x1a 106
0x02 108
0x03 103
#ok back
0x07 232
0x5c 158
#menu home
0x13 125
0x48 102
#mute v- v+
0x01 113
0x58 114
0x0b 115
#power
0x14 116
repeat_key_end
custom_end
custom_begin
factory_infcode = 4
factory_code = 0xfe010001
mouse_begin
0 0x51
1 0x50
2 0x16
3 0x1a
mouse_end
key_begin
# < > dn up
0x51 105
0x50 106
0x1a 108
0x16 103
#ok back
0x13 232
0x19 158
#menu home
0x00 125
0x11 102
#v- mute v+
0x10 114
0x45 113
0x18 115
#power fn del
0x40 116
0x4c 63
0x42 14
# 0 - 9
0x01 11
0x4e 2
0x0d 3
0x0c 4
0x4a 5
0x09 6
0x08 7
0x46 8
0x05 9
0x04 10
#|<< play stop >>| << >>
0x4b 122
# 0x5a 119
# 0x52 128
0x4f 123
# 0x55 121
# 0x54 120
#zoom setup photo music file allapp
0x14 130
0x0a 131
# 0x49 144
# 0x0a 143
# 0x48 148
#
# 0x4d 146
# 0x0e 146
# 0x0f 145
0x15 145
#setting search subtitle audio miracast browser
0x0f 142
# 0x03 127
# 0x06 149
# 0x44 150
0x43 193
0x41 146
key_end
repeat_key_begin
# < > dn up
0x51 105
0x50 106
0x1a 108
0x16 103
#ok back
0x13 232
0x19 158
#menu home
0x00 125
0x11 102
#v- mute v+
0x10 114
0x45 113
0x18 115
#power fn del
0x40 116
0x4c 63
0x42 14
# 0 - 9
0x01 11
0x4e 2
0x0d 3
0x0c 4
0x4a 5
0x09 6
0x08 7
0x46 8
0x05 9
0x04 10
#|<< play stop >>| << >>
0x4b 122
# 0x5a 119
# 0x52 128
0x4f 123
# 0x55 121
# 0x54 120
#zoom setup photo music file allapp
0x14 130
0x0a 131
# 0x49 144
# 0x0a 143
# 0x48 148
#
# 0x4d 146
# 0x0e 146
# 0x0f 145
0x15 145
#setting search subtitle audio miracast browser
0x0f 142
# 0x03 127
# 0x06 149
# 0x44 150
0x43 193
0x41 146
repeat_key_end
custom_end
custom_begin
factory_infcode = 5
factory_code = 0xfd020001
mouse_begin
0 0x5d
1 0x5c
2 0x06
3 0x1f
mouse_end
key_begin
# < > dn up
0x5d 105
0x5c 106
0x1f 108
0x06 103
#ok back
0x1e 232
0x1b 158
#menu home
0x58 125
0x59 102
#v- mute v+
0x16 114
0x43 113
0x44 115
#power fn del
0x1a 116
0x0b 63
0x0c 14
#play << >>
0x55 119
0x54 121
0x17 120
#|<< >>|
0x14 122
0x1c 123
# 0 - 9
0x00 11
0x01 2
0x02 3
0x03 4
0x04 5
0x05 6
0x1d 7
0x07 8
0x08 9
0x09 10
#file tv web set
0x53 148
0x12 147
0x57 146
0x52 142
#PHOTO PAGE_UP PAGE_DOWN MUSIC
0x10 144
0x18 61
0x19 62
0x11 143
#info language miracast wifi
0x42 152
0x13 192
0x41 193
0x15 194
key_end
repeat_key_begin
# < > dn up
0x5d 105
0x5c 106
0x1f 108
0x06 103
#ok back
0x1e 232
0x1b 158
#menu home
0x58 125
0x59 102
#v- mute v+
0x16 114
0x43 113
0x44 115
#power fn del
0x1a 116
0x0b 63
0x0c 14
#play << >>
0x55 119
0x54 121
0x17 120
#|<< >>|
0x14 122
0x1c 123
# 0 - 9
0x00 11
0x01 2
0x02 3
0x03 4
0x04 5
0x05 6
0x1d 7
0x07 8
0x08 9
0x09 10
#file tv web set
0x53 148
0x12 147
0x57 146
0x52 142
#PHOTO PAGE_UP PAGE_DOWN MUSIC
0x10 144
0x18 61
0x19 62
0x11 143
#info language miracast wifi
0x42 152
0x13 192
0x41 193
0x15 194
repeat_key_end
custom_end
custom_begin
factory_infcode = 6
factory_code = 0xdf000001
mouse_begin
0 0x47
1 0x07
2 0x1a
3 0x48
mouse_end
key_begin
# < > dn up
0x47 105
0x07 106
0x48 108
0x1a 103
#ok back
0x06 232
0x0a 158
#menu home
0x18 125
0x42 102
#v- mute v+
0x5c 114
0x5f 113
0x5d 115
#power fn del allapp browser
0x1c 116
0x03 63
0x10 14
0x01 145
0x41 146
#|<< >>|
0x4b 122
0x4f 123
# 0 - 9
0x0c 11
0x54 2
0x16 3
0x15 4
0x50 5
0x12 6
0x11 7
0x4c 8
0x0e 9
0x0d 10
key_end
repeat_key_begin
# < > dn up
0x47 105
0x07 106
0x48 108
0x1a 103
#ok back
0x06 232
0x0a 158
#menu home
0x18 125
0x42 102
#v- mute v+
0x5c 114
0x5f 113
0x5d 115
#power fn del allapp browser
0x1c 116
0x03 63
0x10 14
0x01 145
0x41 146
#|<< >>|
0x4b 122
0x4f 123
# 0 - 9
0x0c 11
0x54 2
0x16 3
0x15 4
0x50 5
0x12 6
0x11 7
0x4c 8
0x0e 9
0x0d 10
repeat_key_end
custom_end
custom_begin
factory_infcode = 7
factory_code = 0x1dcc0001
mouse_begin
0 0x10
1 0x12
2 0x07
3 0x44
mouse_end
key_begin
# < > dn up
0x10 105
0x12 106
0x44 108
0x07 103
#ok back
0x11 232
0x0f 158
#menu home
0x40 125
0x03 102
#v- v+
0x02 114
0x0e 115
#power fn del tv allapp browser kodi
0x00 116
0x4c 63
0x4a 14
0x01 147
0x0d 145
0x09 146
0x05 193
#|<< >>|
0x06 122
0x0a 123
# 0 - 9
0x49 11
0x41 2
0x45 3
0x4d 4
0x42 5
0x46 6
0x4e 7
0x43 8
0x47 9
0x4f 10
key_end
repeat_key_begin
# < > dn up
0x10 105
0x12 106
0x44 108
0x07 103
#ok back
0x11 232
0x0f 158
#menu home
0x40 125
0x03 102
#v- v+
0x02 114
0x0e 115
#power fn del tv allapp browser kodi
0x00 116
0x4c 63
0x4a 14
0x01 147
0x0d 145
0x09 146
0x05 193
#|<< >>|
0x06 122
0x0a 123
# 0 - 9
0x49 11
0x41 2
0x45 3
0x4d 4
0x42 5
0x46 6
0x4e 7
0x43 8
0x47 9
0x4f 10
repeat_key_end
custom_end
Unless that is from your Original Stock firmware for your device that means nothing, and from the looks of it, it isn't, you already know that the remote.conf from another rom doesn't work, like I said earlier, your first step is getting the original Stock firmware for your device, until you do that, you're not going to get anywhere with this.
whiteak said:
Unless that is from your Original Stock firmware for your device that means nothing, and from the looks of it, it isn't, you already know that the remote.conf from another rom doesn't work, like I said earlier, your first step is getting the original Stock firmware for your device, until you do that, you're not going to get anywhere with this.
Click to expand...
Click to collapse
Do you know what command the box uses to power on and off? So the second of the two numbers in the remote.conf. Firts '0x1d' which is the button pressed, then a number, which is the command, for example the powr button command.
If i know which command is the one for powerbutton, i could alter that in the remote.conf and maybe the box will turn on and off with that button. I think '116' is the command of the power button. And '0x11 is the input for a working button on the installed rom. Now if i put in '0x11 116', the down button should be the power button For when i press down on the installed rom with current remote, i select to the right > .
Tried it, not working.
the remote control looks like this one: https://www.ebay.com/itm/NEW-Replac...III-Android-TV-Box-MX-III-MX3-3-/141999406704
used this article to read the incoming remote signals.
power status led resume: KD, ZOOM, <<, HOME, BACK, UP, DOWN, FLAG WITH TWO LEGS, MOUSE, 1, 2, 6, 5, 7, 8, 9, 0, X IN RECTANGLE, WORLD SYMBOL,
playback enable: APPS
79 (readport): >>
video off: volume plus
video on: volume down
81 (readport): left
80 (readport): right
exit program: 3 and 4
the left side are what the reading program says of it, the right side are the pressed buttons on the remote. These are from the installed rom.
maybe it has something to do with the factorycode. If that isn't the code of the used remote control, all the text below will be ignored. So, how to find the right factorycode?
tried the dmesg command to read out the remote signals, but didn't get much further.
used this topic.
made a printscreen of the readings of some pressed buttons on the remote control.
Finally installed magicsee iron tv box firmware(p212) and even the remote works.
Youtube stuttered, that was because my tv is a 50hz one and android had set the resolution to 60hz, which is incompatible for the tv. So putting it to 50hz solved the youtube lag.
mark-1978 said:
Finally installed magicsee iron tv box firmware(p212) and even the remote works.
Youtube stuttered, that was because my tv is a 50hz one and android had set the resolution to 60hz, which is incompatible for the tv. So putting it to 50hz solved the youtube lag.
Click to expand...
Click to collapse
What TV have you got?
I didnt know any modern tvs being made that was restricted to just 50hz.
Sure alot of TVs in England advertise 50hz but they all support 60hz, just UK broadcasts still done at 50hz.
Tonian1878 said:
What TV have you got?
I didnt know any modern tvs being made that was restricted to just 50hz.
Sure alot of TVs in England advertise 50hz but they all support 60hz, just UK broadcasts still done at 50hz.
Click to expand...
Click to collapse
You're probably right. Must have been a bad youtube recording.
On second thought, youtube definately is skipping frames as a set the resolution to 60hz. It's a 50hz tv, but you can connect at 60hz. When i set the framerate to 50 hz, no more skipping frames.
edit: installed another android 7.1.2 rom with level 1 and level 2 framestabilizers. But youtube still sucks. The advertizing in between the youtube movies are perfect, but when i watch live concert videos, there's stutter a lot. Maybe it's an s905x/vp9 codec incompatibility, since all youtube movies are encoded in vp9. Can't just replace the vp decoder file from the rom, or there's a bootloop or stuck at boot. If youtube would make one standard for all movies that make them more compatible, that would be great. Maybe i should try a really old version of youtube app.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Introduction
In this article, we will learn about Huawei Safety detect kit.
What is Safety detect?
Safety Detect builds robust security capabilities, including system integrity check (SysIntegrity), app security check (AppsCheck), malicious URL check (URLCheck), fake user detection (UserDetect), and malicious Wi-Fi detection (WifiDetect), into your app, effectively protecting it against security threats.
Why do we need to use safety detect?
Mobile applications capture almost 90% of people’s time on mobile devices, while the rest of the time is spent browsing the web. So basically now a day’s mobile usage is more than the web. Since all the users are using smart mobile phones for daily needs like, reading news, email, online shopping, booking taxi, and wallets to pay, educational apps etc. Even for banking transaction there was time people use to stand in the queue to deposit or withdraw, but now everything can be done in mobile application with just 2 to 3 clicks. Since everything happening over the phone definitely we should provide security to mobile apps.
Now let’s see what all are the security features provided by Huawei Safety detect kit.
SysIntegrity
AppsCheck
URLCheck
UserDetect
WifiDetect
Integration of Safety detect
1. Configure application on the AGC.
2. Client application development process.
Configure application on the AGC
Follow the steps.
Step 1: We need to register as a developer account in AppGallery Connect. If you are already developer ignore this step.
Step 2: Create an app by referring to Creating a Project and Creating an App in the Project
Step 3: Set the data storage location based on current location.
Step 4: Enabling Safety detect. Open AppGallery connect, choose Manage API > Safety Detect
Step 5: Generating a Signing Certificate Fingerprint.
Step 6: Configuring the Signing Certificate Fingerprint.
Step 7: Download your agconnect-services.json file, paste it into the app root directory.
Client application development process
Follow the steps
Step 1: Create flutter application in the Android studio (Any IDE which is your favorite).
Step 2: Add the App level gradle dependencies. Choose inside project Android > app > build.gradle.
1
2apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
Root level gradle dependencies.
1
2maven { url 'https://developer.huawei.com/repo/' }
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Step 3: Download plugin from here
Step 4: Add downloaded file into outside project directory. Declare plugin path in pubspec.yaml file under dependencies.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30dependencies:
flutter:
sdk: flutter
huawei_account:
path: ../huawei_account/
huawei_location:
path: ../huawei_location/
huawei_map:
path: ../huawei_map/
huawei_analytics:
path: ../huawei_analytics/
huawei_site:
path: ../huawei_site/
huawei_push:
path: ../huawei_push/
huawei_dtm:
path: ../huawei_dtm/
huawei_ml:
path: ../huawei_ml/
huawei_safetydetect:
path: ../huawei_safetydetect/
agconnect_crash: ^1.0.0
agconnect_remote_config: ^1.0.0
http: ^0.12.2
camera:
path_provider:
path:
image_picker:
fluttertoast: ^7.1.6
shared_preferences: ^0.5.12+4
Step 5: Build flutter application
In this example, I’m checking user detection in the taxi booking application. Whenever user sign up with Huawei, I’m checking user detection success, then it will be navigating user to home screen to book a cab.
SysIntegrity: Checks whether the device running your app is secure, for example, whether it is rooted. The SysIntegrity API is called to check the system integrity of a device. If the device is not safe, appropriate measures are taken.
AppsCheck: Obtains a list of malicious apps. You can obtain all malicious applications and evaluate whether you can restrict the behavior of your application based on the risk.
You can directly call the getMaliciousAppsList() method to get all the malicious apps.
URLCheck: Determines the threat type of a specific URL. You can determine the dangerous URLs using URL Check API. Currently UrlSafety API provide determinate Malware and Phishing threats. When you visit a URL, this API checks whether the URL is a malicious one. If so, you can evaluate the risk and alert the user about the risk or block the URL.
User Detect: Checks whether your app is interacting with a fake user. This API can help your app to prevent batch registration, credential stuffing attacks, activity bonus hunting, and content crawling. If a user is a suspicious one or risky one, a verification code is sent to the user for secondary verification. If the detection result indicates that the user is a real one, the user can sign in to my app. Otherwise, the user is not allowed to Home page.
WifiDetect: Checks whether the Wi-Fi to be connected is secure. This API checks characteristics of the Wi-Fi and router to be connected, analyzes the Wi-Fi information, and returns the Wi-Fi detection results after classification, helping you to prevent possible attacks to your app from malicious Wi-Fi. If attacks are detected, app can interrupt the user operation or it will asks user permission.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import 'package:agconnect_crash/agconnect_crash.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:huawei_account/huawei_account.dart';
import 'package:huawei_safetydetect/huawei_safetydetect.dart';
import 'package:taxibooking/analytics/analyticsutil.dart';
import 'package:taxibooking/constants/constants.dart';
import 'package:taxibooking/models/accountmodel.dart';
import 'package:taxibooking/ui/accountscreen.dart';
import 'package:taxibooking/ui/widgets/custom_shape.dart';
import 'package:taxibooking/ui/widgets/customappbar.dart';
import 'package:taxibooking/ui/widgets/responsive_ui.dart';
import 'package:taxibooking/ui/widgets/textformfield.dart';
import 'package:taxibooking/utils/validator.dart';
import 'home.dart';
class SignUpScreen extends StatefulWidget {
@override
_SignUpScreenState createState() => _SignUpScreenState();
}
class _SignUpScreenState extends State<SignUpScreen> {
bool checkBoxValue = false;
double _height;
double _width;
double _pixelRatio;
bool _large;
bool _medium;
String appId;
@override
Widget build(BuildContext context) {
_height = MediaQuery.of(context).size.height;
_width = MediaQuery.of(context).size.width;
_pixelRatio = MediaQuery.of(context).devicePixelRatio;
_large = ResponsiveWidget.isScreenLarge(_width, _pixelRatio);
_medium = ResponsiveWidget.isScreenMedium(_width, _pixelRatio);
return Material(
child: Scaffold(
body: Container(
height: _height,
width: _width,
margin: EdgeInsets.only(bottom: 5),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Opacity(opacity: 0.88, child: CustomAppBar()),
clipShape(),
form(),
acceptTermsTextRow(),
SizedBox(
height: _height / 35,
),
button(),
infoTextRow(),
socialIconsRow(),
signInTextRow(),
],
),
),
),
),
);
}
@override
void initState() {
super.initState();
getAppId();
//getWifiDetectStatus();
AnalyticsUtil.pageEnd("Sign up screen");
}
@override
void dispose() {
super.dispose();
AnalyticsUtil.pageEnd("Sign up screen");
}
Widget clipShape() {
return Stack(
children: <Widget>[
Opacity(
opacity: 0.75,
child: ClipPath(
clipper: CustomShapeClipper(),
child: Container(
height: _large
? _height / 8
: (_medium ? _height / 7 : _height / 6.5),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.orange[200], Colors.pinkAccent],
),
),
),
),
),
Opacity(
opacity: 0.5,
child: ClipPath(
clipper: CustomShapeClipper2(),
child: Container(
height: _large
? _height / 12
: (_medium ? _height / 11 : _height / 10),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.orange[200], Colors.pinkAccent],
),
),
),
),
),
Container(
height: _height / 5.5,
alignment: Alignment.center,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
spreadRadius: 0.0,
color: Colors.black26,
offset: Offset(1.0, 10.0),
blurRadius: 20.0),
],
color: Colors.white,
shape: BoxShape.circle,
),
child: GestureDetector(
onTap: () {
print('Adding photo');
},
child: Icon(
Icons.add_a_photo,
size: _large ? 40 : (_medium ? 33 : 31),
color: Colors.red[500],
)),
),
],
);
}
Widget form() {
return Container(
margin: EdgeInsets.only(
left: _width / 12.0, right: _width / 12.0, top: _height / 20.0),
child: Form(
child: Column(
children: <Widget>[
firstNameTextFormField(),
SizedBox(height: _height / 60.0),
lastNameTextFormField(),
SizedBox(height: _height / 60.0),
emailTextFormField(),
SizedBox(height: _height / 60.0),
phoneTextFormField(),
SizedBox(height: _height / 60.0),
passwordTextFormField(),
],
),
),
);
}
Widget firstNameTextFormField() {
return CustomTextField(
keyboardType: TextInputType.text,
icon: Icons.person,
hint: "First Name",
);
}
Widget lastNameTextFormField() {
return CustomTextField(
keyboardType: TextInputType.text,
icon: Icons.person,
hint: "Last Name",
);
}
Widget emailTextFormField() {
return CustomTextField(
keyboardType: TextInputType.emailAddress,
icon: Icons.email,
hint: "Email ID",
);
}
Widget phoneTextFormField() {
return CustomTextField(
keyboardType: TextInputType.number,
icon: Icons.phone,
hint: "Mobile Number",
);
}
Widget passwordTextFormField() {
return CustomTextField(
keyboardType: TextInputType.text,
obscureText: true,
icon: Icons.lock,
hint: "Password",
);
}
Widget acceptTermsTextRow() {
return Container(
margin: EdgeInsets.only(top: _height / 100.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Checkbox(
activeColor: Colors.red[500],
value: checkBoxValue,
onChanged: (bool newValue) {
setState(() {
checkBoxValue = newValue;
});
}),
Text(
"I accept all terms and conditions",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: _large ? 12 : (_medium ? 11 : 10)),
),
],
),
);
}
Widget button() {
return RaisedButton(
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)),
onPressed: () {
print("Routing to your account");
},
textColor: Colors.white,
padding: EdgeInsets.all(0.0),
child: Container(
alignment: Alignment.center,
// height: _height / 20,
width: _large ? _width / 4 : (_medium ? _width / 3.75 : _width / 3.5),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.0)),
gradient: LinearGradient(
colors: <Color>[Colors.yellow[800], Colors.red],
),
),
padding: const EdgeInsets.all(12.0),
child: Text(
'SIGN UP',
style: TextStyle(fontSize: _large ? 14 : (_medium ? 12 : 10)),
),
),
);
}
Widget infoTextRow() {
return Container(
margin: EdgeInsets.only(top: _height / 40.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"Or create using social media",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: _large ? 12 : (_medium ? 11 : 10)),
),
],
),
);
}
Widget socialIconsRow() {
return Container(
margin: EdgeInsets.only(top: _height / 80.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
GestureDetector(
onTap: () {
print("Huawei sign in clicked");
signInWithHuaweiAccount();
},
child: CircleAvatar(
radius: 25.0,
backgroundImage:
AssetImage("assets/images/huaweilogo_288x288.png"),
),
),
SizedBox(
width: 20,
),
CircleAvatar(
radius: 25,
backgroundImage: AssetImage("assets/images/fblogo.jpg"),
),
SizedBox(
width: 20,
),
CircleAvatar(
radius: 25,
backgroundImage: AssetImage("assets/images/twitterlogo.jpg"),
),
],
),
);
}
Widget signInTextRow() {
return Container(
margin: EdgeInsets.only(top: _height / 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"Already have an account?",
style: TextStyle(fontWeight: FontWeight.w400),
),
SizedBox(
width: 5,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(SIGN_IN);
print("Routing to Sign up screen");
},
child: Text(
"Sign in",
style: TextStyle(
fontWeight: FontWeight.w800,
color: Colors.red[800],
fontSize: 19),
),
)
],
),
);
}
void signInWithHuaweiAccount() async {
HmsAuthParamHelper authParamHelper = new HmsAuthParamHelper();
authParamHelper
..setIdToken()
..setAuthorizationCode()
..setAccessToken()
..setProfile()
..setEmail()
..setScopeList([HmsScope.openId, HmsScope.email, HmsScope.profile])
..setRequestCode(8888);
try {
final HmsAuthHuaweiId accountInfo =
await HmsAuthService.signIn(authParamHelper: authParamHelper);
setState(() {
var accountDetails = AccountInformation(
accountInfo.displayName,
accountInfo.email,
accountInfo.givenName,
accountInfo.familyName,
accountInfo.avatarUriString);
AnalyticsUtil.addCustomEvent(
accountInfo.displayName,
accountInfo.email,
accountInfo.givenName,
accountInfo.familyName,
accountInfo.avatarUriString);
AnalyticsUtil.setUserId("ABC123456789");
AnalyticsUtil.setUserProfile(accountInfo.displayName);
AnalyticsUtil.getAnalyticsClient()
.setUserProfile("Email", accountInfo.email);
AnalyticsUtil.getAnalyticsClient()
.setUserProfile("Family Name", accountInfo.familyName);
AnalyticsUtil.getAnalyticsClient()
.setUserProfile("Profile pic", accountInfo.avatarUriString);
/* AGCCrash.instance.setUserId("ABC123456789");
AGCCrash.instance.setCustomKey("Email", accountInfo.email);
AGCCrash.instance.setCustomKey("Family Name", accountInfo.familyName);
AGCCrash.instance
.setCustomKey("Profile pic", accountInfo.avatarUriString);
AGCCrash.instance.log(
level: LogLevel.info,
message: "Mr: " +
accountInfo.displayName +
"has successfully logged in");
AGCCrash.instance.testIt();*/
/*Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Homepage(
accountInformation: accountDetails,
),
));*/
detectUser(accountDetails);
print("account name: " + accountInfo.displayName);
});
} on Exception catch (exception) {
print(exception.toString());
print("error: " + exception.toString());
/* AGCCrash.instance
.log(level: LogLevel.error, message: exception.toString());
AGCCrash.instance.testIt();*/
}
}
//safety detect
getAppId() async {
String appID = await SafetyDetect.getAppID;
setState(() {
appId = appID;
Validator().showToast("App Id: "+appID);
});
}
checkSysIntegrity() async {
Random secureRandom = Random.secure();
List randomIntegers = List<int>();
for (var i = 0; i < 24; i++) {
randomIntegers.add(secureRandom.nextInt(255));
}
Uint8List nonce = Uint8List.fromList(randomIntegers);
try {
String result = await SafetyDetect.sysIntegrity(nonce, appId);
List<String> jwsSplit = result.split(".");
String decodedText = utf8.decode(base64Url.decode(jwsSplit[1]));
Validator().showToast("SysIntegrityCheck result is: $decodedText");
} on PlatformException catch (e) {
Validator().showToast("Error occurred while getting SysIntegrityResult. Error is : $e");
}
}
void getMaliciousAppsList() async {
List<MaliciousAppData> maliciousApps = List();
maliciousApps = await SafetyDetect.getMaliciousAppsList();
setState(() {
Validator().showToast("malicious apps: ${maliciousApps.toString()}");
});
}
detectUser(AccountInformation accountDetails) async {
try {
String token = await SafetyDetect.userDetection(appId);
print("User verification succeeded, user token: $token");
if(token!=null){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Homepage(
accountInformation: accountDetails,
),
));
}else{
Validator().showToast("user detection failed");
}
} on PlatformException catch (e) {
print(
"Error occurred: " + e.code + ":" + SafetyDetectStatusCodes[e.code]);
}
}
void loadUrl(String url) async {
Future.delayed(const Duration(seconds: 5), () async {
urlCheck(url);
});
}
void urlCheck(String url) async {
List<UrlThreatType> threatTypes = [
UrlThreatType.malware,
UrlThreatType.phishing
];
List<UrlCheckThreat> urlCheckResults =
await SafetyDetect.urlCheck(url, appId, threatTypes);
if (urlCheckResults.length == 0) {
Validator().showToast("No threat is detected for the URL");
} else {
urlCheckResults.forEach((element) {
print("${element.getUrlThreatType} is detected on the URL");
});
}
}
getWifiDetectStatus() async {
try {
WifiDetectResponse wifiDetectStatus =
await SafetyDetect.getWifiDetectStatus();
Validator().showToast('Wifi detect status is: ${wifiDetectStatus.getWifiDetectType.toString()}');
} on PlatformException catch (e) {
if (e.code.toString() == "19003") {
Validator().showToast(' The WifiDetect API is unavailable in this region');
}
}
}
}
Result
Tips and Tricks
Download latest HMS Flutter plugin.
Check dependencies downloaded properly.
Latest HMS Core APK is required.
Set minSDK 19 or later.
WifiDetect function available only in Chinese mainland.
UserDetect function not available in Chinese mainland.
Conclusion
In this article, we have learnt integration of Huawei safety detect and types of security provided by Huawei safety detect kit. Nowadays everything is happening over the phone, so as developer it is our responsibility to provide security to application. Otherwise users do not use the application. Thank Huawei for giving such great Safety detect kit to build secure application.
Reference
Safety detect
Happy coding