1

I am trying to edit the contact and dialer to have the option to display the nickname field instead of the first or last name. Currently in the contacts app, if you goto "menu>display options>view contact name as" the only options available are to select first name or last name. I have decomplied the apk and searched through all of its resources (maybe not well enough) and have not been able to find where this option is located. I know that this is a feature that personally and MANY others have longed for and requested. Shouldnt be hard to impliment this, but I just cant find where to add/modify code.

Any ideas?

Alex
  • 11
  • 2
  • 1
    I wouldn't decompile an APK where source code is available. Find the source code and look through that. The comments, variable names etc. will be intact and there should be documentation too – HXCaine May 09 '11 at 20:56
  • @HXCain I'm assuming he wants to mod some particular firmware. Usually those do not have the code available and the variables may differ from stock apps. In any case, yes, browsing the source code first is the way to go. – Aleadam May 09 '11 at 21:12

1 Answers1

0

Modding apks is basically hunting hex IDs:

Search in the strings.xml for the string or string array containing the text for "First Name first" and "Last Name first". Find the name for that string or array and search into public.xml for those IDs. Use these numbers to search into the smali files where is an array using those hex IDs.

  1. Add a new entry into the array string
  2. compile and decompile again to create new IDs taking into account your new string.
  3. Modify the smali file you found using the same ID accordingly.

Tip: if the id starts with a 0, then use only the last seven digits for searching the smalis. apktool strips those zeroes.

Hint: look for display_options_view_given_name_first

Browsing the open source code may help quite a bit :)

https://android.googlesource.com/platform/packages/apps/Contacts

Think of a smali file as a translated java code. To begin learning modding smali files, see my answers here:

and here:

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Aleadam
  • 40,203
  • 9
  • 86
  • 108
  • Thanks Aleadam. This was helpful. I still am having some trouble understanding though. I have found those strings in the strings.xml as well as the hex IDs in both the smali file and public.xml. I do not know where to go from there. I have tried adding the strings for nickname in the strings.xml. Should it automatically generate the corrisponding IDs in public.xml and the smali file? Thanks for your help! – Alex May 17 '11 at 15:00
  • @Alex modding smalis is not easy task. The ID in the public.xml will be generated, but no smali code. You need to add that yourself. I added a few links to the answer. – Aleadam May 17 '11 at 15:15