KeyDef.smali - How to edit Hardware buttons - MTCB Android Head Units Q&A

I'm working on that http://forum.xda-developers.com/android-auto/android-head-units/identify-head-unit-apps-kk-4-4-4-t3446989 to edit main files. I am now trying to change hardware buttons to use "back, home key" or "Music player activity"...
Is that the right file? This is what I decompiled from Ts8317_media.apk (which controls, DVD, CD, USB, SD activities) :
Ts8317_media.apk/smali/com/yyw/ts90xhw/KeyDef.smali
Code:
.class public Lcom/yyw/ts90xhw/KeyDef;
.super Ljava/lang/Object;
.source "KeyDef.java"
# static fields
.field public static final EKEY_TUNDEC:I = 0x203
.field public static final EKEY_TUNINC:I = 0x204
.field public static final EKEY_VOLDN:I = 0x201
.field public static final EKEY_VOLUP:I = 0x202
.field public static final PKEY_0:I = 0x1f
.field public static final PKEY_1:I = 0x20
.field public static final PKEY_2:I = 0x21
.field public static final PKEY_3:I = 0x22
.field public static final PKEY_4:I = 0x23
.field public static final PKEY_5:I = 0x24
.field public static final PKEY_6:I = 0x25
.field public static final PKEY_7:I = 0x26
.field public static final PKEY_8:I = 0x27
.field public static final PKEY_9:I = 0x28
.field public static final PKEY_AM:I = 0x35
.field public static final PKEY_AMS:I = 0x3a
.field public static final PKEY_ANGLEDN:I = 0x4a
.field public static final PKEY_ANGLEUP:I = 0x49
.field public static final PKEY_AUX:I = 0x2
.field public static final PKEY_AVIN:I = 0x3
.field public static final PKEY_BKL:I = 0x6
.field public static final PKEY_BT:I = 0x17
.field public static final PKEY_CLOCK:I = 0x5
.field public static final PKEY_DELETE:I = 0x54
.field public static final PKEY_DIM:I = 0x18
.field public static final PKEY_DIMDN:I = 0x58
.field public static final PKEY_DIMUP:I = 0x57
.field public static final PKEY_DISP:I = 0x55
.field public static final PKEY_DN:I = 0x43
.field public static final PKEY_DTV:I = 0x1
.field public static final PKEY_DVD:I = 0xd
.field public static final PKEY_DVR:I = 0x1b
.field public static final PKEY_ECAR:I = 0x59
.field public static final PKEY_EJECT:I = 0x47
.field public static final PKEY_EJECT_L:I = 0x53
.field public static final PKEY_ENT:I = 0x15
.field public static final PKEY_EQ:I = 0x11
.field public static final PKEY_FAV:I = 0x56
.field public static final PKEY_FCAM:I = 0x1a
.field public static final PKEY_FF:I = 0x2e
.field public static final PKEY_FM:I = 0x34
.field public static final PKEY_FMAM:I = 0x33
.field public static final PKEY_FR:I = 0x2f
.field public static final PKEY_IPOD:I = 0x19
.field public static final PKEY_J:I = 0x29
.field public static final PKEY_LEFT:I = 0x44
.field public static final PKEY_LOC:I = 0x37
.field public static final PKEY_LOUD:I = 0x12
.field public static final PKEY_MEDIA:I = 0x1c
.field public static final PKEY_MEDIA_PP:I = 0x3c
.field public static final PKEY_MEDIA_RDM:I = 0x3d
.field public static final PKEY_MEDIA_RPT:I = 0x3e
.field public static final PKEY_MEDIA_SCAN:I = 0x3f
.field public static final PKEY_MEDIA_SEARCH:I = 0x41
.field public static final PKEY_MEDIA_STOP:I = 0x40
.field public static final PKEY_MENU:I = 0x8
.field public static final PKEY_MODE:I = 0xa
.field public static final PKEY_MUTE:I = 0x10
.field public static final PKEY_NAVI:I = 0xb
.field public static final PKEY_NEXT:I = 0x2c
.field public static final PKEY_OPEN:I = 0x48
.field public static final PKEY_PAUSE:I = 0x5b
.field public static final PKEY_PLAY:I = 0x5a
.field public static final PKEY_POWER:I = 0x46
.field public static final PKEY_POWER_OFF:I = 0x52
.field public static final PKEY_POWER_ON:I = 0x51
.field public static final PKEY_PRE:I = 0x2d
.field public static final PKEY_RADIO:I = 0xc
.field public static final PKEY_RADIO_1S:I = 0x4b
.field public static final PKEY_RADIO_2S:I = 0x4c
.field public static final PKEY_RADIO_3S:I = 0x4d
.field public static final PKEY_RADIO_4S:I = 0x4e
.field public static final PKEY_RADIO_5S:I = 0x4f
.field public static final PKEY_RADIO_6S:I = 0x50
.field public static final PKEY_RADIO_BAND:I = 0x2b
.field public static final PKEY_RADIO_SCAN:I = 0x3b
.field public static final PKEY_RDS_AF:I = 0x30
.field public static final PKEY_RDS_PTY:I = 0x32
.field public static final PKEY_RDS_TA:I = 0x31
.field public static final PKEY_RETURN:I = 0x16
.field public static final PKEY_RIGHT:I = 0x45
.field public static final PKEY_SD:I = 0xf
.field public static final PKEY_SET:I = 0x7
.field public static final PKEY_ST:I = 0x36
.field public static final PKEY_TELCALLOF:I = 0x1e
.field public static final PKEY_TELCALLON:I = 0x1d
.field public static final PKEY_TOUCH:I = 0x9
.field public static final PKEY_TUNEDEC:I = 0x39
.field public static final PKEY_TUNEINC:I = 0x38
.field public static final PKEY_TV:I = 0x4
.field public static final PKEY_UP:I = 0x42
.field public static final PKEY_USB:I = 0xe
.field public static final PKEY_VIEW360:I = 0x5c
.field public static final PKEY_VOLDN:I = 0x14
.field public static final PKEY_VOLUP:I = 0x13
.field public static final PKEY_X:I = 0x2a
.field public static final RKEY_0:I = 0x113
.field public static final RKEY_1:I = 0x114
.field public static final RKEY_2:I = 0x115
.field public static final RKEY_3:I = 0x116
.field public static final RKEY_4:I = 0x117
.field public static final RKEY_5:I = 0x118
.field public static final RKEY_6:I = 0x119
.field public static final RKEY_7:I = 0x11a
.field public static final RKEY_8:I = 0x11b
.field public static final RKEY_9:I = 0x11c
.field public static final RKEY_AMS:I = 0x127
.field public static final RKEY_ANGLEDN:I = 0x13e
.field public static final RKEY_ANGLEUP:I = 0x13d
.field public static final RKEY_BAND:I = 0x107
.field public static final RKEY_BKL:I = 0x102
.field public static final RKEY_CMMB_PBC:I = 0x139
.field public static final RKEY_DN:I = 0x122
.field public static final RKEY_DVD:I = 0x108
.field public static final RKEY_EJECT:I = 0x13b
.field public static final RKEY_EJECT_L:I = 0x14e
.field public static final RKEY_ENTER:I = 0x130
.field public static final RKEY_EQ:I = 0x10c
.field public static final RKEY_FF:I = 0x125
.field public static final RKEY_FR:I = 0x126
.field public static final RKEY_J:I = 0x11d
.field public static final RKEY_LEFT:I = 0x120
.field public static final RKEY_LOC:I = 0x12a
.field public static final RKEY_LOUD:I = 0x10d
.field public static final RKEY_MEDIA_10:I = 0x142
.field public static final RKEY_MEDIA_ANGLE:I = 0x131
.field public static final RKEY_MEDIA_AUDIO:I = 0x133
.field public static final RKEY_MEDIA_GOTO:I = 0x12f
.field public static final RKEY_MEDIA_MENU:I = 0x134
.field public static final RKEY_MEDIA_OSD:I = 0x138
.field public static final RKEY_MEDIA_PP:I = 0x12b
.field public static final RKEY_MEDIA_PROG:I = 0x141
.field public static final RKEY_MEDIA_RDM:I = 0x12c
.field public static final RKEY_MEDIA_RPT:I = 0x12d
.field public static final RKEY_MEDIA_SCAN:I = 0x12e
.field public static final RKEY_MEDIA_SEL:I = 0x137
.field public static final RKEY_MEDIA_SLOW:I = 0x140
.field public static final RKEY_MEDIA_STOP:I = 0x13f
.field public static final RKEY_MEDIA_SUBT:I = 0x136
.field public static final RKEY_MEDIA_TITLE:I = 0x132
.field public static final RKEY_MEDIA_ZOOM:I = 0x135
.field public static final RKEY_MENU:I = 0x103
.field public static final RKEY_MODE:I = 0x105
.field public static final RKEY_MUTE:I = 0x10b
.field public static final RKEY_NAVI:I = 0x106
.field public static final RKEY_NEXT:I = 0x123
.field public static final RKEY_OPEN:I = 0x13c
.field public static final RKEY_POWER:I = 0x13a
.field public static final RKEY_POWER_OFF:I = 0x14d
.field public static final RKEY_POWER_ON:I = 0x14c
.field public static final RKEY_PRE:I = 0x124
.field public static final RKEY_RADIO_1S:I = 0x143
.field public static final RKEY_RADIO_2S:I = 0x144
.field public static final RKEY_RADIO_3S:I = 0x145
.field public static final RKEY_RADIO_4S:I = 0x146
.field public static final RKEY_RADIO_5S:I = 0x147
.field public static final RKEY_RADIO_6S:I = 0x148
.field public static final RKEY_RADIO_SCAN:I = 0x128
.field public static final RKEY_RDS_AF:I = 0x149
.field public static final RKEY_RDS_PTY:I = 0x14b
.field public static final RKEY_RDS_TA:I = 0x14a
.field public static final RKEY_RETURN:I = 0x110
.field public static final RKEY_RIGHT:I = 0x11f
.field public static final RKEY_SD:I = 0x10a
.field public static final RKEY_SET:I = 0x101
.field public static final RKEY_ST:I = 0x129
.field public static final RKEY_TELCALLOF:I = 0x112
.field public static final RKEY_TELCALLON:I = 0x111
.field public static final RKEY_TOUCH:I = 0x104
.field public static final RKEY_UP:I = 0x121
.field public static final RKEY_USB:I = 0x109
.field public static final RKEY_VOLDEC:I = 0x10f
.field public static final RKEY_VOLINC:I = 0x10e
.field public static final RKEY_X:I = 0x11e
.field public static final SKEY_CALLDN_1:I = 0x333
.field public static final SKEY_CALLDN_2:I = 0x334
.field public static final SKEY_CALLDN_3:I = 0x335
.field public static final SKEY_CALLDN_4:I = 0x336
.field public static final SKEY_CALLDN_5:I = 0x337
.field public static final SKEY_CALLUP_1:I = 0x32e
.field public static final SKEY_CALLUP_2:I = 0x32f
.field public static final SKEY_CALLUP_3:I = 0x330
.field public static final SKEY_CALLUP_4:I = 0x331
.field public static final SKEY_CALLUP_5:I = 0x332
.field public static final SKEY_CHDN_1:I = 0x31f
.field public static final SKEY_CHDN_2:I = 0x320
.field public static final SKEY_CHDN_3:I = 0x321
.field public static final SKEY_CHDN_4:I = 0x322
.field public static final SKEY_CHDN_5:I = 0x323
.field public static final SKEY_CHUP_1:I = 0x31a
.field public static final SKEY_CHUP_2:I = 0x31b
.field public static final SKEY_CHUP_3:I = 0x31c
.field public static final SKEY_CHUP_4:I = 0x31d
.field public static final SKEY_CHUP_5:I = 0x31e
.field public static final SKEY_MODE_1:I = 0x329
.field public static final SKEY_MODE_2:I = 0x32a
.field public static final SKEY_MODE_3:I = 0x32b
.field public static final SKEY_MODE_4:I = 0x32c
.field public static final SKEY_MODE_5:I = 0x32d
.field public static final SKEY_MUTE_1:I = 0x324
.field public static final SKEY_MUTE_2:I = 0x325
.field public static final SKEY_MUTE_3:I = 0x326
.field public static final SKEY_MUTE_4:I = 0x327
.field public static final SKEY_MUTE_5:I = 0x328
.field public static final SKEY_NAVI_1:I = 0x33d
.field public static final SKEY_NAVI_2:I = 0x33e
.field public static final SKEY_NAVI_3:I = 0x33f
.field public static final SKEY_NAVI_4:I = 0x340
.field public static final SKEY_NAVI_5:I = 0x341
.field public static final SKEY_POWEWR_1:I = 0x301
.field public static final SKEY_POWEWR_2:I = 0x302
.field public static final SKEY_POWEWR_3:I = 0x303
.field public static final SKEY_POWEWR_4:I = 0x304
.field public static final SKEY_POWEWR_5:I = 0x305
.field public static final SKEY_PP_1:I = 0x338
.field public static final SKEY_PP_2:I = 0x339
.field public static final SKEY_PP_3:I = 0x33a
.field public static final SKEY_PP_4:I = 0x33b
.field public static final SKEY_PP_5:I = 0x33c
.field public static final SKEY_SEEKDN_1:I = 0x315
.field public static final SKEY_SEEKDN_2:I = 0x316
.field public static final SKEY_SEEKDN_3:I = 0x317
.field public static final SKEY_SEEKDN_4:I = 0x318
.field public static final SKEY_SEEKDN_5:I = 0x319
.field public static final SKEY_SEEKUP_1:I = 0x310
.field public static final SKEY_SEEKUP_2:I = 0x311
.field public static final SKEY_SEEKUP_3:I = 0x312
.field public static final SKEY_SEEKUP_4:I = 0x313
.field public static final SKEY_SEEKUP_5:I = 0x314
.field public static final SKEY_VOLDN_1:I = 0x30b
.field public static final SKEY_VOLDN_2:I = 0x30c
.field public static final SKEY_VOLDN_3:I = 0x30d
.field public static final SKEY_VOLDN_4:I = 0x30e
.field public static final SKEY_VOLDN_5:I = 0x30f
.field public static final SKEY_VOLUP_1:I = 0x306
.field public static final SKEY_VOLUP_2:I = 0x307
.field public static final SKEY_VOLUP_3:I = 0x308
.field public static final SKEY_VOLUP_4:I = 0x309
.field public static final SKEY_VOLUP_5:I = 0x30a
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
The head unit I am working on has the hardware keys/buttons below:
Volume knob (round)
Phone key
Power
Eject
Prev
Next
Eject
DIMM (Shuts of screen)
BAND (RADIO)
NAV (Navigation app)
SET (OEM Factory Settings)

