[Q] Edit SystemUI.apk/smali? - Samsung Galaxy Nexus

So I don't know if this is an obvious question or not. There's something I want to change in the NetworkController.java class in the SystemUI.apk. I found what I need to do by looking at the Android source code. So after much research I downloaded APK manager and decompiled the apk. But now I have these smali files which I've read are the assembler for the dex format produced by the dalvik vm. So I don't know what to do now? Is this what I have to try to edit? Because I have no idea what's going on in NetworkController.smali. I know what I need to change in the java code... But I'm clueless with the smali? Is there another step here I missing that turns the smali into java code I can edit? Or is this really how people edit this stuff?!
Thanks!
Edit: So from more research it looks like the only way to edit the actual java code of the SystemUI.apk is to do it in the source and then compile my own rom. That's a lot of work for about 5 lines of a code I need to change. Is this really the case?
Edit 2: I've been doing a lot of research into this and I now know the exact lines that need to be changed to make this possible. Within com.android.systemui.statusbar.policy.NetworkController (In SystemUI.apk) there is a switch statement that decides the icon to be displayed based on the network. Part of this switch is as follows:
Code:
521 case TelephonyManager.NETWORK_TYPE_HSDPA:
522 case TelephonyManager.NETWORK_TYPE_HSUPA:
523 case TelephonyManager.NETWORK_TYPE_HSPA:
524 case TelephonyManager.NETWORK_TYPE_HSPAP:
525 if (mHspaDataDistinguishable) {
526 mDataIconList = TelephonyIcons.DATA_H[mInetCondition];
527 mDataTypeIconId = R.drawable.stat_sys_data_connected_h;
528 mContentDescriptionDataType = mContext.getString(
529 R.string.accessibility_data_connection_3_5g);
530 } else {
531 mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
532 mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
533 mContentDescriptionDataType = mContext.getString(
534 R.string.accessibility_data_connection_3g);
535 }
536 break;
So as you can see, the switch statement puts all the types of HSPA together into one case (by not breaking it falls through all of them to the last one), which is why it shows H no matter what. All that needs to be done here is to change it so HSPAP has its own case in which it uses the 4G icon (or an added H+ icon if so desired). I've actually been doing a lot of research today to see if I could just pull the SystemUI.apk from my rom, decompile it, make this modification, recompile, and push it back to do this myself... But I've now learned lots about how android (or the dalvik vm) compiles the java into smali assembly code and that's what I get from decompiling the apk. Not the java code. So this is not just a simple edit .
So is there any chance this could be added? Or could someone point me in a better direction as to how to make this modification myself? The smali code is extremely confusing. I'm not sure if it's even possible to edit the smali to do this, not that I would know where to start. It seems this has to be done before the ROM is compiled?
Thanks for the consideration! And I welcome any help!

