Key mapping (help me, quickly!) - Windows Mobile Development and Hacking General

I need an app/list that will show me the number of pressed key
For example:
Call - 61
EndCall - 62
VolumeUp - 64
VolumeDown - 65
Enter - 28
If there is no such app - where i can find the list for HTC Blue Angel?
I've tried SpvDuke3D, but it doesn't show "Special keys", such as Start, Mail, OK, Internet, Calendar etc

Xetra tools:
* KeyCode.exe Get the code of the hardware button
* GetClass.exe Get the current window's Class
* GetEXE.exe Get the current window's Proccess
* xMacro.exe record macro (pen click and key)
http://xetranet.free.fr/xbar2/download/tools.zip

oldsap said:
Xetra tools:
* KeyCode.exe Get the code of the hardware button
* GetClass.exe Get the current window's Class
* GetEXE.exe Get the current window's Proccess
* xMacro.exe record macro (pen click and key)
http://xetranet.free.fr/xbar2/download/tools.zip
Click to expand...
Click to collapse
Thanks! Now i can navigate throught Android menus!

Related

A Call To Lock/Hardware Button Experts

Hello,
Im currently working on a custom control in managed code(vb.net) and have decided to implement it in a lock application as its initial demo. I have written code which catpures the base hardware keys available to windows mobile(1-6) this captures all of the hardware buttons on my wizard except for the Phone Buttons, Volume/Vibrate Button, and power button. im not particularly worried about trapping the power button because i like the tap to standby feature but im up the creek on the phone/volume buttons.
I found the hardware buttons 1-6 in the registry under (HKLM\Software\Microsoft\Shell\Keys) but i cant seem to find the other keys anywhere including where this person says they are
http://www.mobipocket.com/forum/viewtopic.php?p=2367&sid=c3b2c704a729c2d6e5a47d0ee38ecb54
basically from my understanding of what he's saying the keys for these options(at least the phone ones) should have been listed under "HKEY_CURRENT_USER\Software\Microsoft\Today\Keys\"
I had one key there 112 pointng to my calendar(so that i thought confirmed him) I added a key called 114 with a path to calendar as well. but the button still directs to phone/ so im not sure what's up.
Here's some logic from the hardware button capturing... Any insight into the location of these items would be greatly appreciated
Code:
Dim hk As HardwareKeys = HardwareKeys.ApplicationKey1
Dim i As Integer = 0
While i < 6
Try
Dim hwb As HardwareButton = New HardwareButton
hwb.AssociatedControl = Me
hwb.HardwareKey = hk + i
Catch ex As Exception
Me.Label1.Text &= ex.Message
End Try
i += 1
End While
Dim regkey As RegistryKey =
Registry.LocalMachine.OpenSubKey("Software\Microsoft\Shell\Keys", True)
Me.Label1.Text = regkey.SubKeyCount
For Each skey As String In regkey.GetSubKeyNames
Me.Label1.Text &= skey.ToString & ","
Next
regkey.Close()
Thanks in advance for any insight anyone can provide
DrewG
Well ive found some russian page talking about the
Dated Post on russian site with Broken English Translation said:
HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\KeyMaps]
"195"= - =-hitting "record" on the three pozic. phone (one that najmeshy story)
"196"= hitting "power" and "house"
"197"= Opening screen
"198" = "red tube"
dword:00000000 - nothing
dword:00000001- mobile phone
dword:00000002 - quick menu
dword:00000003 - lock (for the press release #)
dword:00000004 - 00000004 fast-locking
Click to expand...
Click to collapse
Do you guys think this is a good start? At that location i have dword 197 val of 5. Im adding entries now for the othr buttons to see if i can catch
Here's What I have so far for Cingular 8125 HTC Wizard as the hardware buttons/software key maps which i get from a call onkeypress. I believe im going to have to go an unmanaged route for the phone buttons/Volume.
Code:
'not code just looks better this way
SoftKey Left = Key Code 112
SoftKey Right = Key Code 113
Email Button(top left corner) = Key Code 193 (Cf Hardware Button 1)
Web Button(top right corner) = Key Code 194 (Cf Hardware Button 2)
Camera Button(bottom right side) = Key Code 195 (Cf Hardware Button 3)
Voice Button(top right side) = Key Code 196(Cf Hardware Button 4)
Record(hold voice) = Key Code 197(not firing well) (Cf Hardware Button 5)
Comm Button = Key Code 198 (Cf Hardware Button 6)
All of those I can catch and react to but i cant seem to find any info for the phone and volume buttons/ Is there a specific api call I can make thats related to button press or catching? Possibly a way of forcing an association to an app only while its running?
Thanks in advance for any help. Ill post the full app here if i can get over this hump

How to change slide Keyboard layout

Hi all,
i got an United Kingdom TyTN, but i installed the Italian official ROM from HTC with wm6.
That's works fine but layout of the slide keyboard doesn't work correctly.
Principal functions are ok, layout is QWERTY.
Only 4 caps doesn't work.
Key S with cap " return me cap -
Key D with cap : return me cap "
Key F with cap - return me cap °
Key C with cap ; return me cap :
What can I do?
Thank you all
now it's all ok, Advanced Configuration Tool was the way
Sorry for bothering
but there isnìt italian layout.... in Advanced Configuration Tool... How can I do?
I'm very sad...!!
Get a registry editing program (Often already included in custom ROM)
Here's a free one : http://www.phm.lu/Products/PocketPC/RegEdit/
In the registry, go to: HKEY_LOCAL_MACHINE\Software\Oem\Qwerty
Under it, you'll find "Layout", it should have a number as data, such as "197649" or whatever else.
I dont know what your keyboard layout it, but you can try changing the data number to something else.
Here are some numbers that I know of (Only write the NUMBER)
Make sure you enter those values as DECIMAL
DECIMAL NUMBERS
THOSE ARE DECIMAL NUMBERS
NOT HEXADECIMAL
English : 132105
Chinese : 132100
German : 132103
Spanish : 132106
FROM WHAT I COULD MAKE OUT FROM A GENERAL PPC WEBPAGE (Don't hold me responsible if it doesnt work)
I got a few possible values
Italian Standard : 132112
Italian Swiss : 133136
DO NOT SOFT RESET!!!
Soft reset sometimes causes the phone to not SAVE the changes and then your phone reboots with the hold QWERTY settings.
Do this instead
TURN OFF
wait 5 seconds
TURN ON
If you want to find other keyboard values, go to the webpage link below
Example to USE the webpage: Italian Standard
1 - Find : Italian Standard
2 - Look at the LCIDHex value (first column on right side with 4 digits)
3 - Italian Standard : 0410
4 - Add 20 in front of this number ( 20 410 = 20410)
5 - Open MS calculator on your computer (start menu, run, type calc OR Start Menu, All Programs, Accessories, Calculator)
6 - In calculator, click on VIEW, then select SCIENTIFIC
7 - In calculator, check mark "HEX" under the white box, left corner, just under "edit"
8 - In calculator, Type in your number ( 20410)
9 - In calculator, check mark "DEC" right next to the "HEX"
10 - In calculator, the white box should where you typed 20410 should have changed to 132112
11 - Type 132112 in the registry value from the top of this thread.
Go do those steps with the code you find in this webpage depending of the country you wish to use.
http://www.microsoft.com/globaldev/reference/winxp/xp-lcid.mspx

HTC Touch Pro2 KyCodes

Hi
Anyone knows keycodes (KeyEventArgs) for buttons: Back, Volumne up / down on HTC Touch Pro2?
For now i got only this keys:
- Talk - 0x3D
- End - 0x3E
- Windows - 237
I kinda need rest of them.
http://www.google.com/search?q="windows+mobile"+key+codes
MarcLandis said:
http://www.google.com/search?q="windows+mobile"+key+codes
Click to expand...
Click to collapse
Great, but... according to this page http://msdn.microsoft.com/en-us/library/bb431750.aspx talk key value is 0x72 but in ppc_phone_480x800.xml emulator file this key value is 0x3D, so which one is correct?

[Q] The sound crackles after changing value

Hello, good evening,
I often listen to music so I decided to increase (or rather booster) the sound of my Windows Phone Samsung Omnia 7.
And then disaster ... 15/30 above the noise level, the sound crackles ... so I decided to give the level has its original value then:
1 - 1D - 7D - C2 - 22 - 5F - F5 - 12
System Gain Attenuation:
7 / 110 / 0
Gain Attenuation Class
7 / 0 / 0
Device Gain (max / min)
7 / 1200 / -500
It audience.cfg
Click to expand...
Click to collapse
However, even with the return of its parameters (of orgine), the sound crackles to 25/30.
Better than before but still not normal
So I need your help ... What to do? ! : '(
I said that to change its values, I was in:
the Diagnosis Mode on my Omnia 7 (number: # # 634 #).
I was then in the audio settings (number: * # 0002 * 28345 #).
Click to expand...
Click to collapse
However, I noticed that the adjustment was taken into account after reboot but it is only temporary ... Indeed, if I plugged in a headset or make a call, the sound of the phone will reset to sizzle.
I hope you can help me.
PS: I would like a solution without reset please!
I do not want to lose my fi
Thank you in advance.
PS 2: The steps I did to re-set the volume correctly but without success:
Increase Speaker Volume
• Enter the phone dialer
• # # 634 #, tap Call.
• Enter code: * # 0002 * 28346 # or * # 0002 * 28345 #
• Tap: Get, Under the Device Gain (max / min)
• First Box: 7
• Second Box: 16000 to change
• Third Box Set to 0
• Tap: Set
• Be sure to set IS audience.cfg That is
• Tap: Start
• Tap: Home
• Restart your phone.
• After reboot, enter the Same menu tab and just get to verify the settings
Increase Headphone Volume
Note: Make sure your headphones are plugged in first
• Enter the phone dialer
• # # 634 #, tap Call
• Enter code: * # 0002 * 28346 # or * # 0002 * 28345 #
• Tap: Get Under the Device Gain (max / min)
• For "device gain" leave number 5, set in 1100 (max) and -1100 (low)
• Tap: Set
• Verify That AUDIENCE.CFG is ON
• Tap: Start
• Tap Home
• Restart your phone.
• After reboot, enter the Same menu tab and just get to verify the settings
Click to expand...
Click to collapse
Good day / evening

Joying 2GB - Steering wheel key customization - V6 (NO KILL)

THIS MOD IS ONLY FOR THE JOYING / 2GB / Sofia models - It is stable and working well .
Please use V4.1 if you have not upgraded to Marshmallow!
History:
V6.4: Update using code base 9/1/2017 Joying Update ( Android 6.0 ) (updated Oct 7)
Changes:
- Meida keys - Removed support for media keys customization. No longer sent to launcher.sh due to slow response time.
- Media keys - Modified code to only send media keys to the active media player.
- Changed reboot timer from 1/2 second to 2 seconds. Should help eliminate random reboots when coming from standby.
- Updated player_app.txt and navi_app.txt to latest from @surfer63
- Fixed issue with button 33 not working
- Files included:
- V6.4-Sofia-1-C9-Server_NOKILL.zip - Original file with task killer removed
- V6.4-Sofia-1-C9-Server_NOKILL_GVS.zip - Task killer removed, Google Voice Search on 'SRC' key
- V6.4-Custom_Keys-Mods.zip - Complete key modifications ( requires launcher.sh - description below )
V6.3: Update using code base 5/25/2017 Joying Update ( Android 6.0 )
- Files included:
- V6.3-Sofia-1-C9-Server_NOKILL.zip - Original file with task killer removed
- V6.3-Sofia-1-C9-Server_NOKILL_GVS.zip - Task killer removed, Google Voice Search on 'SRC' key
- V6.3-Custom_Keys-Mods.zip - Complete key modifications ( requires launcher.sh - description below )
V6.2: Updated using code base 5/8/2017 Joying Update ( Android 6.0 )
- Added fix for google maps voice output on radio from @xdamember2
V6.1: Updated code base using 5/8/2017 Joying Update ( Android 6.0 )
V6: Updated code base using 4/27/2017 Joying Update ( Android 6.0 )
Android 5.1.1
V4.1 - Fixed issue with "Google Voice Search" not lowering music volume (3/23/2017) - Android 5.1.1
V4: Updated code base using 3/14/2017 Joying ROM
Changes/Added support for:
- MEDIA KEY - hard key on unit
- BAND KEY - hard key on unit
- ACC_ON - Triggers on key on
- Minor changes to example shell scripts to add cases for MEDIA, BAND, ACC_ON ( launcher.sh )
- FIX/UPDATE - Updated list of NAVI APPS in assets/property/navi_app.txt ( allows more applications to speak during radio )
- Many thanks to @surfer63 for navi app radio fix and windows install script
V3 - Rebuilt using latest Joying ROM dated 2/22/2017 - Includes V1 & V2 steering wheel / key modifications.
Changes/Added support for:
- ACC_OFF - Added support for running actions at key off (case 98 )
- Added case 98 to example scripts to perform "PAUSE" - to stop current music player when key off
V2 Removed killAppWhenSleep(); - Eliminates tasks being killed on sleep
Added support for additional keys / Minor changes to example shell script ( launcher.sh )
- HANG - steering wheel softkey
- DVD - hard key on unit (if available)
- EJECT- hard key on unit (if available)
- CALL/BT softkey - Fixed issue where key would not respond after call disconnect.
V1 Initial version
There is little risk with this mod, but please understand what you are doing, and make backup of the original apk file ( in case you want to revert back ). The installer script does make a backup, but will overwrite the backup if installed more than once.
I also added a simpler "launcher_simple.sh" into the zip, which only changes the functionality of the Source (rotates radio, pandora, spotify ) and Call buttons ( google voice command ). These scripts are working examples of what can be done. If you want the simpler version, just rename "launcher_simple.sh" to "launcher.sh" before installing.
---------------------- Original Post -----------------
I have spent quite a bit of time working on being able to customize the steering wheel keys of my Joying 2GB headunit (JY-UL135N2 / 2GB / Sofia unit). I have made some good progress and thought I would share what I have done so far.
The system package /system/app/Sofia-1-C9-Server-V1.0/Sofia-1-C9-Server-V1.0.apk has been modified to intercept the keys sent by the MCU, and thus able to change the behavior of the key presses. The keys listed below are supported, and will launch a "shell" process, so any action that can be done by the command line can be performed. If your not familiar with the Android command line, you might be surprised how powerful it is. As a side note, this works very fast and efficient. From my testing the overhead of the system call and shell script is almost non-existent, and key presses are registered with no delay. In other words, it is working very nicely.
In addition to the steering wheel button mods, also provided is the ability to launch a command or series of commands when a RESUME is received.
Included is my shell script (example) that can be used as a model for your own customization. The example script included performs the following actions:
CALL/BT PHONE(27) - One press is HOME, 2 presses is BACK, 3 presses brings up Google Voice Commands
MODE/SRC(37) - Rotates through music apps: Radio, Pandora, Spotify, Stock Music App - If it has been longer than 1 minute since the last press it will return you to the last selected music app with first press, then continue with the rotation. ( I'm working on a more intelligent way of doing this, that looks at the process list and will post soon)
NAVI(9) - One press is Torque, 2 presses is google maps
PAUSE/PLAY(85*),NEXT(87*), PREVIOUS(88*), FASTBACK(89*), FASTFWD(90*),HOME(3), BACK(4) - Currently set to perform stock functions. They ARE passed to script so they can be assigned other functions if wanted.
ACC_ON(97) - Executes at ignition switch on. Sample script has a 'play' here to restart music player that was paused at key off.
ACC_OFF(98) - Executes at ignition switch off. I suggest you assign "pause" on this case, to stop current music player. Resolves issue of music player advancing for several minutes after key is turned off.
RESUME(99) - Executes on system resume.
Please note the media control keys marked with a (*) are hardcoded to specific functions within the stock Joying applications. They are only passed through to the shell script when you are NOT using a Joying media application. They will ONLY work as the original keys when you are within the Joying media applications.
Remember, the apk is just handing codes to you, what you do with them after that is up to you! I have tried to comment the example script enough to be understandable to someone with basic programming knowledge.
Attached is a zip file with the updated Sofia-1-C9-Server-V1.0.apk, launcher.sh ( my example script), and install script. The launcher.sh script must be placed in the /data directory ( /data/launcher.sh ), as it is hardcoded in the apk file.
The install script is a shell/linux script, but you can easily copy/paste the adb commands if your using windows.
[NOTE: Please update to the latest version of busybox! I found some bugs in the version included by Joying that caused several issues.]
Awesome work. I will mess with this sometime this week. I still need to root my unit. Just installed it last week.
Sent from my SAMSUNG-SM-G935A using Tapatalk
Excellent work, sir! Before I start modifying the script for personal taste, could you help how to find key number for DVD and Eject buttons that currently have no function as the DVD drive is non-existent? Maybe logcat or something?
sonof said:
Excellent work, sir! Before I start modifying the script for personal taste, could you help how to find key number for DVD and Eject buttons that currently have no function as the DVD drive is non-existent? Maybe logcat or something?
Click to expand...
Click to collapse
I see a few references in the code for the DVD/eject button in the common code. My 'best guess' would be to add a system call to the cases listed below, but I seriously doubt the MCU would even send the codes if there is no DVD present.
bsp/FinalBsp.java
public static final int KEY_CODE_DVD = 242;
public static final int KEY_CODE_EJECT = 231;
bsp/HandlerBspKey.java
public static void keyEvent(int paramInt1, int paramInt2)
case 242:
bspKeyDvd(paramInt2);
return;
case 231:
bspKeyEject(paramInt2);
return;
gustden said:
I see a few references in the code for the DVD/eject button in the common code. My 'best guess' would be to add a system call to the cases listed below, but I seriously doubt the MCU would even send the codes if there is no DVD present.
bsp/FinalBsp.java
public static final int KEY_CODE_DVD = 242;
public static final int KEY_CODE_EJECT = 231;
bsp/HandlerBspKey.java
public static void keyEvent(int paramInt1, int paramInt2)
case 242:
bspKeyDvd(paramInt2);
return;
case 231:
bspKeyEject(paramInt2);
return;
Click to expand...
Click to collapse
Seems that MCU does send the codes as seen here.
I will see what I can do but I doubt I am able to do anything as I just installed apktool the first time today and am new with apk's. Thanks for your efforts! Very appreciated.
sonof said:
Excellent work, sir! Before I start modifying the script for personal taste, could you help how to find key number for DVD and Eject buttons that currently have no function as the DVD drive is non-existent? Maybe logcat or something?
Click to expand...
Click to collapse
sonof said:
Seems that MCU does send the codes as seen here.
I will see what I can do but I doubt I am able to do anything as I just installed apktool the first time today and am new with apk's. Thanks for your efforts! Very appreciated.
Click to expand...
Click to collapse
If I create and send you a apk file with additional debug statements, would you be able to install it, and capture the 'logcat' of the buttons being pressed? It makes it much more difficult since I don't have the DVD buttons. Hacking smali code is a LOT of trial and errors. Their code is quite complex, and doesn't decompile into Java very nicely in some critical areas.
gustden said:
If I create and send you a apk file with additional debug statements, would you be able to install it, and capture the 'logcat' of the buttons being pressed? It makes it much more difficult since I don't have the DVD buttons. Hacking smali code is a LOT of trial and errors. Their code is quite complex, and doesn't decompile into Java very nicely in some critical areas.
Click to expand...
Click to collapse
Yes I am capable of doing that!
sonof said:
Excellent work, sir! Before I start modifying the script for personal taste, could you help how to find key number for DVD and Eject buttons that currently have no function as the DVD drive is non-existent? Maybe logcat or something?
Click to expand...
Click to collapse
sonof said:
Yes I am capable of doing that!
Click to expand...
Click to collapse
I put in debugging code that parses the data stream from the MCU and dumps the first 4 bytes of EVERY message that is received from the MCU (skipping checksum info). Simply replace the original file (make a copy first ) and reboot. When looking for the keys, I suggest you do not use the radio, as it sends a constant flood of messages, such as RDS updates.
Even when the radio is off, there are still messages constantly being sent. If you filter on the debug messages MCUKEY in adb, and press the button in question a few times quickly, you should see a consistent pattern. I was able to identify the 'HANG' key in a couple minutes using this method. You should see something like this in the logcat:
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=0 B2=5 B2=224
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=7 B2=16 B2=0
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=0 B2=0 B2=49
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=7 B2=16 B2=0
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=3 B2=34 B2=0
In this case the HANG key is in bold ( 1, 7, 16, 0 ) messages. IF the DVD and eject keys are sent, they should definitely show up here. Not every key is sent by the MCU, if it is not relevant to the current state of the system. For example the media buttons are not sent when the radio is on, since the MCU is in control of the radio, however it does send the results such as a frequency change resulting from the button press.
It is possible that the MCU knows there is no DVD present and suppresses the messages. From looking at the code, it may be the action of a disc being ejected that is sent from the MCU, with the eject button press handled internally by the MCU. Your more likely to find the press of the DVD button than the eject button, but may find both.
When your done searching, you want to put back the original file and reboot. If you find the codes, I can certainly add them to trigger the shell script and you can take whatever action you want with them.
Thank you! I will try this the first thing next week when I get back home from a weekend trip.
Question: if I remove a customization from the script file for a key, the key should then perform its default functions, correct?
vassandrei said:
Question: if I remove a customization from the script file for a key, the key should then perform its default functions, correct?
Click to expand...
Click to collapse
The keys being passed to the shell script (launcher.sh) is hard-coded in the APK file and is just sent to the script. If you remove it from the script, the key would no longer do anything.
If you want to keep the stock functionality of a specific button, it should be fairly easy to duplicate it in the shell script. For example:
BT/CALL button: "am start com.syu.bt/com.syu.bt.BtAct"
NAVI: By default, I think NAVI just toggles between a Navi app, and the previous activity on the stack.
The code below should behave the same as the original for both the NAVI an BTPHONE buttons ( assuming your using google maps )
Code:
case $key in
9) # NAVI
x=`dumpsys activity activities | grep "Run #" | cut -f 13 -d" "| head -1 | grep maps`
if [ "$x" = "" ]
then
$maps
else
am start `dumpsys activity activities | grep "Run #" | cut -f 13 -d" " | grep -v launcher | grep -v systemui | grep -v maps |head -1`
fi
;;
27) # BTPHONE/PTT
am start com.syu.bt/com.syu.bt.BtAct
;;
Play/Pause: you can just remove the 85 case, it would just hit the default case and pass "input keyevent 85" which is identical in functionality.
gustden said:
The keys being passed to the shell script (launcher.sh) is hard-coded in the APK file and is just sent to the script. If you remove it from the script, the key would no longer do anything.
If you want to keep the stock functionality of a specific button, it should be fairly easy to duplicate it in the shell script. For example:
BT/CALL button: "am start com.syu.bt/com.syu.bt.BtAct"
NAVI: By default, I think NAVI just toggles between a Navi app, and the previous activity on the stack.
The code below should behave the same as the original for both the NAVI an BTPHONE buttons ( assuming your using google maps )
Code:
9) # NAVI
x=`dumpsys activity activities | grep "Run #" | cut -f 13 -d" "| grep -v launcher | grep -v systemui | head -1 | grep maps`
if [ "$x" = "" ]
then
$maps
else
am start `dumpsys activity activities | grep "Run #" | cut -f 13 -d" " | grep -v launcher | grep -v systemui | head -2 | tail -1`
fi
;;
27) # BTPHONE/PTT
am start com.syu.bt/com.syu.bt.BtAct
;;
Play/Pause: you can just remove the 85 case, it would just hit the default case and pass "input keyevent 85" which is identical in functionality.
Click to expand...
Click to collapse
brilliant! thank you so much!
Last thing: I want to have viper4android launch on resume (in the background ideally). where can I find the "app identifier" to put in the shell script?
vassandrei said:
Question: if I remove a customization from the script file for a key, the key should then perform its default functions, correct?
Click to expand...
Click to collapse
vassandrei said:
brilliant! thank you so much!
Last thing: I want to have viper4android launch on resume (in the background ideally). where can I find the "app identifier" to put in the shell script?
Click to expand...
Click to collapse
I made a slight change to the 'CODE' section of my previous post, so if you copy it make sure you get the edited version. I tested it and made a couple of changes.
There are several ways to get the package name and activity.
What I typically do is start the application on the unit and do the following in adb:
> adb shell
> dumpsys activity activities | grep "Run #"
This shows you a list of the activities ( package/activity ) in the task list with most recent at the top.
You should be able to pick it out pretty easily. If it is the app that I found with google, this should work to start it.
> am start com.vipercn.viper4android_v2/.activity.ViPER4Android
In most cases, you can just give the package name when using 'am start' with no need for the activity. It will default to the 'LAUNCHER' activity in the package. I usually always give the activity, just to be safe. I would sleep for a couple seconds to give it time to initialize and then $home to take you back to the Home screen. So whole command would look like this. It is easy to test using adb.
am start com.vipercn.viper4android_v2/.activity.ViPER4Android ; sleep 2 ; $home
Thanks for this, it's working great on my Joying (JY-UL135N2 ).
My only issue is that the CALL/BT PHONE (27) button is assigned to my "Pick Up/Call Out" button on my steering wheel. So I can't use it to pick up calls. I actually have another dedicated button on my steering to activate voice commands, so I'd rather assign the CALL/BT PHONE function to that. Do you happen to know how to find out what numbers corresponds to each button press?
akuma148 said:
Thanks for this, it's working great on my Joying (JY-UL135N2 ).
My only issue is that the CALL/BT PHONE (27) button is assigned to my "Pick Up/Call Out" button on my steering wheel. So I can't use it to pick up calls. I actually have another dedicated button on my steering to activate voice commands, so I'd rather assign the CALL/BT PHONE function to that. Do you happen to know how to find out what numbers corresponds to each button press?
Click to expand...
Click to collapse
I make and receive so few voice calls, It wasn't worth having a steering wheel button dedicated for the dialer/call pickup . I just tap the screen to answer and use google voice to make calls.
If you want to have a button answer a call, there *should* be a way to do it given the right command. I will play around with it more. Worse case I can just back out the changes for the (27) , and send you an updated apk.
I used the joying steering wheel control app and switched the dialer/call pickup to my voice button and that works, but my dialer/call pickup doesn't do anything. Please let me know if you want me to test anything. Thank you.
gustden said:
I put in debugging code that parses the data stream from the MCU and dumps the first 4 bytes of EVERY message that is received from the MCU (skipping checksum info). Simply replace the original file (make a copy first ) and reboot. When looking for the keys, I suggest you do not use the radio, as it sends a constant flood of messages, such as RDS updates.
Even when the radio is off, there are still messages constantly being sent. If you filter on the debug messages MCUKEY in adb, and press the button in question a few times quickly, you should see a consistent pattern. I was able to identify the 'HANG' key in a couple minutes using this method. You should see something like this in the logcat:
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=0 B2=5 B2=224
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=7 B2=16 B2=0
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=0 B2=0 B2=49
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=7 B2=16 B2=0
D/MCUKEY ( 693): MCUKEYINPUT: B1=1 B2=3 B2=34 B2=0
In this case the HANG key is in bold ( 1, 7, 16, 0 ) messages. IF the DVD and eject keys are sent, they should definitely show up here. Not every key is sent by the MCU, if it is not relevant to the current state of the system. For example the media buttons are not sent when the radio is on, since the MCU is in control of the radio, however it does send the results such as a frequency change resulting from the button press.
It is possible that the MCU knows there is no DVD present and suppresses the messages. From looking at the code, it may be the action of a disc being ejected that is sent from the MCU, with the eject button press handled internally by the MCU. Your more likely to find the press of the DVD button than the eject button, but may find both.
When your done searching, you want to put back the original file and reboot. If you find the codes, I can certainly add them to trigger the shell script and you can take whatever action you want with them.
Click to expand...
Click to collapse
Luckily the eject key was also found! Here are the codes:
DVD:
D/MCUKEY ( 691): MCUKEYINPUT: B1=1 B2=0 B2=16 B2=80
EJECT:
D/MCUKEY ( 691): MCUKEYINPUT: B1=1 B2=161 B2=2 B2=91
Looking forward to the modified apk. If you happen to take donations I'd be willing to give you a beer. Thank you.
Model number for reference: JY-AL003N2
sonof said:
Luckily the eject key was also found! Here are the codes:
DVD:
D/MCUKEY ( 691): MCUKEYINPUT: B1=1 B2=0 B2=16 B2=80
EJECT:
D/MCUKEY ( 691): MCUKEYINPUT: B1=1 B2=161 B2=2 B2=91
Looking forward to the modified apk. If you happen to take donations I'd be willing to give you a beer. Thank you.
Model number for reference: JY-AL003N2
Click to expand...
Click to collapse
Here is an updated apk file that should catch the code you listed. In the zip there is a file "keys.txt" and also updated APK file. The keys.txt is a complete list button codes for both the soft-keys ( steering wheel ) and hard-keys (on unit ) that the new apk sends to the script. This is a beta of V2.0 which I added:
3 - HOME ( On unit hard key )
4 - BACK ( On unit hard key )
28 - HANG/CALL END ( Steering wheel softkey)
31 - DVD ( On unit hard key )
32 - EJECT ( On unit hard key )
The HOME/BACK keys are sending the keycodes for the home/back actions. You don't need to map them in a script, as long as you have a default that passes keycodes at the end of the script.
*) input keyevent $key
;;
I have used it the last couple of days and it is working fine for me, but can't test the dvd or eject.
Let me know if it registers the keys.
sorry for the dumb question but do you need to root the unit to use this?
Is there a way to run a shell script when I switch ignition off and illumination on or off?

Categories

Resources