Related

[Q] How to tap into CoreDLL.DLL GetSystemPowerStatusEx2 ?

Hi all,
none of the currently existing battery current (mA) meters for WindowsMobile make me really happy: acbPower, PowerMonitor 1.05, some Mortscripts...
I'd rather try to write something on my own to record and store the power usage profile, plot it somehow, do runtime prediction etc.
Apparently the data comes from CoreDLL.DLL, esp GetSystemPowerStatusEx2. The registry only stores the remaining capacity, which is of low interest to me.
Neither Mortscript nor Basic4PPC seem to able to tap into the functions of this CoreDLL, Are there 'wrapper' tools to expose these functions to them somehow?
How to I skin this cat? Is there a way to embed the DLL and functions into Basic4PPC somehow? May need complex SDK tools or something, maybe out of my league?
I found the following code sniplet, probably .NET (VisualBasic, VIsualC?), but don't know how to convert it to use it in Basic4PPC, NSBasic or else?
Any ideas, suggestions - thanks!
m
[DllImport("coredll.dll", EntryPoint = "GetSystemPowerStatusEx2", SetLastError = true)]
private static extern uint GetSystemPowerStatusEx2(_SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2,
uint dwLen,
bool fUpdate);
public bool MS_GetSystemPowerStatusEx2()
{
bool ret_value = false;
if (MSAPIWrapperStart == false)
{
return true;
}
if (GetSystemPowerStatusEx2(SystemPowerStatusEX2,
(uint)Marshal.SizeOf(typeof(_SYSTEM_POWER_STATUS_E X2)),
false) != 0)
{
ret_value = true;
}
return ret_value;
}
public struct _SYSTEM_POWER_STATUS_EX2
{
public byte ACLineStatus;
public byte BatteryFlag;
public byte BatteryLifePercent;
public byte Reserved1;
public uint BatteryLifeTime;
public uint BatteryFullLifeTime;
public byte Reserved2;
public byte BackupBatteryFlag;
public byte BackupBatteryLifePercent;
public byte Reserved3;
public uint BackupBatteryLifeTime;
public uint BackupBatteryFullLifeTime;
public uint BatteryVoltage;
public uint BatteryCurrent;
public uint BatteryAverageCurrent;
public uint BatteryAverageInterval;
public uint BatterymAHourConsumed;
public uint BatteryTemperature;
public uint BackupBatteryVoltage;
public byte BatteryChemistry;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=128)]
public byte[] ExtraInfo;
}
private _SYSTEM_POWER_STATUS_EX2 SystemPowerStatusEX2;
SystemPowerStatusEX2 = new _SYSTEM_POWER_STATUS_EX2();