BraydenJames said:
So I don't know if this is an obvious question or not. There's something I want to change in the NetworkController.java class in the SystemUI.apk. I found what I need to do by looking at the Android source code. So after much research I downloaded APK manager and decompiled the apk. But now I have these smali files which I've read are the assembler for the dex format produced by the dalvik vm. So I don't know what to do now? Is this what I have to try to edit? Because I have no idea what's going on in NetworkController.smali. I know what I need to change in the java code... But I'm clueless with the smali? Is there another step here I missing that turns the smali into java code I can edit? Or is this really how people edit this stuff?!
Thanks!
Edit: So from more research it looks like the only way to edit the actual java code of the SystemUI.apk is to do it in the source and then compile my own rom. That's a lot of work for about 5 lines of a code I need to change. Is this really the case?
Edit 2: I've been doing a lot of research into this and I now know the exact lines that need to be changed to make this possible. Within com.android.systemui.statusbar.policy.NetworkController (In SystemUI.apk) there is a switch statement that decides the icon to be displayed based on the network. Part of this switch is as follows:
Code:
521 case TelephonyManager.NETWORK_TYPE_HSDPA:
522 case TelephonyManager.NETWORK_TYPE_HSUPA:
523 case TelephonyManager.NETWORK_TYPE_HSPA:
524 case TelephonyManager.NETWORK_TYPE_HSPAP:
525 if (mHspaDataDistinguishable) {
526 mDataIconList = TelephonyIcons.DATA_H[mInetCondition];
527 mDataTypeIconId = R.drawable.stat_sys_data_connected_h;
528 mContentDescriptionDataType = mContext.getString(
529 R.string.accessibility_data_connection_3_5g);
530 } else {
531 mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
532 mDataTypeIconId = R.drawable.stat_sys_data_connected_3g;
533 mContentDescriptionDataType = mContext.getString(
534 R.string.accessibility_data_connection_3g);
535 }
536 break;
So as you can see, the switch statement puts all the types of HSPA together into one case (by not breaking it falls through all of them to the last one), which is why it shows H no matter what. All that needs to be done here is to change it so HSPAP has its own case in which it uses the 4G icon (or an added H+ icon if so desired). I've actually been doing a lot of research today to see if I could just pull the SystemUI.apk from my rom, decompile it, make this modification, recompile, and push it back to do this myself... But I've now learned lots about how android (or the dalvik vm) compiles the java into smali assembly code and that's what I get from decompiling the apk. Not the java code. So this is not just a simple edit .
So is there any chance this could be added? Or could someone point me in a better direction as to how to make this modification myself? The smali code is extremely confusing. I'm not sure if it's even possible to edit the smali to do this, not that I would know where to start. It seems this has to be done before the ROM is compiled?
Thanks for the consideration! And I welcome any help!
Click to expand...
Click to collapse
It's as simple as you think. Add a new case (removing the HSPAP case from the existing one) and use syntax as per the code snippet above. You'll need add the drawable or reuse an existing one. Keep the 'else' condition as well for fallback.
I'd reuse an existing drawable first (even a random WiFi or roaming one) just to check that your actual smali edit is good, then trace back the drawable requirements and add the image. You'll need to update the string as well if you want it distinguishable (wherever it's used).
If the edit is really a dud apktool will throw errors when you re-encode it.

You can just compile that systemUI apk, no need to do the whole rom.
Read this thread to do the same thing, first post.
http://forum.xda-developers.com/showthread.php?t=1409540&goto=newpost

RogerPodacter said:
You can just compile that systemUI apk, no need to do the whole rom.
Read this thread to do the same thing, first post.
http://forum.xda-developers.com/showthread.php?t=1409540&goto=newpost
Click to expand...
Click to collapse
Oh okay. So I do need to sync with the source. But I can just build the SystemUI.apk?

Yes you can. It should be spelled out in that link in the first post.

I canĀ“t find the text in: com.android.systemui.statusbar.policy.NetworkController
Any idea?

Related

[Q] Converting Java code to Smali for 1X Icon Fix

So I think I've found a solution to the 1x icon not displaying issue.
Inside services.jar is classes.dex. I used baksalmi to decompile the file and that way enables me to edit StatusBarPolicy.smali. In that file is
.field private static final sDataNetType_1x:[I = null
and
.field private static final sDataNetType_1xrtt:[I = null
I've searched and found if this was in its original Java format the code to force the 1x symbols would be
private static final int[] sDataNetType_1x = new int[] {
com.android.internal.R.drawable.stat_sys_data_connected_1x,
com.android.internal.R.drawable.stat_sys_data_in_1x,
com.android.internal.R.drawable.stat_sys_data_out_1x,
com.android.internal.R.drawable.stat_sys_data_inandout_1x,
};
My problem is, not being even a novice coder I can't figure out how to convert the code from Java to salmi which I believe would solve the issue and finally let me lay this to rest.
If anyone can help, please let me know.
EDIT: The code is not formatting properly, there is no space between 1 and x or any of the other file locations. It simply links to the drawable-hdpi folder pngs.
We need the same exact file from the samsung moment our should get you close but good luck trying to get java to smali with dex2jar you can achieve the opposite
Sent from my SPH-D700 using Tapatalk

Running Homebrew Native Executables - Status: DONE!!

[2012/06/03] IMPORTANT UPDATE HERE
Hi hackers,
This is meant as a little update on one of the projects I've been working on. I'm kinda stuck now. I have a suspicion of what the problem is. I thought that maybe if I write a post about it, me or someone else will have an idea on how to get this working.
The goal is to run native homebrew executables on WP7
This has not been done yet. All apps are Silverlight apps that are compiled as DLL and run by Taskhost.exe with least privileges. All other executables are signed by Microsoft. Executables that are compiled as ARM executable cannot be started.
The angle is to create a certificate that allows to sign a WP7 executable. Then add that to the appropriate certificate store. Create an executable. Sign it with the private key. Load it onto a WP7 device. Copy it to the Windows folder. Use an OEM driver to launch the executable.
First I did research on the certificate stores. I can now with certainty state that there are 4 certificate stores:
- CA
- Root
- My
- Code Integrity
After a lot of research I finally got complete read/write access to all of these stores. The Code Integrity store contains all the certificates that are used by the Loader Verifier to verify the executable that is being launched. When the device is launched for the first time, the certificates that are in \Windows\ciroots.p7b are installed to that certificate store. These certificates have these properties:
Key Usage = 0x86 = Digital Signature, Certificate Signing, Off-line CRL Signing, CRL Signing
Entended Key Usage = Code Signing (1.3.6.1.5.5.7.3.3) + Unknown key usage (1.3.6.1.4.1.311.10.3.14)
So I used OpenSSL to create such an certificate (with private key) for myself. And I installed the certificate in the Code Integrity store.
I then used VS2008 to create a completely barebone executable (ARMv4 Console app with only Sleep(-1) in the Main). I signed it with SignTool from Microsoft.
I loaded the executable to my device and I copied it to the \Windows folder (I think the policies restrict executing to only from that folder, but I'm not sure about that).
I use the Samsung driver to launch the executable, because I need at least Standard Rights to launch an executable. The Samsung driver has Elevated Rights. My own app has only Least Privileges. Using the Samsung driver does not return any success or fail codes. But looking at the Running Processes list, I don't see my Test.exe running. It should be, because the main thread is put to sleep infinitely.
So why is this not working?
Well, I have a guess. I think it's the policies that bind the certificates in the Code Integrity store to the different accounts/chambers. In the \Windows folder there are a lot of policy xml-files. On fist boot, these are merged into PolicyCommit.xml and then compiled to policydb.vol. When the Loader Verifier (lvmod.dll) loads an executable, it queries the policies to determine access rights and chamber for that executable. The policies that matter in this context are defined in 8314B832-8D03-444f-9A2A-1EF6FADCC3B8.policy.xml. It's an xml-file that basically says this:
Code:
Microsoft Mobile Device Privileged PCA - ced778d7bb4cb41d26c40328cc9c0397926b4eea - not used in this context
Microsoft Mobile Device TCB PCA - 88bcaec267ef8b366c6e6215ac4028e7a1be2deb - honored by System Identity Group
Microsoft Mobile Device Unprivileged PCA - 1c8229f5c8d6e256bdcb427cc5521ec2f8ff011a - honored by Standard Right Identity Group
Microsoft Mobile Device VSD PCA - 91b318116f8897d2860733fdf757b93345373574 - not used in this context
VeriSign Mobile Root Authority for Microsoft - 069dbcca9590d1b5ed7c73de65795348e58d4ae3 - honored by LPC Identity Group
I should find a way to add a policy with my certificate in it. Any ideas?
Ciao,
Heathcliff74
If you are able to re-sign an executable that is already in the ROM, i would try that, so you know the problem isn't within the native code, but only with the signing. Or maybe the other way round which would be awesome.
regards
Flow WP7 said:
If you are able to re-sign an executable that is already in the ROM, i would try that, so you know the problem isn't within the native code, but only with the signing. Or maybe the other way round which would be awesome.
regards
Click to expand...
Click to collapse
That's a good idea. I must say that I don't have much faith in the current RecMod tools for WP7 right now. I am able to get the binaries recmodded so that I can disassemble them correctly. But I don't think they can be easily launched. But there are executables that are on the rom as complete binaries, instead of rom-modules. To begin with, I have to select one that does not need much privileges to run and try to sign that one and then run it.
I'm really busy with work right now, so I think I won't be able to try it until the day after tomorrow. But I will try it and will let know how that went.
Thanks!
Decompiled taskhost.exe, so it gets more easy for us to see if its able to make taskhost to start another exe for us. Lots of code tho (C code).
taskhost.c (276 KB) in attachments.
edit: Oh, WOW, this really shows how to call those anonymous methods without call signature "Hello" (signature: "??z_Hello_?mze")
Hmm, pretty much about the pause part?
Code:
if ( v10 )
{
a7 = sub_178E7(v10);
if ( a7 >= 0 )
{
a7 = sub_180A5(v7, v7 + 64);
if ( a7 >= 0 )
{
a7 = ThemeInitialize(v7 + 136);
if ( a7 >= 0 )
{
v11 = sub_1862B(v13, v7);
EnableHostAutoDehydration(v11 == 3);
v16 = 0;
a7 = InitializeEmClientEx(&a2, 0, &v16);
if ( a7 >= 0 )
{
a7 = RegisterPausedHostCallback(sub_19D0D, 0);
if ( a7 >= 0 )
{
a7 = RegisterResumingHostCallback(sub_19D31, 0);
if ( a7 >= 0 )
{
if ( v11 != 3
|| (a7 = RegisterDehydrateHostCallback(sub_19D76, 0), a7 >= 0)
&& (a7 = RegisterFreezeHostCallback(sub_19D97, 0), a7 >= 0) )
{
a7 = RegisterExitHostCallback(sub_19D55, 0);
if ( a7 >= 0 )
a7 = sub_17C0A(*(_DWORD *)(v7 + 128), 0);
}
}
}
}
}
}
}
}
UIX framework entry-point (exe)
Code:
int __cdecl sub_11114(int a1, int a2, int a3)
{
int v4; // [sp+0h] [bp-38h]@1
char Dst; // [sp+4h] [bp-34h]@1
int v6; // [sp+8h] [bp-30h]@1
int v7; // [sp+Ch] [bp-2Ch]@1
int v8; // [sp+18h] [bp-20h]@1
int v9; // [sp+28h] [bp-10h]@1
v4 = 0;
memset(&Dst, 0, 0x34u);
v8 = a3;
v6 = (int)L"res://FlightModeUXDLL!FlightMode.uix";
v7 = (int)L"FMMain";
v9 = 2;
RunApplication(&v4);
return dword_12034;
}
C++ converted
Code:
UIXApplicationInfo app;
app { ... }
RunApplication(&app);
struct UIXApplicationInfo
{
int UNK_v4 = 0;
char Dst = {0};
char* uixFile;
char* uixEntryPoint;
int UNK_v8;
int UNK_v9 = 2;
}
Then just figure out the UIX part (or test the existing "res://FlightModeUXDLL!FlightMode.uix" if it launches, if so, we made it).
___
Found this in mango dump:
> Uninstall provxml
Code:
<!-- Uninstall Xbox LIVE Extras App -->
<characteristic type="AppInstall">
<nocharacteristic type="{0c17d153-b5d5-df11-a844-00237de2db9e}"/>
</characteristic>
Is there a reason you can't just use COM interop to run native code? Check out this thread for a discussion covering the technique: http://forum.xda-developers.com/showthread.php?t=820455
athompson said:
Is there a reason you can't just use COM interop to run native code? Check out this thread for a discussion covering the technique: http://forum.xda-developers.com/showthread.php?t=820455
Click to expand...
Click to collapse
Hello "co-founder of native code on WP7"
I'm fully aware of the possibility of native code through COM. I use it for example in the WP7 Root Tools. But I just wanted to take it a step further. Running native executables give a lot more freedom. Not being bound to the watchdog, getting higher privileges and running in the background for instance. But there's a whole lot more. So that's why I started research on it. Thanks anyway. You helped making native code possible on WP7.
Ciao,
Heathcliff74
The taskhost.exe is our RAM, because our app run in it, giving us full RAM access inside our "viritual ram". So that means we own all strings, int, floats etc. Then rewrite the ram to change strings in mscorlib. The checksum if an exe has been modified is only checked at startup, without checking if we modify the dll at runtime.
My purpose with this is that some function's call external apps, where we rewrite the args going in to the function. Just find an exploitable function and modify it after JIT has been there one before generating the pre ram, that we modify and call yet again but with the modified ram values behind.
Marshal.Copy, my friends, there.
[SecurityFuckingSafeCritical]
(byte[] source, IntPtr destination, int length)
> Interopservices leaked dll (\windows)
destination = our ram ptr to modify.
fiinix said:
The taskhost.exe is our RAM, because our app run in it, giving us full RAM access inside our "viritual ram". So that means we own all strings, int, floats etc. Then rewrite the ram to change strings in mscorlib. The checksum if an exe has been modified is only checked at startup, without checking if we modify the dll at runtime.
My purpose with this is that some function's call external apps, where we rewrite the args going in to the function. Just find an exploitable function and modify it after JIT has been there one before generating the pre ram, that we modify and call yet again but with the modified ram values behind.
Marshal.Copy, my friends, there.
[SecurityFuckingSafeCritical]
(byte[] source, IntPtr destination, int length)
> Interopservices leaked dll (\windows)
destination = our ram ptr to modify.
Click to expand...
Click to collapse
Hmmm. 10 Points for inventiveness But I don't think it's going to work. Even if you could find a function where the executable is passed as argument you still don't have enough privileges. Most code will have the path to the executable hardcoded instead of an argument. And you will still run under TaskHost with Least Privileges. And you need to have at least Standard Privileges or higher to launch most executables with CreateProcess() or ShellExecuteEx().
Sent from my OMNIA7 using XDA Windows Phone 7 App
Heathcliff74 said:
Hmmm. 10 Points for inventiveness But I don't think it's going to work. Even if you could find a function where the executable is passed as argument you still don't have enough privileges. Most code will have the path to the executable hardcoded instead of an argument. And you will still run under TaskHost with Least Privileges. And you need to have at least Standard Privileges or higher to launch most executables with CreateProcess() or ShellExecuteEx().
Sent from my OMNIA7 using XDA Windows Phone 7 App
Click to expand...
Click to collapse
"And you will still run under TaskHost with Least Privileges"
I know, i dont need standard rights to do it. Because i call a mscorlib function that is trusted code. I think you saw my idea wrong, let me show you.
[mscorlib, SecuritySafeCritical]
public static void example(string str)
{
string mscorlibStr = "you cant change my value ";
Debug.WriteLine(mscorlibStr + str);
}
This is where we modify "mscorlibStr" in ram and the function is still trusted code. But its doing something totally different from that it would do.
fiinix said:
"And you will still run under TaskHost with Least Privileges"
I know, i dont need standard rights to do it. Because i call a mscorlib function that is trusted code. I think you saw my idea wrong, let me show you.
[mscorlib, SecuritySafeCritical]
public static void example(string str)
{
string mscorlibStr = "you cant change my value ";
Debug.WriteLine(mscorlibStr + str);
}
This is where we modify "mscorlibStr" in ram and the function is still trusted code. But its doing something totally different from that it would do.
Click to expand...
Click to collapse
I really hate to break it for you. But the [SecuritySafeCritical] is indeed trusted code, but it will still check your privileges. All the API functions that do system modifications like that, do the security checks. Read the note under SecuritySafeCriticalAttribute here. Also read this; same problem. You are in process TaskHost.exe and it is launched in LPC (Least Privilege Chamber), so every CeImpersonateToken() to do the important stuff will fail and return an error code. I also wouldn't know how you would modify the stack-frame of a function that you call. Seems impossible to me, because at the moment you call the function, that stack-frame has not been allocated yet.
Anyway, although I don't think that is going to work in any way, I absolutely don't want to discourage you, because my experience is that when you try enough, sooner or later you will find an exploit
Ciao,
Heathcliff74
Currently installing "Windows Embeded Compact 7", because this lousy ARMv4 compiler (from WM5-6) maybe generates wrong ARM op-codes (WP7 runs ARMv7), therefore it says "Invalid program signature" (or what error it was).
Maybe ARMv7 is'nt even backwards compatibility with ARMv4.
By compiling with the ARMv7 compiler from WEM7, it will probably (hope) generate a valid exe.
Thats it..
edit:
*Research
"Armv7 is the processor instruction set used starting with the S5L8920 in the iPhone 3GS and in all subsequent devices. Processors that support Armv7 instructions are backward compatible with Armv6 instructions, but attempting to run binaries compiled for Arm7 on older, Armv6 processors will result in the error: "Bad CPU type in executable"."
Source: http://theiphonewiki.com/wiki/index.php?title=Armv7
___
"As I said in the past, the ARMv6 CTR was kept backwards compatible with
> > > earlier versions of the ARM architecture (and ARM tried to keep it like
> > > this as much as possible). With ARMv7, you have multiple levels of cache
> > > and different types (e.g. ASID-tagged VIVT I-cache). There is no way you
> > > could encode the useful information while keeping the same (and only)
> > > register, hence the the need for a new register."
Source: http://www.spinics.net/lists/arm-kernel/msg58813.html
As i see this (^), all ARMv > 6 == no backwards
ARMv6 had backwards to 4
ARMv7 >> ARMv6 compatibility, not more.
_
Problem officer even running ARMv4???
>On a non ARMv4 backwards compatibility CPU.
Profit!!
__
[ExeX.exe] (the one that i recompiled to a state: "this has to work")(ARMv4)
Decompilation:
Code:
; Attributes: bp-based frame
EXPORT start
start
var_20= -0x20
oldR4= -0x1C
oldR5= -0x18
oldR6= -0x14
oldR7= -0x10
oldR11= -0xC
oldSP= -8
oldLR= -4
MOV R12, SP
STMFD SP!, {R4-R7,R11,R12,LR}
ADD R11, SP, #0x1C
SUB SP, SP, #4
MOV R4, R3
MOV R5, R2
MOV R6, R1
MOV R7, R0
.
Next up, decompile a ARMv7 from a raw device. (how, someone has one)
fiinix said:
Next up, decompile a ARMv7 from a raw device. (how, someone has one)
Click to expand...
Click to collapse
I think you'll find what you're looking for here: http://forum.xda-developers.com/showthread.php?t=681659 in the dump of the IMAGEFS. What did you use to decompile it? IDA Pro, or a different thing?
athompson said:
I think you'll find what you're looking for here: http://forum.xda-developers.com/showthread.php?t=681659 in the dump of the IMAGEFS. What did you use to decompile it? IDA Pro, or a different thing?
Click to expand...
Click to collapse
IDA Pro, yes. Ill see if i can dump that "nbh" (used to nb0), and extract a fully operable exe that is not corrupted.
fiinix said:
IDA Pro, yes. Ill see if i can dump that "nbh" (used to nb0), and extract a fully operable exe that is not corrupted.
Click to expand...
Click to collapse
First use Andim's WP7 Rom Tools to extract the rommodules. Remember to always dump a folder, not a single file.
Then use Denomitor's version of Recmod and follow the instructions in the post. That works most of the time.
Going forward
Currently building the WP7 ARMv7 commandline, getting closer.
Current cmd (not working, no need to help):
Code:
"C:\WINCE700\sdk\bin\i386\arm\cl.exe" /Od /D "_DEBUG" /D "_WIN32_WCE=0x700" /D "UNDER_CE" /D "ZUNE_HD" /D "WINCE" /D "DEBUG" /D "_WINDOWS" /D "ARM" /D "_ARM_" /D "_UNICODE" /D "UNICODE" /D "_CRT_SECURE_NO_WARNINGS" /Gm /EHsc /MTd /Gy /fp:fast /GR- /Fo"C:\Users\Steven VM\Desktop\ARMv7\Build\Debug/" /Fd"C:\Users\Steven VM\Desktop\ARMv7\Build\Debug/vc80.pdb" /W3 /c /Zi /TP /QRfpe- /QRarch7 "C:\Users\Steven VM\Desktop\ARMv7\main.cpp"
/QRarch7 is the ARMv7.
edit:
HOORRY SHEEAT
generated:
> main.obj
> vc80.idb
> vc80.pdb
, feels soo good:
main.exe is there.
IDA Pro says "ARM AND THUMB MODE SWITCH INSTRUCTIONS", just like others.
Code:
; Input MD5 : B50E8D8395DE7CA2419464DC3CE0BC74
; File Name : C:\Users\Steven\Desktop\burn\main.exe
; Format : Portable executable for ARMI (PE)
; Imagebase : 10000
; Section 1. (virtual address 00001000)
; Virtual size : 00000018 ( 24.)
; Section size in file : 00000200 ( 512.)
; Offset to raw data for section: 00000400
; Flags 60000020: Text Executable Readable
; Alignment : default
; Processor : ARM
; Target assembler: Generic assembler for ARM
; Byte sex : Little endian
; Segment type: Pure code
AREA .text, CODE, READWRITE, ALIGN=4
; ORG 0x11000
CODE32
EXPORT start
start
var_4= -4
SUB SP, SP, #4
MOV R3, #1
STR R3, [SP,#4+var_4]
LDR R0, [SP,#4+var_4]
ADD SP, SP, #4
BX LR
; End of function start
Made an empty entry point as from above ^:
Code:
int wWinMainCRTStartup()
{
return 1;
}
PE Explorer (main.exe):
Machine: THUMB
Operating System Version: 7.0
Image Version: 7.0
Subsystem Version: 7.0
Subsystem: WinCE GUI
**** so CLOSE!
Successful copied "main.exe" and "ExeX.exe" to "\Windows", where i have the right to launch them remotely.
Method:
WP7Process p = device.LaunchEXE(@"main.exe", "");
main.exe (no signing, ARMv7):
System.UnauthorizedAccessException: Access is denied.
WP7Process p = device.LaunchEXE(@"ExeX.exe", "");
ExeX.exe (signed with CA/ROOT custom, ARMv4):
System.Runtime.InteropServices.COMException (0x800704EC): This program is blocked by group policy. For more information, contact your system administrator.
There IS different things going on! Something is missing, but what
edit:
Signed main.exe with custom XDA ROOT certificate (ARMv7):
signtool.exe sign /sha1 "[CertChomp]" "main.exe"
> Now main.exe also gets "This program is blocked by group policy. For more information, contact your system administrator."
Ill see if i can add it to startup list , if it boot from there.
edit 2:
Nope gonna hijack "fieldtestapp.exe" with my app because policy says:
Risky-mode.Activate();
Backup(fieldtestapp.exe, backupPath);
Copy(main.exe, > fieldtestapp.exe);
"LOADERVERIFIER_ROUTE_BY_NAME"
"LOADERVERIFIER_EXE_AUTHZ_INROM_ROOT"
<Rule Description="Route fieldtestapp.exe" ResourceIri="$(LOADERVERIFIER_ROUTE_BY_NAME)/PRIMARY/WINDOWS/FIELDTESTAPP.EXE" SpeakerAccountId="$(SYSTEM_USER_NAME)" PriorityCategoryId="PRIORITY_LOW">
<Authorize>
<Match AccountId="$(FIELDTESTAPP_EXE_SID)" AuthorizationIds="LV_ACCESS_EXECUTE" />
</Authorize>
</Rule>
<Rule Description="Authorize fieldtestapp.exe be loadable to $(FIELDTESTAPP_EXE_SID) and chambers" ResourceIri="$(LOADERVERIFIER_EXE_AUTHZ_INROM_ROOT)/WINDOWS/FIELDTESTAPP.EXE" SpeakerAccountId="$(SYSTEM_USER_NAME)" PriorityCategoryId="PRIORITY_STANDARD">
<Authorize>
<Match AccountId="$(FIELDTESTAPP_EXE_SID)" AuthorizationIds="LV_ACCESS_EXECUTE,LV_ACCESS_LOAD" />
</Authorize>
</Rule>
edit 3:
Seems like "fieldtestapp.exe" is ROM locked. Need to try out some other targets.
edit 4:
Target acquired "ProximitySensorDisable.exe" > "ProximitySensorDisableBackup.exe"
Successful copy == no ROM lock.
edit 5:
There exists two types of talking to the LoadVerifier (the: This program is blocked by group policy.):
Direct exe name OR special certificate
How we do:
> Direct exe (hijack exe)
How we cant do (SHA1) (Nope, ain't gonna happen):
> We certainly dont have Microsofts certificate so this way is a nodo, haha lol, no do way.
(1: direct exe name) /LOADERVERIFIER/GLOBAL/AUTHORIZATION/PE_AUTHZ/NONE/NONE/PRIMARY/WINDOWS/CFGHOST.EXE
(2: static/pre certificates) /LOADERVERIFIER/GLOBAL/CERTIFICATES/HASH/SHA1/91B318116F8897D2860733FDF757B93345373574
edit 6:
Yep, loads of edits, just for you.
Allowed exe's to run (sorted a-z) (direct exe) (pre cert removed):
Code:
ACCESSIBILITYCPL.EXE
ACCOUNTSMANAGER.EXE
ALARMS.EXE
APPCHECKERSHIM.EXE
APPPREINSTALLER.EXE
AUTODATACONFIG.EXE
AUTOSIM.EXE
AUTOTIMEUPDATE.EXE
BRIGHTNESSCPL.EXE
BTUXCPL.EXE
CALENDARAPP.EXE
CALLSETTINGSHOST.EXE
CALNOT.EXE
CALUPD.EXE
CAM_FW_UPDATE_UI.EXE
CELLUXCPL.EXE
CERTINSTALLER.EXE
CFGHOST.EXE
CFLAUNCHER.EXE
CHDIALERHOST.EXE
CIPHASE2.EXE
CLIENTSHUTDOWN3.EXE
CLOCKNOT.EXE
CMACCEPT3.EXE
COLDINIT.EXE
COMMSVC.EXE
COMPOSITOR.EXE
CONFIGDM.EXE
CONFIGXML.EXE
CONMANCLIENT3.EXE
CONTACTS.EXE
CPROG.EXE
DATETIMECPL.EXE
DCVSSWITCH.EXE
DEPOTCOPY.EXE
DEVICEFEEDBACKCPL.EXE
DEVICEREG.EXE
DIAGPORTCHANGETEST.EXE
DLLHOST.EXE
DMSCHEDULERCALLBACK.EXE
DMSRV.EXE
DMSTOOLS.EXE
DUACLIENT.EXE
DW.EXE
EDM3.EXE
EMAIL.EXE
EMAILSETUP.EXE
ENDPOINT.EXE
FCROUTERCMDTEST.EXE
FIELDTESTAPP.EXE
FLIGHTMODE.EXE
GAMESUX.EXE
IEXPLORE.EXE
INITIATEDMSESSION.EXE
INVALIDLICENSEUXLAUNCHER.EXE
KEYBOARDCPL.EXE
LASSCREDENTIALEXPIRATIONCHECK.EXE
LASSRESTARTER.EXE
LIVETOKEN.EXE
LOCKCPL.EXE
LOOPBACKTEST.EXE
MEDIAGROVEL.EXE
MEUX.EXE
MITSMAN.EXE
MMSPRPROXY.EXE
MMSTRANSHOST.EXE
MULTIMEDIALAUNCHER.EXE
MYPHONECPL.EXE
MYPHONETASKSRUNTIME.EXE
NATIVEINSTALLERHOST.EXE
OFFICEURL.EXE
OMADMCLIENT.EXE
OMADMPRC.EXE
OMHUB.EXE
ONBOOTSQM.EXE
ONENOTEMOBILE.EXE
OOBE.EXE
PACMANINSTALLER.EXE
PHOTOENT.EXE
PHOTOENTCAPTURE.EXE
PHOTOUPLOADER.EXE
PPT.EXE
PWORD.EXE
PWRLOGCTRL.EXE
PXL.EXE
RAPICONFIG.EXE
REGIONCPL.EXE
RMACTIVATE.EXE
SAPISVR.EXE
SECSIMTKIT.EXE
SERVICESD.EXE
SERVICESSTART.EXE
SETTELEPORTMODE.EXE
SETTINGS3.EXE
SHORTMSG.EXE
SICLNT.EXE
SIGNALEVENT.EXE
SIREPSERVERAPPDEV.EXE
SMSETTINGS.EXE
SMSTRANSPORT.EXE
SOUNDCPL.EXE
SPEECHCPL.EXE
SPMC.EXE
SQMEVENT.EXE
SSUPDATE.EXE
TASKHOST.EXE
TELSHELL.EXE
TESTSHOW.EXE
THEMECPL.EXE
TOGGLEBROWSERHIBERNATION.EXE
TOGGLEDOG.EXE
UDEVICE.EXE
UIF.EXE
UNIFIEDPAIR.EXE
USBMGR.EXE
WEBSEARCH.EXE
WIFIUXSPLASH.EXE
WLANEXT.EXE
WLIDSETUP.EXE
WWANDATAMGR.EXE
XDRMREMOTESERV.EXE
ZIPVIEW.EXE
ZMFTASKLAUNCH.EXE
How code (yes i know its super un-optimized, fast put together):
Code:
var doc = XDocument.Load(File.OpenRead("SamsungOmnia7_BasePolicy_webserver.xml"));
var ea = doc.Elements().ToArray()[0].Elements()
.Where(x => x.Name.LocalName == "Rule")
.Where(x => x.Attributes("ResourceIri").Count() > 0)
.Where(x =>
{
var r = x.Attribute("ResourceIri").Value;
return r.Contains("LOADERVERIFIER") && r.ToLower().Contains(".exe") && !r.Contains("CERTIFICATES");
})
.Select(x =>
{
var v = x.Attribute("ResourceIri").Value;
var l = v.LastIndexOf('/');
return v.Substring(l + 1);
})
.Distinct()
.OrderBy(x => x)
.ToArray();
edit 7:
yeah, lol i say too.
Unprotected exe (FCRouterCmdTest.exe)
> c:\Project Work\SGH-i707(Cetus)\FCRouterCmdTest\Windows Mobile 6 Professional SDK (ARMV4I)\Release\FCRouterCmdTest.pdb
mfw samsung use "Windows Mobile 6 Professional SDK (ARMV4I)"
Wow, this truly was a big step today
Done hacking today.
"After a day, there comes another day"
@fiinix,
You did a lot of testing. Good job, man.
A few comments:
0x800704ec "blocked by group policy" is THE error of the new WP7 security model. It is basically telling you to go f*ck yourself. Everything you do without enough privileges or capabilities results in this error.
The two ways of policies, exe-path and cert-hash, is result of difference between rom-modules and executables that are signed and added as a file. Rom-modules are not even normal files. You can't open and read them. They are executable sections that are mapped in rom-address-space. You can only call loadlibrary() and createprocess() on them. Since they are only executable sections, they don't have a signature, like a normal executable file would have. Therefore they are referred to with an exe-path. You may safely assume that every path to an executable in the policy files is referring to a rom-module and can't be overwritten in any way (except by cooking your own rom - who is going to unlock our bootloaders?!?) Other than that, there are a few signing certs that Microsoft has. Signing the different executables with different privileges and accordingly a different cert. Their hashes are in the policies.
Using ARMv7 isn't going to add much I'm afraid. Although it may make a difference in the exe-header. But you've seen tools that were really old, remember And they were signed to have TCB access. And they were compiled for ARMv4. So it should not make much difference.
I did some testing with certificates myself yesterday. Up until Zune totally went bezerk on it. I don't know what happened, but after removing my own cooked certs it all seems normal again. Zune started using 100% cpu on verifying certs and dropping my connection all the time. Help! So I haven't made much progress. I will try again later. Hope it will go better. And I will try to resign an existing executable, as Flow WP7 suggested.
According to policy on my omnia (webserver dumped) there seems to exist two typed of HDD, one ROM hard coded and one that points to internal sd card. It seems that all exe and dll on the sd are not "protected" and therefore can be hijacked.
Seems like ARMv4 will be enough, but to be on the safe side i compile with both, to have more chance getting it work.
Zune, hmm, did not seem to like you, maybe Microsoft DDOS'ed you lol
"Sent from my fingers on my phone", don't expect way too long text
XxXPachaXxX said:
Excuse my ignorance...I'm a noob...This hack may also work on LG devices?
Click to expand...
Click to collapse
At the moment fiinix and I are both working on Samsungs and we use a couple of Samsung-specific exploit to get deeper in the system and getting a better understanding of the system. The ultimate goal is to find exploits that will work for all devices. But we're not at that stage yet. Hacking is research, a lot of trying and being lucky sometimes. Just bear with us
Ciao,
Heathcliff74

[Q] Problem recompiling custom apks?

So I am trying to make some edits to the bools.xml which is located in the values folder which gets recompiled into the resources.arsc file and apkmanager keeps throwing errors regarding public.xml values being declared but not defined (i am using maddogin's rom and want to remove CRT animations). My question is what do I need to do to keep the errors from occurring or how do I hex edit resources.arsc to turn the CRT animations off. I have found the animatescreenlights section in my hex editor but can't figure out what values to change to make the bool "true".
ericwgarza1 said:
So I am trying to make some edits to the bools.xml which is located in the values folder which gets recompiled into the resources.arsc file and apkmanager keeps throwing errors regarding public.xml values being declared but not defined (i am using maddogin's rom and want to remove CRT animations). My question is what do I need to do to keep the errors from occurring or how do I hex edit resources.arsc to turn the CRT animations off. I have found the animatescreenlights section in my hex editor but can't figure out what values to change to make the bool "true".
Click to expand...
Click to collapse
I could be wrong but doesn't it have a setting to turn off Crt animation built into it?
playya said:
I could be wrong but doesn't it have a setting to turn off Crt animation built into it?
Click to expand...
Click to collapse
It does, but it isn't functioning atm. I just want to know how to do this for my personal knowledge.
I know this is old, but wanted to post for future reference.
Don't use a hex editor. Just open in a regular text editor like Notepad.
Line 16 should read:
<bool name="config_animateScreenLights">true</bool>
Just change true to false:
<bool name="config_animateScreenLights">false</bool>

Objection to Tutorials

Great developers all over xda make good guides and awesome mods.but all they do is writing the mod and say copy to bla bla and you are done. This don't create a real developer. I think you should explain the codes to us. If you don't mind some people wanna learn here
True but you should move the thread to the General section.
Deleted
The thread is in its right place....
ya GUIDE Codes shoul be explaind
I know java well, but most of Guides are on Smali language, I don't like copy paste cause I wanna learn it right, So what's the problem in explaining mods
@Jonny pls move this to general section, thanks
If you want to know what smali functions do then download Virtuous Ten Studio by Diamondback and the rest of the Virtuous team then look in the included smali help section.
Jonny said:
If you want to know what smali functions do then download Virtuous Ten Studio by Diamondback and the rest of the Virtuous team then look in the included smali help section.
Click to expand...
Click to collapse
I don't mean the smali basics, I meant explaining mods in depth instead of this Copy-Paste, I will check VTS asap, thanks for suggestion
mohamedrashad said:
I don't mean the smali basics, I meant explaining mods in depth instead of this Copy-Paste, I will check VTS asap, thanks for suggestion
Click to expand...
Click to collapse
With smali you are basically just moving numbers around and calling other methods (invoke and invoke-virtual) - usually you store the result in a register for example v0. Then you've got you're comparison statements like if-ne (if not equal), if-eq (if equal), if-nez (if not equal to zero) etc. Then you can also call resources by using the hex values in public.xml, eg const v4, "0x070000" for example.
Once you know the basic functions and principals of the language then its fairly easy to follow the code of the mods to find out what they're doing and what they're changing.
Jonny said:
With smali you are basically just moving numbers around and calling other methods (invoke and invoke-virtual) - usually you store the result in a register for example v0. Then you've got you're comparison statements like if-ne (if not equal), if-eq (if equal), if-nez (if not equal to zero) etc. Then you can also call resources by using the hex values in public.xml, eg const v4, "0x070000" for example.
Once you know the basic functions and principals of the language then its fairly easy to follow the code of the mods to find out what they're doing and what they're changing.
Click to expand...
Click to collapse
Simpler than Java I should learn it soon
mohamedrashad said:
Simpler than Java I should learn it soon
Click to expand...
Click to collapse
Ha! I wish, to do for example the following in java
Code:
Integer i = 1;
if (i = 0) {
return "wtf is happening!";
} else {
return "everything is normal";
}
in smali would be something like:
Code:
const v1, 0x1
const-string v2, "wtf is happening"
const-string v3, "everything is normal"
if-eqz v1 :cond_0
return v3
:cond_0
return v2
My syntax is probably not correct but this was just something wrote off the top of my head so... :highfive: Point is what you can do relatively easily in java with a couple of lines of code can be a pain in the neck and take up a lot of lines to do in smali - especially with more complex functions.
For example I'd hate to have to try and do something like this in smali (code snippet from an app I've made for my school).
Code:
class LoadNews extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
mProgress = new ProgressDialog(getSherlockActivity());
mProgress.setMessage("Loading news, Please wait...");
mProgress.setIndeterminate(false);
mProgress.setCancelable(true);
mProgress.show();
}
protected String doInBackground(String... args) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
JSONObject json = jParser.makeHttpRequest(AllNewsItemsURL, "GET", params);
try {
int success = json.getInt(TAG_SUCCESS);
if (success == 1) {
newsItems = json.getJSONArray(NEWS);
for (int i = 0; i < newsItems.length(); i++) {
JSONObject obj = newsItems.getJSONObject(i);
Integer id = i + 1;
String title = obj.getString(TITLE);
String story = obj.getString(STORY);
String imageSrc = IMAGE_DIR_URL + obj.getString(IMAGE_SRC);
String date = obj.getString(DATE);
story = replace(story, imageSrc);
date = buildDate(date);
if (id > dbhandler.getNewsCount()) {
dbhandler.addNews(new News(id, title, story, imageSrc, date));
} else {
dbhandler.updateNews(new News(id, title, story, imageSrc, date));
}
if (isCancelled() || FlagCancelled) break;
}
} else {
Log.e("JSON Response", "success == 0");
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(String file_url) {
mProgress.dismiss();
getSherlockActivity().runOnUiThread(new Runnable() {
public void run() {
getNewsList();
}
});
}
}
Jonny said:
Ha! I wish, to do for example the following in java
Code:
Integer i = 1;
if (i = 0) {
return "wtf is happening!";
} else {
return "everything is normal";
}
in smali would be something like:
Code:
const v1, 0x1
const-string v2, "wtf is happening"
const-string v3, "everything is normal"
if-eqz v1 :cond_0
return v3
:cond_0
return v2
My syntax is probably not correct but this was just something wrote off the top of my head so... :highfive: Point is what you can do relatively easily in java with a couple of lines of code can be a pain in the neck and take up a lot of lines to do in smali - especially with more complex functions.
For example I'd hate to have to try and do something like this in smali (code snippet from an app I've made for my school).
Code:
class LoadNews extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
mProgress = new ProgressDialog(getSherlockActivity());
mProgress.setMessage("Loading news, Please wait...");
mProgress.setIndeterminate(false);
mProgress.setCancelable(true);
mProgress.show();
}
protected String doInBackground(String... args) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
JSONObject json = jParser.makeHttpRequest(AllNewsItemsURL, "GET", params);
try {
int success = json.getInt(TAG_SUCCESS);
if (success == 1) {
newsItems = json.getJSONArray(NEWS);
for (int i = 0; i < newsItems.length(); i++) {
JSONObject obj = newsItems.getJSONObject(i);
Integer id = i + 1;
String title = obj.getString(TITLE);
String story = obj.getString(STORY);
String imageSrc = IMAGE_DIR_URL + obj.getString(IMAGE_SRC);
String date = obj.getString(DATE);
story = replace(story, imageSrc);
date = buildDate(date);
if (id > dbhandler.getNewsCount()) {
dbhandler.addNews(new News(id, title, story, imageSrc, date));
} else {
dbhandler.updateNews(new News(id, title, story, imageSrc, date));
}
if (isCancelled() || FlagCancelled) break;
}
} else {
Log.e("JSON Response", "success == 0");
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(String file_url) {
mProgress.dismiss();
getSherlockActivity().runOnUiThread(new Runnable() {
public void run() {
getNewsList();
}
});
}
}
Click to expand...
Click to collapse
i'm just wondering why apk tool don't give us Java code The development would be easier
mohamedrashad said:
i'm just wondering why apk tool don't give us Java code The development would be easier
Click to expand...
Click to collapse
That's to do with the Dalvik VM android apps run on. If you compiled standard java files (.java) for a standard java applet then those files would be compiled into .class files (which can be "reverse engineered" - though not particularly well and all reverse engineer software available for java currently should be used for guidance only as the code they output is nowhere near the original.
For android apps, these .class files are further compiled into a dalvik executable file with extension .dex - in an apk file this is called classes.dex. You can think of a classes.dex file as a compiled .exe file - you can't easily get readable/correct source of it. Exe files are therefore reverse engineered into their byte-code which is in a low-level language called Assembly Language (ASM).
Dalvik executables work in much the same way that they can be decompiled to their byte-code, which allows them to be edited without having the full source - unlike using a java decompiler, they give correct code for the language they are written in. The dalvik byte-code is the smali language so you can think of smali as the dalvik equivalent of ASM.
In short term, smali is editable and can be recompiled and run with no problems whereas code produced by current java decompilers cannot be used to make changes and then recompiled due to incorrect code given, so in this instance it was better for apktool to give a smali output :good:
mohamedrashad said:
i'm just wondering why apk tool don't give us Java code The development would be easier
Click to expand...
Click to collapse
@Jonny
Have a look at this tool I found - maybe useful maybe not
http://forum.xda-developers.com/showthread.php?p=52853769
marcussmith2626 said:
@Jonny
Have a look at this tool I found - maybe useful maybe not
http://forum.xda-developers.com/showthread.php?p=52853769
Click to expand...
Click to collapse
That doesn't seem too bad considering the likes of JAD and JD-GUI, however, I can still 100% guarantee that if you put that into Android Studio (or Eclipse but I prefer AS), it would not compile
Best to use decompiled java as a guideline or to search for methods you want to make mods out of - eg increasing the maximum number of pages in the HTC Sense 6.0 launcher (Prism.apk) you search for the method getMaxPageCount() in the decompiled java code, have a look at what the java was like then find out where to change the values and then do the actual mod in smali.
marcussmith2626 said:
@Jonny
Have a look at this tool I found - maybe useful maybe not
http://forum.xda-developers.com/showthread.php?p=52853769
Click to expand...
Click to collapse
These apps (java decompiler) are good to learn some tricks in apps but non give a ready-to-import Eclipse project which make them 75% useless
mohamedrashad said:
These apps (java decompiler) are good to learn some tricks in apps but non give a ready-to-import Eclipse project which make them 75% useless
Click to expand...
Click to collapse
I dont have any experience of programming so I dont know the use of these things but I spose Its interesting to compare
My main expertise is end user software/hardware support and repair for pcs/laptops - I just look at android as a hobby for fun as something different
marcussmith2626 said:
I dont have any experience of programming so I dont know the use of these things but I spose Its interesting to compare
My main expertise is end user software/hardware support and repair for pcs/laptops - I just look at android as a hobby for fun as something different
Click to expand...
Click to collapse
You should learn programming, for pc or android, you are missing a lot of fun here

Replacing Facebook Messenger resources

I am trying to change the emojies inside of Facebook Messenger by the ones from EmojiOne.
In the first place, I decompiled through dex2jar the messenger APK and did quite a bit of search but no luck, it is obfuscated and pretty hard to read.
So my second guess was to replace each emoji in the resources. To do that, I used aapt to get one and try it:
HTML:
> aapt dump resources msg.apk | grep 1f60f
resource 0x7f020eca com.facebook.orca:drawable/messenger_emoji_1f60f_32: t=0x03 d=0x000017b3 (s=0x0008 r=0x00)
resource 0x7f020ecb com.facebook.orca:drawable/messenger_emoji_1f60f_64: t=0x03 d=0x000017b2 (s=0x0008 r=0x00)
resource 0x7f0c2086 com.facebook.orca:string/emoji_1f60f: t=0x03 d=0x00003439 (s=0x0008 r=0x00)
I tried this :
HTML:
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("com.facebook.orca"))
return;
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
resparam.res.setReplacement("com.facebook.orca", "drawable", "messenger_emoji_1f60f_32", modRes.fwd(R.drawable.emojione_emoji_1f60f_32));
resparam.res.setReplacement("com.facebook.orca", "drawable", "messenger_emoji_1f60f_64", modRes.fwd(R.drawable.emojione_emoji_1f60f_64));
}
and quite a few other things, but nothing seems to work. My drawable is working since I tried it in an Activity.
Even though I can get this working, would this be a proper solution to my original problem ?
Will I need to replace EACH emoji one by one in the two sizes ?
Thanks in advance
Bump please, no one?
Up for this thanks
This doesn't solve your problem, but I recently decompiled a proguarded apk too, and couldn't find the right resources easily. I found a method too do so though.
First, install xinstaller, then under misc enable debugging apps (allows debugging any app).
Next, connect your phone, make sure adb is on and connected, open Facebook and go to a conversation. Send some emoji too.
In Android studio, go into Android device monitor (ddms), tools -> Android -> Android device monitor. MAKE SURE YOU SET DDMS UP first
Now, find the button in the toolbar that says something like ui automator dump . This will take a layout dump of your displayed screen and give you a screenshot that you can use to click on various layout objects. You will be able to select the emoji and see what resource id is associated with it.
Or at least, it will give you a method to start looking for the resource id's. Combined with a tool like grep for windows, checking out public.xml for the ID's (they're in hex, but if you want to search in code for the ID, convert it to decimal). And you can pretty much find where the code and resource ID's are now !

Categories

Resources