Using Provxml to add accents.

I've been trying to add a custom accent to my Focus S. Most tools available don't yet work (advance config is one) but the interlop unlock by using a provxml does work.
I've tried this
Code:
<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="11" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="11" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="11" value="Gray" datatype="string" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
and this to eliminate variables
Code:
<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="1" value="-8158588" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="1" value="-8158588" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="1" value="Gray" datatype="string" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="2" value="FF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="2" value="FF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="2" value="Gray" datatype="string" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="3" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="3" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="3" value="Gray" datatype="string" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="4" value="0xFF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="4" value="0xFF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="4" value="Gray" datatype="string" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
but it doesn't work.
Any help would gratefully be appreciated.
Quick question: did you save the file as Unicode? I think the Samsung tools expect Unicode provxml files. Or maybe it's the other way around, I forget.
GoodDayToDie said:
Quick question: did you save the file as Unicode? I think the Samsung tools expect Unicode provxml files. Or maybe it's the other way around, I forget.
Click to expand...
Click to collapse
I edited other provxml files that I know work. I edited them with notepad and with visual studio, lol I've tried everything.
I tried to do this myself when I had a Focus S with no success.
I wonder how Marvin_S's On-Device ProvXML TOOL gets this to work.
Hopefully he can chime in, hopefully he can get the tool working on the Focus S
ManelScout4Life said:
I wonder how Marvin_S's On-Device ProvXML TOOL gets this to work.
Hopefully he can chime in, hopefully he can get the tool working on the Focus S
Click to expand...
Click to collapse
Im using first gen dlls so a small chance it will work... Are u saying anything trough this app worked on the focus s? If non of the default edits work than dont even bother, ill need to update the app for the samsung s than.
Samsung indeed uses Unicode. Otherwise it wont work. Again there are no focus s dlls in there so idk if it will work, but let me know, otherwise I can add a focus s dll.
Marvin_S said:
Im using first gen dlls so a small chance it will work... Are u saying anything trough this app worked on the focus s? If non of the default edits work than dont even bother, ill need to update the app for the samsung s than.
Samsung indeed uses Unicode. Otherwise it wont work. Again there are no focus s dlls in there so idk if it will work, but let me know, otherwise I can add a focus s dll.
Click to expand...
Click to collapse
No, your tool does not work at all on the S, it opens but none of the functions work.
However, I can add provxml files with the filedeployer xaps.
I'm also unsure what the proper provxml file should look like for changing accents.
ManelScout4Life said:
No, your tool does not work at all on the S, it opens but none of the functions work.
However, I can add provxml files with the filedeployer xaps.
I'm also unsure what the proper provxml file should look like for changing accents.
Click to expand...
Click to collapse
As expected.
Very simple just save it in Unicode, than it should work man.
Also if you want to bind it in an app, I've found some native stuff to work with on the Samsung S
Code:
Nevermind
EDIT:
The api is listed here, there might be a way to update the app
EDIT2:
Code:
public void Initialize()
{
ComBridge.RegisterComDll("WirelessManager_SecProxyClient.dll", new Guid("6992E452-12CB-4cb7-A9C8-5CC548159A69"));
this.m_CoClass = new COSecWin32Proxy();
this.m_CoInterface = (ISecProxyWin32Interface) this.m_CoClass;
}
[ComImport, Guid("6992E452-12CB-4cb7-A9C8-5CC548159A69"), ClassInterface(ClassInterfaceType.None)]
public class COSecWin32Proxy
{
}
[ComImport, Guid("2A9C50C0-77AC-4a12-9E26-17395ADF8870"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISecProxyWin32Interface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void RegistrySetString(uint HKEY, string pwszPath, string valueName, string value);
void RegistryGetString(uint HKEY, string pwszPath, string valueName, out string value);
void RegistrySetDWORD(uint HKEY, string pwszPath, string valueName, uint value);
void RegistryGetDWORD(uint HKEY, string pwszPath, string valueName, out uint value);
void CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDisposition, uint dwFlagsAndAttributes, out uint phCreateFile);
void CloseHandle(uint hObject);
void ReadFile(uint hFile, out byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead);
void WriteFile(uint hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten);
void GetFileSize(uint hFile, out uint lpFileSizeHigh);
void CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
void DeleteFile(string lpFileName);
void LaunchExe(string szExe, string szArg);
}
Should be the code Ill need to add to the app (not sure if it will work though, ill have to scan the app further).
Marvin_S said:
As expected.
Very simple just save it in Unicode, than it should work man.
Also if you want to bind it in an app, I've found some native stuff to work with on the Samsung S
Code:
namespace Samsung.Phone.Native
{
public class Con
{
// Fields
private COSecCONProxy m_CoClass;
private ISecProxyCONInterface m_CoInterface;
private static Con m_single;
// Methods
static Con();
private Con();
public static void BluetoothCloseAudio();
public static void BluetoothOpenAudio();
public static ISecProxyCONInterface CallInterface();
public ISecProxyCONInterface GetComInterface();
public static Con GetInstance();
public static void GetRadioState(int device, out bool state);
public static void GetWirelessState(out bool state);
public void Initialize();
public static void SetRadioState(int device, bool state);
public static void SetWirelessState(bool state);
public static void WlanGetIpInfo(out string IpAddr, out string Subnet, out string Gateway, out string Dns, out string Wins, out bool DhcpMode);
public static void WlanGetStatus(out string macAddr, out string ssid, out int status, out int rssi, out int security);
public static void WlanSetIpInfo(string IpAddr, string Subnet, string Gateway, string Dns, string Wins, bool DhcpMode);
}
[ComImport, ClassInterface(ClassInterfaceType.None), Guid("3E16DD96-1BB8-4ed4-A74F-EE16307A147E")]
public class COSecCONProxy
{
}
[ComImport, ClassInterface(ClassInterfaceType.None), Guid("89DE267C-9F5A-43f5-895C-B891F0F64C6E")]
public class COSecRILProxy
{
}
[ComImport, Guid("A1EF1A51-6156-4882-A9D3-202881BC7A05"), ClassInterface(ClassInterfaceType.None)]
public class COSecSYSProxy
{
}
[ComImport, Guid("6992E452-12CB-4cb7-A9C8-5CC548159A69"), ClassInterface(ClassInterfaceType.None)]
public class COSecWin32Proxy
{
}
[ComImport, Guid("9ADD1CCA-FB7B-4f31-A496-9FC565DB0272"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISecProxyCONInterface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void WlanGetIpInfo(out string IpAddr, out string Subnet, out string Gateway, out string Dns, out string Wins, out bool DhcpMode);
void WlanSetIpInfo(string IpAddr, string Subnet, string Gateway, string Dns, string Wins, bool DhcpMode);
void WlanGetStatus(out string macAddr, out string ssid, out int status, out int rssi, out int security);
void SetRadioState(int device, bool state);
void GetRadioState(int device, out bool state);
void SetWirelessState(bool state);
void GetWirelessState(out bool state);
void BluetoothOpenAudio();
void BluetoothCloseAudio();
}
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("CA785B58-3211-46ee-B2B8-13F0CFA18C17")]
public interface ISecProxyRILInterface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void GetIMSI(out string IMSI);
void GetIMEI(out string IMEI);
void GetLockingStatus(uint m_dwLockFacility, out uint pdwLockStatus, out uint pdwResult);
void GetCallWaitingStatus(out uint pdwInfoClass, out uint pdwResult);
void SetCallWaitingStatus(uint dwInfoClass, uint dwStatus, out uint pdwResult);
void GetOperatorList([MarshalAs(UnmanagedType.SafeArray)] out byte[] info, out uint pdwCount, out uint pdwResult);
void SetCurrentOperator(uint dwMode, IntPtr info, out uint pdwResult);
void GetCallForwardingSettings(uint dwReason, uint dwAddressID, out uint pdwStatus, out uint pdwNumType, out string pwszAddress, out uint pdwDelayTime, out uint pdwResult);
void AddCallForwardingSettings(uint dwReason, uint dwInfoClass, string wszAddress, uint dwDelayTime, out uint pdwResult);
void RemoveCallForwardingSettings(uint dwReason, uint dwInfoClass, out uint pdwResult);
void RIL_Devspecific2DWORD(uint dwCmdID, out uint pdwParam1, out uint pdwParam2, out uint pdwResult);
void GetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, out uint pdwBarringStatus, out uint pdwResult);
void SetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, uint dwBarringStatus, out uint pdwResult);
void GetAudioMute(out uint dwEnable);
void SetAudioMute(uint dwEnable);
void Hangup();
void PerformImeiCompare(out string strSalesCode, out uint dwResult, out string strErrorMessage);
void SetLockingStatus(uint m_dwLockFacility, string pPasswd, out uint m_dwStatus, out uint pdwResult);
void CallBlockerUpdateInfo(string pwszUpdatedUserInfo, uint dwOpMode, out uint dwResult);
void GetCBConfig(out uint dwTotal, out uint dwSize, out byte[] lpBuffer);
void SetCBConfig(uint dwTotal, uint dwSize, byte[] lpBuffer);
}
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("E05255E0-ED8F-4898-B3C3-4F8C5E29A2C1")]
public interface ISecProxySYSInterface
{
void ChekcAPI(uint apiID, out uint result);
}
[ComImport, Guid("2A9C50C0-77AC-4a12-9E26-17395ADF8870"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISecProxyWin32Interface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void RegistrySetString(uint HKEY, string pwszPath, string valueName, string value);
void RegistryGetString(uint HKEY, string pwszPath, string valueName, out string value);
void RegistrySetDWORD(uint HKEY, string pwszPath, string valueName, uint value);
void RegistryGetDWORD(uint HKEY, string pwszPath, string valueName, out uint value);
void CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDisposition, uint dwFlagsAndAttributes, out uint phCreateFile);
void CloseHandle(uint hObject);
void ReadFile(uint hFile, out byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead);
void WriteFile(uint hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten);
void GetFileSize(uint hFile, out uint lpFileSizeHigh);
void CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
void DeleteFile(string lpFileName);
void LaunchExe(string szExe, string szArg);
}
public class RIL
{
// Fields
private COSecRILProxy m_CoClass;
private ISecProxyRILInterface m_CoInterface;
private static RIL m_single;
// Methods
static RIL();
private RIL();
public static void AddCallForwardingSettings(uint dwReason, uint dwInfoClass, string wszAddress, uint dwDelayTime, out uint pdwResult);
public static void CallBlockerUpdateInfo(string pwszUpdatedUserInfo, uint dwOpMode, out uint dwResult);
public static ISecProxyRILInterface CallInterface();
public static void GetAudioMute(out uint dwEnable);
public static void GetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, out uint pdwBarringStatus, out uint pdwResult);
public static void GetCallForwardingSettings(uint dwReason, uint dwAddressID, out uint pdwStatus, out uint pdwNumType, out string pwszAddress, out uint pdwDelayTime, out uint pdwResult);
public static void GetCallWaitingStatus(out uint pdwInfoClass, out uint pdwResult);
public ISecProxyRILInterface GetComInterface();
public static void GetIMEI(out string IMEI);
public static void GetIMSI(out string IMSI);
public static RIL GetInstance();
public static void GetLockingStatus(uint m_dwLockFacility, out uint pdwLockStatus, out uint pdwResult);
public static void GetOperatorList(out byte[] info, out uint pdwCount, out uint pdwResult);
public void Initialize();
public static void PerformImeiCompare(out string strSalesCode, out uint dwResult, out string strErrorMessage);
public static void RemoveCallForwardingSettings(uint dwReason, uint dwInfoClass, out uint pdwResult);
public static void RIL_Devspecific2DWORD(uint dwCmdID, out uint pdwParam1, out uint pdwParam2, out uint pdwResult);
public static void SetAudioMute(uint dwEnable);
public static void SetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, uint dwBarringStatus, out uint pdwResult);
public static void SetCallWaitingStatus(uint dwInfoClass, uint dwStatus, out uint pdwResult);
public static void SetCurrentOperator(uint dwMode, IntPtr info, out uint pdwResult);
}
public class RilCBMsgConfig
{
// Fields
public uint cbSize;
public List<RILRANGE> channelList;
public uint dwBroadcastMsgLangs;
public uint dwParams;
public bool fAccept;
// Methods
public RilCBMsgConfig();
public void AddChannel(RILRANGE range);
public bool Contains(RILRANGE range);
public uint GetCbSize();
public RILCBMSGCONFIG GetConfigStruct();
public static RILRANGE GetRange(int channel);
public static byte[] MakeRawData(RilCBMsgConfig cbConfg);
public static RilCBMsgConfig ParseData(uint total, uint size, byte[] rawData);
public override string ToString();
// Nested Types
[StructLayout(LayoutKind.Sequential)]
public struct RILCBMSGCONFIG
{
public uint cbSize;
public uint dwParams;
public uint dwBroadcastMsgLangs;
public bool fAccept;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1)]
public byte[] channelList;
}
[StructLayout(LayoutKind.Sequential)]
public struct RILRANGE
{
public uint dwMin;
public uint dwMax;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct RILOPERATORNAMES
{
public uint cbSize;
public uint dwParams;
public string szLongName;
public string szShortName;
public string szNumName;
public string szCountryCode;
}
public class Sys
{
// Fields
private COSecSYSProxy m_CoClass;
private ISecProxySYSInterface m_CoInterface;
private static Sys m_single;
// Methods
static Sys();
private Sys();
public static ISecProxySYSInterface CallInterface();
public ISecProxySYSInterface GetComInterface();
public static Sys GetInstance();
public void Initialize();
}
public class Win32
{
// Fields
public static uint CREATE_ALWAYS;
public static uint CREATE_NEW;
public static uint FILE_ATTRIBUTE_ARCHIVE;
public static uint FILE_ATTRIBUTE_COMPRESSED;
public static uint FILE_ATTRIBUTE_DIRECTORY;
public static uint FILE_ATTRIBUTE_ENCRYPTED;
public static uint FILE_ATTRIBUTE_HIDDEN;
public static uint FILE_ATTRIBUTE_INROM;
public static uint FILE_ATTRIBUTE_NORMAL;
public static uint FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
public static uint FILE_ATTRIBUTE_OFFLINE;
public static uint FILE_ATTRIBUTE_READONLY;
public static uint FILE_ATTRIBUTE_REPARSE_POINT;
public static uint FILE_ATTRIBUTE_ROMMODULE;
public static uint FILE_ATTRIBUTE_ROMSTATICREF;
public static uint FILE_ATTRIBUTE_SPARSE_FILE;
public static uint FILE_ATTRIBUTE_SYSTEM;
public static uint FILE_ATTRIBUTE_TEMPORARY;
public static uint FILE_FLAG_BACKUP_SEMANTICS;
public static uint FILE_FLAG_DELETE_ON_CLOSE;
public static uint FILE_FLAG_NO_BUFFERING;
public static uint FILE_FLAG_OVERLAPPED;
public static uint FILE_FLAG_POSIX_SEMANTICS;
public static uint FILE_FLAG_RANDOM_ACCESS;
public static uint FILE_FLAG_SEQUENTIAL_SCAN;
public static uint FILE_FLAG_WRITE_THROUGH;
public static uint FILE_SHARE_DELETE;
public static uint FILE_SHARE_READ;
public static uint FILE_SHARE_WRITE;
public static uint GENERIC_ALL;
public static uint GENERIC_EXECUTE;
public static uint GENERIC_READ;
public static uint GENERIC_WRITE;
public static uint HKEY_CLASSES_ROOT;
public static uint HKEY_CURRENT_USER;
public static uint HKEY_LOCAL_MACHINE;
public static uint HKEY_USERS;
private COSecWin32Proxy m_CoClass;
private ISecProxyWin32Interface m_CoInterface;
private static Win32 m_single;
public static uint MODULE_ATTR_NODEBUG;
public static uint MODULE_ATTR_NOT_TRUSTED;
public static uint OPEN_ALWAYS;
public static uint OPEN_EXISTING;
public static uint OPEN_FOR_LOADER;
public static string REG_WM_BUSY_FLAG;
public static string REG_WM_GPRS_ALWAYSON;
public static string REG_WM_GPRS_APN;
public static string REG_WM_GPRS_AUTH_TYPE;
public static string REG_WM_GPRS_NAME;
public static string REG_WM_GPRS_PASSWORD;
public static string REG_WM_GPRS_PROFILES_TO_DELETE;
public static string REG_WM_GPRS_UNAME;
public static string REG_WM_MMS_APN;
public static string REG_WM_MMS_MMSC;
public static string REG_WM_MMS_MSGSIZE;
public static string REG_WM_MMS_NAME;
public static string REG_WM_MMS_PROFILES_TO_DELETE;
public static string REG_WM_MMS_PROXY;
public static string REG_WM_PROXY_ADDR;
public static string REG_WM_PROXY_APN;
public static string REG_WM_PROXY_DOMAIN;
public static string REG_WM_PROXY_NAME;
public static string REG_WM_PROXY_PORT;
public static string REG_WM_PROXY_PROFILES_TO_DELETE;
public static string REG_WM_ROOT;
public static uint TRUNCATE_EXISTING;
// Methods
static Win32();
private Win32();
public static ISecProxyWin32Interface CallInterface();
public static void CloseHandle(uint hObject);
public static void CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
public static void CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDisposition, uint dwFlagsAndAttributes, out uint phCreateFile);
public static void DeleteFile(string lpFileName);
public ISecProxyWin32Interface GetComInterface();
public static void GetFileSize(uint hFile, out uint lpFileSizeHigh);
public static Win32 GetInstance();
public void Initialize();
public static void LaunchExe(string szExe, string szArg);
public static void ReadFile(uint hFile, out byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead);
public static void RegistryGetDWORD(uint HKEY, string pwszPath, string valueName, out uint value);
public static void RegistryGetString(uint HKEY, string pwszPath, string valueName, out string value);
public static void RegistrySetDWORD(uint HKEY, string pwszPath, string valueName, uint value);
public static void RegistrySetString(uint HKEY, string pwszPath, string valueName, string value);
public static void WriteFile(uint hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten);
}
}
It seems the API I need to make DiagProvXML work is still there. I might give it an update to support the Focus S (also Focus W & co.)
Ill need somebody with a Focus S to test it for me also.
Click to expand...
Click to collapse
I can test it but which one of the codes in the opening post is done correctly?
@Marvin_S: If you do a search you can find my post from a couple weeks back with various tests for the Samsung gen2 DLLs. They are indeed different from the gen1 DLLs, but offer a lot of exciting new capabilities. Unfortunately, there's also some kind of check or block on third-party use of the DLLs. I'm not yet sure exactly what caused it to not work. I'm still working on that, though.
EDIT: You've been able to make that work? My test app either produced an error message (file not found, of all things) or simply crashed each time I tried to use one of those APIs.
GoodDayToDie said:
@Marvin_S: If you do a search you can find my post from a couple weeks back with various tests for the Samsung gen2 DLLs. They are indeed different from the gen1 DLLs, but offer a lot of exciting new capabilities. Unfortunately, there's also some kind of check or block on third-party use of the DLLs. I'm not yet sure exactly what caused it to not work. I'm still working on that, though.
EDIT: You've been able to make that work? My test app either produced an error message (file not found, of all things) or simply crashed each time I tried to use one of those APIs.
Click to expand...
Click to collapse
No, untested, just inspected the samsung xap. I already assumed it would not work, but I posted it here for future reference for myself.
Ah too bad, can you call any api at all? For example the launchexe? it seems like they renamed rapiconfig.exe into ConfigXML.exe (or maybe rapiconfig is still there) it seems that ConfigXML.exe does not accept raw xml indeed but rather canned commands.
I included the source for the app, so feel free to take a look (and read the thread of tester comments, since I don't have a suitable device for testing).
Registry access: failed.
Filesystem access (yes the new DLLs seem to offer it): failed.
Provxml: failed
Other, trivial things: failed.
The OEM apps all contain a file simply called "_" which is a simple text file containing hex data as a string. I suspect the problems may be related to this file. If it's some kind of signature, that's going to be very hard to fake.
Here is the test app and source
[XAP][SOURCE][MANGO] Samsung gen2 interop test app v2
Any news from anyone?

XClasses - A Xposed Library

Hello guys,
I want to share my library XClasses.
My idea was to see every XClass as an extension of the original class.
My aim was to improve the user experience during the development.
Also I wanted to increase the readability of xposed code.
So it's nothing special.
It's just my personal opinion how readable code should look like.
A small example:
Code:
public class XposedMain implements IXposedHookLoadPackage
{
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam)
throws Throwable {
if(lpparam.packageName.equals("com.android.systemui"))
{
XposedHelpers.findAndHookMethod(TextView.class, "setText", CharSequence.class, TextView.BufferType.class, boolean.class, int.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param)
throws Throwable {
TextView tv = (TextView)param.thisObject;
CharSequence text = (CharSequence)param.args[0];
TextView.BufferType type = (TextView.BufferType)param.args[1];
boolean notifyBefore = (Boolean)param.args[2];
int oldlen = (Integer)param.args[3];
XposedBridge.log("setText "+text+" with size "+tv.getTextSize());
}
});
}
}
}
The same code with XClasses:
Code:
// class 1
public class XposedMain implements IXposedHookLoadPackage
{
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam)
throws Throwable {
if(lpparam.packageName.equals("com.android.systemui"))
{
setup(lpparam.classLoader);
hook(XTextView.class);
}
}
}
// class 2
public class XTextView
extends AbstractXClass<TextView>
{
public static String getOriginalClassName() { return TextView.class.getCanonicalName(); }
public XTextView(TextView objectThis) { super(objectThis); }
@BeforeOriginalMethod
private void setText_Before(CharSequence text, TextView.BufferType type,
boolean notifyBefore, int oldlen) throws Throwable {
XposedBridge.log("setText "+text+" with size "+getThis().getTextSize());
}
}
If you would like to know more you should visit the following site: https://github.com/seebye/XClasses
Regards,
Seebye

[Q] How to use a variable from one hook in another? (Why is this an NPE?)

Hello, I have made this code
Link : http://hastebin.com/hiyupafibi.java
Duplicated here :
Code:
//In my module, I have this activity MainActivity, which has a function to generate random number
private int randomNumber() {
return (new Random()).nextInt(3);
}
//Toast this random number somewhere in the main activity
Toast.makeText(MainActivity.this, " " + randomNumber(), Toast.LENGTH_LONG).show();
//In XposedMod, make a hook
public class XposedMod implements IXposedHookLoadPackage {
private TextView tv;
public static final String PACKAGE_NAME = ".......";
@Override
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
if (lpparam.packageName.equals(PACKAGE_NAME)) {
Class<?> MainActivityClass = XposedHelpers.findClass(PACKAGE_NAME + ".MainActivity", lpparam.classLoader);
XposedHelpers.findAndHookMethod(MainActivityClass, "randomNumber", new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
try {
tv.setText("No NPE");
return 45;
} catch (NullPointerException e) {
return 44;
}
}
});
} else if (lpparam.packageName.equals("com.android.systemui")) {
Class<?> someClass = XposedHelpers.findClass("com.android.systemui.SomeClass", lpparam.classLoader);
XposedHelpers.findAndHookMethod(someClass, "someMethod", Context.class, new XC_MethodHook() {
@Override
protected Object beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
tv = new TextView((Context) param.args[0]);
if (tv==null)
XposedBridge.log("tv is null, apologies!");
}
});
}
}
}
Everytime that toast is supposed to be shown, I get the answer to be 44 (that is, tv is null), but that should not be the case, because the log statement when tv is null is not shown. What am I doing wrong?
Thanks for the help, I appreciate it.
Cheers!

GWD sources

It seems the ALARM and NOTIFICATION sources aren't shown in GWD. But they may be useable by modding the xml. Likely as sources for a hand, text, digital clock etc.
Code:
package com.samsung.gwd.source;
import java.util.HashMap;
public class Source
{
public static final String SOURCE_CALORIE_CAL = "cal";
public static final String SOURCE_CALORIE_KCAL = "kcal";
public static final String SOURCE_CALORIE_UNIT_CAL = "(cal)";
public static final String SOURCE_CALORIE_UNIT_KCAL = "(kcal)";
public static final String SOURCE_DISTANCE_M = "m";
public static final String SOURCE_DISTANCE_KM = "km";
public static final String SOURCE_DISTANCE_MILE = "mile";
public static final String SOURCE_DISTANCE_UNIT_M = "(m)";
public static final String SOURCE_DISTANCE_UNIT_KM = "(km)";
public static final String SOURCE_DISTANCE_UNIT_MILE = "(mile)";
public static final String SOURCE_SPEED_M = "m/s";
public static final String SOURCE_SPEED_KM = "km/h";
public static final String SOURCE_SPEED_MILE = "mile/h";
public static final String SOURCE_SPEED_UNIT_M = "(m/s)";
public static final String SOURCE_SPEED_UNIT_KM = "(km/h)";
public static final String SOURCE_SPEED_UNIT_MILE = "(mile/h)";
public static final String SOURCE_TEMPERATURE_C = "�C";
public static final String SOURCE_TEMPERATURE_F = "�F";
public static final String SOURCE_TEMPERATURE_K = "�K";
public static final String SOURCE_TEMPERATURE_UNIT_C = "(�C)";
public static final String SOURCE_TEMPERATURE_UNIT_F = "(�F)";
public static final String SOURCE_TEMPERATURE_UNIT_K = "(�K)";
public static final String SOURCE_HUMIDITY_PERCENT = "%";
public static final String SOURCE_HUMIDITY_UNIT_PERCENT = "(%)";
public static final String WEATHER_DISPLAY_TYPE_ICON = "Icon";
public static final String WEATHER_DISPLAY_TYPE_MAIN = "Main";
public static final String WEATHER_DISPLAY_TYPE_DESCRIPTION = "Description";
public static final String WEATHER_DISPLAY_TYPE_NUMBER = "Number";
public static final String WEATHER_DISPLAY_TYPE_ID = "ID";
public static final Source NONE = new Source("None", "none", 0.0D, 0.0D, false, 0.0D, 0.0D, null, new String[] { "None" });
public static final Source HOUR = new Source("Hour in Day", "hour0-23", 0.0D, 24.0D, true, 0.0D, 720.0D, null, new String[] { "%d" });
public static final Source HOUR_MINUTE = new Source("Hour in Day", "hour0-23.minute", 0.0D, 24.0D, true, 0.0D, 720.0D, null, new String[] { "%f" });
public static final Source MINUTE = new Source("Minute in Hours", "minute", 0.0D, 60.0D, false, 0.0D, 360.0D, null, new String[] { "%d" });
public static final Source MINUTE_SECOND = new Source("Minute in Hours", "minute.second", 0.0D, 60.0D, true, 0.0D, 360.0D, null, new String[] { "%f" });
public static final Source SECOND = new Source("Second in Minute", "second", 0.0D, 60.0D, false, 0.0D, 360.0D, null, new String[] { "%d" });
public static final Source SECOND_SWEEP = new Source("Second in Minute", "second.millisecond", 0.0D, 60.0D, true, 0.0D, 360.0D, null, new String[] { "%f" });
public static final Source DAY = new Source("Day of Month", "day", 0.0D, 31.0D, false, 0.0D, 360.0D, null, new String[] { "%d" });
public static final Source MONTH = new Source("Month of Year", "month", 0.0D, 12.0D, false, 0.0D, 360.0D, null, new String[] { "%d" });
public static final Source DAY_OF_WEEK = new Source("Day of Week", "dayOfWeek", 1.0D, 8.0D, false, 0.0D, 360.0D, null, new String[] { "%d" });
public static final Source DAY_OF_YEAR = new Source("Day of Year", "month0-11.day", 0.0D, 12.0D, true, 0.0D, 360.0D, null, new String[] { "%d" });
public static final Source BATTERY_PERCENT = new Source("Battery %", "battery.percent", 0.0D, 100.0D, false, 0.0D, 360.0D,
null, new String[] { "%d %", "%d", "% %d" });
public static final Source BATTERY_LEVEL = new Source("Battery Level", "battery.level", 0.0D, 4.0D, false, 0.0D, 360.0D,
null, new String[] { "%d" });
public static final Source BATTERY_CHARGING_STATUS = new Source("Battery charging status", "battery.chargingStatus", 0.0D, 1.0D, false, 0.0D, 180.0D,
null, new String[] { "%d" });
public static final Source PEDOMETER_STEP_PERCENT = new Source("Steps %", "pedometer.stepPercent", 0.0D, 100.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d %", "%d", "% %d" });
public static final Source PEDOMETER_CALORIE = new Source("Burned calorie", "pedometer.calorie", 0.0D, 1000000.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d kcal",
"%d (kcal)" },
new String[] { "kcal" },
new String[] { "0" },
"kcal", "0");
public static final Source PEDOMETER_DISTANCE = new Source("Moved distance", "pedometer.distance", 0.0D, 10000.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d km",
"%d m",
"%d mile",
"%d (km)",
"%d (m)",
"%d (mile)" },
new String[] { "m", "km", "mile" },
new String[] { "0", "1", "2", "3" },
"km", "1");
public static final Source PEDOMETER_SPEED = new Source("Speed", "stepsPerSec", 0.0D, 20.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d km/h",
"%d m/s",
"%d mile/h",
"%d (km/h)",
"%d (m/s)",
"%d (mile/h)" },
new String[] { "m/s", "km/h", "mile/h" },
new String[] { "0", "1", "2", "3" },
"km/h", "1");
public static final Source PEDOMETER_STEP_COUNT = new Source("Step counts", "pedometer.step", 0.0D, 10000.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d steps", "%d" });
public static final Source PEDOMETER_STEP_GOAL = new Source("Steps goal", "pedometer.target", 0.0D, 100.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d steps", "%d" });
public static final Source PEDOMETER_FLOOR = new Source("Floor", "floor", 0.0D, 100.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d floor", "%d" });
public static final Source HEARTRATE = new Source("Heart rate (bpm)", "heartrate.recent", 0.0D, 200.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d bpm", "%d" });
public static final Source WATER_INTAKE = new Source("Water Intake", "water", 0.0D, 100.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d" });
public static final Source WATER_GOAL = new Source("Water Goal", "water.goal", 0.0D, 100.0D, false, 0.0D, 360.0D,
null, new String[] { "%d" });
public static final Source CAFFEINE_INTAKE = new Source("Caffeine Intake", "caffeine", 0.0D, 100.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/healthinfo", new String[] { "%d" });
public static final Source CAFFEINE_GOAL = new Source("Caffeine Goal", "caffeine.goal", 0.0D, 100.0D, false, 0.0D, 360.0D,
null, new String[] { "%d" });
public static final Source ALARM_HOUR = new Source("Alarm hour", "alarm.hour0-23", 0.0D, 24.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/alarm.get", new String[] { "%d" });
public static final Source ALARM_MINUTE = new Source("Alarm minute", "alarm.minute", 0.0D, 60.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/alarm.get", new String[] { "%d" });
public static final Source ALARM_STATE = new Source("Alarm state", "alarm.state", 0.0D, 2.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/alarm.get", new String[] { "%d" });
public static final Source MOONPHASE_POSITION = new Source("Moon Phase Position", "moonphase.position", 0.0D, 28.0D, true, 0.0D, 360.0D,
null, new String[] { "%f" },
null,
new String[] { "0", "1", "2", "3", "4", "5" },
null, "0");
public static final Source MOONPHASE_TYPE = new Source("Moon Phase Type", "moonphase.type", 0.0D, 8.0D, false, 0.0D, 360.0D,
null, new String[] { "%d" });
public static final Source NOTIFICATION_UNREAD = new Source("Notification unread", "notification.unread", 0.0D, 100.0D, false, 0.0D, 360.0D,
"http://tizen.org/privilege/notification", new String[] { "%d" });
public static final Source WEATHER_TYPE = new Source("Weather Type", "Weather Type", 0.0D, 100.0D, false, 0.0D, 360.0D,
null, new String[] { "Main",
"Icon",
"Description",
"Number",
"ID" });
public static final Source CURRENT_TEMPERATURE = new Source("Current Temperature", "Current Temperature", -50.0D, 50.0D, false, 0.0D, 360.0D,
null, new String[] { "%f �C",
"%f �F",
"%f �K",
"%f (�C)",
"%f (�F)",
"%f (�K)" },
new String[] { "�C", "�F", "�K" },
new String[] { "0", "1", "2", "3" },
"�C", "1");
public static final Source WEATHER_HUMIDITY = new Source("Weather Humidity", "Weather Humidity", 0.0D, 100.0D, false, 0.0D, 360.0D,
null,
new String[] { "%d %",
"%d (%)" },
new String[] { "%" },
new String[] { "0" },
"%", "0");
public static final Source WEATHER_CITY_NAME = new Source("City Name", "City Name", 0.0D, 100.0D, false, 0.0D, 360.0D,
null, new String[] { "%d" });
public static final Source WEATHER_LAST_UPDATE_TIME = new Source("Last update Time", "Last update Time", 0.0D, 100.0D, false, 0.0D, 360.0D,
null, new String[] { "M/d HH:mm", "HH : mm" });
private static final HashMap<String, Source> map = new HashMap();
public final String name;
public final String id;
public double startValue;
public double endValue;
public boolean real;
public double startAngle;
public double endAngle;
public final String privilege;
public final String[] display;
public final String[] unit;
public final String[] precision;
public final String defaultUnit;
public final String defaultPrecision;
static
{
map.put(NONE.id, NONE);
map.put(HOUR_MINUTE.id, HOUR_MINUTE);
map.put(HOUR.id, HOUR);
map.put(MINUTE.id, MINUTE);
map.put(MINUTE_SECOND.id, MINUTE_SECOND);
map.put(SECOND.id, SECOND);
map.put(SECOND_SWEEP.id, SECOND_SWEEP);
map.put(DAY.id, DAY);
map.put(MONTH.id, MONTH);
map.put(DAY_OF_WEEK.id, DAY_OF_WEEK);
map.put(DAY_OF_YEAR.id, DAY_OF_YEAR);
map.put(BATTERY_PERCENT.id, BATTERY_PERCENT);
map.put(BATTERY_LEVEL.id, BATTERY_LEVEL);
map.put(BATTERY_CHARGING_STATUS.id, BATTERY_CHARGING_STATUS);
map.put(PEDOMETER_STEP_PERCENT.id, PEDOMETER_STEP_PERCENT);
map.put(PEDOMETER_CALORIE.id, PEDOMETER_CALORIE);
map.put(PEDOMETER_DISTANCE.id, PEDOMETER_DISTANCE);
map.put(PEDOMETER_SPEED.id, PEDOMETER_SPEED);
map.put(PEDOMETER_STEP_COUNT.id, PEDOMETER_STEP_COUNT);
map.put(PEDOMETER_STEP_GOAL.id, PEDOMETER_STEP_GOAL);
map.put(PEDOMETER_FLOOR.id, PEDOMETER_FLOOR);
map.put(HEARTRATE.id, HEARTRATE);
map.put(WATER_INTAKE.id, WATER_INTAKE);
map.put(WATER_GOAL.id, WATER_GOAL);
map.put(CAFFEINE_INTAKE.id, CAFFEINE_INTAKE);
map.put(CAFFEINE_GOAL.id, CAFFEINE_GOAL);
map.put(ALARM_HOUR.id, ALARM_HOUR);
map.put(ALARM_MINUTE.id, ALARM_MINUTE);
map.put(ALARM_STATE.id, ALARM_STATE);
map.put(MOONPHASE_POSITION.id, MOONPHASE_POSITION);
map.put(MOONPHASE_TYPE.id, MOONPHASE_TYPE);
map.put(NOTIFICATION_UNREAD.id, NOTIFICATION_UNREAD);
map.put(WEATHER_TYPE.id, WEATHER_TYPE);
map.put(CURRENT_TEMPERATURE.id, CURRENT_TEMPERATURE);
map.put(WEATHER_HUMIDITY.id, WEATHER_HUMIDITY);
map.put(WEATHER_CITY_NAME.id, WEATHER_CITY_NAME);
map.put(WEATHER_LAST_UPDATE_TIME.id, WEATHER_LAST_UPDATE_TIME);
map.put(NONE.name, NONE);
map.put(HOUR_MINUTE.name, HOUR_MINUTE);
map.put(HOUR.name, HOUR);
map.put(MINUTE.name, MINUTE);
map.put(MINUTE_SECOND.name, MINUTE_SECOND);
map.put(SECOND.name, SECOND);
map.put(SECOND_SWEEP.name, SECOND_SWEEP);
map.put(DAY.name, DAY);
map.put(MONTH.name, MONTH);
map.put(DAY_OF_WEEK.name, DAY_OF_WEEK);
map.put(DAY_OF_YEAR.name, DAY_OF_YEAR);
map.put(BATTERY_PERCENT.name, BATTERY_PERCENT);
map.put(BATTERY_LEVEL.name, BATTERY_LEVEL);
map.put(BATTERY_CHARGING_STATUS.name, BATTERY_CHARGING_STATUS);
map.put(PEDOMETER_STEP_PERCENT.name, PEDOMETER_STEP_PERCENT);
map.put(PEDOMETER_CALORIE.name, PEDOMETER_CALORIE);
map.put(PEDOMETER_DISTANCE.name, PEDOMETER_DISTANCE);
map.put(PEDOMETER_SPEED.name, PEDOMETER_SPEED);
map.put(PEDOMETER_STEP_COUNT.name, PEDOMETER_STEP_COUNT);
map.put(PEDOMETER_STEP_GOAL.name, PEDOMETER_STEP_GOAL);
map.put(PEDOMETER_FLOOR.name, PEDOMETER_FLOOR);
map.put(HEARTRATE.name, HEARTRATE);
map.put(WATER_INTAKE.name, WATER_INTAKE);
map.put(WATER_GOAL.name, WATER_GOAL);
map.put(CAFFEINE_INTAKE.name, CAFFEINE_INTAKE);
map.put(CAFFEINE_GOAL.name, CAFFEINE_GOAL);
map.put(ALARM_HOUR.name, ALARM_HOUR);
map.put(ALARM_MINUTE.name, ALARM_MINUTE);
map.put(ALARM_STATE.name, ALARM_STATE);
map.put(MOONPHASE_POSITION.name, MOONPHASE_POSITION);
map.put(MOONPHASE_TYPE.name, MOONPHASE_TYPE);
map.put(NOTIFICATION_UNREAD.name, NOTIFICATION_UNREAD);
map.put(WEATHER_TYPE.name, WEATHER_TYPE);
map.put(CURRENT_TEMPERATURE.name, CURRENT_TEMPERATURE);
map.put(WEATHER_HUMIDITY.name, WEATHER_HUMIDITY);
map.put(WEATHER_CITY_NAME.name, WEATHER_CITY_NAME);
map.put(WEATHER_LAST_UPDATE_TIME.name, WEATHER_LAST_UPDATE_TIME);
}
public Source(String name, String id, double startValue, double endValue, boolean real, double startAngle, double endAngle, String privilege, String[] display, String[] unit, String[] precision, String defaultUnit, String defaultPrecision)
{
this.name = name;
this.id = id;
this.startValue = startValue;
this.endValue = endValue;
this.real = real;
this.startAngle = startAngle;
this.endAngle = endAngle;
this.privilege = privilege;
this.display = display;
this.unit = unit;
this.precision = precision;
this.defaultUnit = defaultUnit;
this.defaultPrecision = defaultPrecision;
}
public Source(String name, String id, double startValue, double endValue, boolean real, double startAngle, double endAngle, String privilege, String[] display)
{
this(name, id, startValue, endValue, real, startAngle, endAngle, privilege, display, null, null, null, null);
}
public Source(Source source)
{
this(source.name, source.id, source.startValue, source.endValue, source.real, source.startAngle, source.endAngle, source.privilege, source.display, source.unit, source.precision, source.defaultUnit, source.defaultPrecision);
}
public boolean equals(Object obj)
{
if ((obj instanceof Source)) {
return (this.name.equals(((Source)obj).name)) && (this.id.equals(((Source)obj).id)) &&
(this.startValue == ((Source)obj).startValue) && (this.endValue == ((Source)obj).endValue) && (this.real == ((Source)obj).real) &&
(this.startAngle == ((Source)obj).startAngle) && (this.endAngle == ((Source)obj).endAngle);
}
return false;
}
public static Source findById(String id)
{
Source result = (Source)map.get(id);
if (result == null) {
return NONE;
}
return result;
}
public static Source findByName(String name)
{
return (Source)map.get(name);
}
}

Categories

Resources