[Galaxy Tab 10.1 Android Development] Hooolm:
Teaching has never been my strong feat but sure, I'll give it a shot.

Please note:

The "Setup to build" part is for Windows, recreated from memory, and may be inaccurate. I love you guys but I'm not gonna wipe my system and start over just to retrace my steps ;)

For the entire guide, I'm pre-supposing basic computer skills, a rudimentary understanding of ADB, folder structures, file management, text editing and "what do you mean command line??!" :)

== Set up to build:

If you don't have Java installed, download and install Java from java.com

Download apkmanager 4.9 honeycomb edition and remember to thank the guy.

Place it in a folder in C:\ so you have a directory stucture like this:

C:\apkmanager49hc

C:\apkmanager49hc\other

C:\apkmanager49hc\place-apk-here-for-modding

...etc

C:\apkmanager49hc is the home dir for our purposes, so from now on assume we're in C:\apkmanager49hc unless I say otherwise.

Run Script.bat

Select 24 "Exit"

(this should create any dirs and logfiles that may be missing)

== Get the required files and prepare for editing

Pull the following .APKs from your phone via ADB or extract them from your ROM.zip to /place-apk-here-for-modding in our homedir. You should make a backup of at least Browser.apk, just in case.

/system/app/Browser.apk

/system/framework/framework-res.apk

/system/framework/twframework-res.apk

Run the following commands from a command prompt in our home dir:

java -jar other/apktool.jar if place-apk-here-for-modding/framework-res.apk

java -jar other/apktool.jar if place-apk-here-for-modding/twframework-res.apk

The command line will return:

I: Framework installed to: C:\Users\((username))\apktool\framework\1.apk

I: Framework installed to: C:\Users\((username))\apktool\framework\2.apk

== Decompile and edit

Run Script.bat

(this will open the apkmanager window)

Enter 19 "Select compression level for apk's"

Enter 0 (compression=0)

Enter 22 "Set current project"

Select the number for "Browser.apk"

Select 9 "Decompile apk"

It'll say "Decompiling apk" and hang for a while.

Open a file explorer/total commander/whatever on your computer, and go to /projects in our home dir. You'll see that we now have the decompiled Browser.apk in there.

Go to /projects/Browser.apk/res/xml/ and open general_preferences.xml with a text editor. Notepad, Notepad++, Ultraedit or something, not Word ;)

Add the purple code, so the content looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="Indigo"][I][B]<ListPreference android:entries="@array/pref_development_ua_choices" android:title="@string/pref_development_uastring" android:key="user_agent" android:defaultValue="0" android:entryValues="@array/pref_development_ua_values" />[/B][/I][/COLOR]
<com.android.browser.BrowserHomepagePreference android:hint="@string/http" android:maxLength="8192" android:title="@string/pref_content_homepage" android:key="homepage" android:inputType="textMultiLine|textUri" />
<PreferenceCategory android:title="@string/pref_general_sync_title">
<Preference android:title="@string/pref_personal_sync_with_chrome" android:key="sync_with_chrome" android:summary="@string/pref_personal_sync_with_chrome_summary" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_general_autofill_title">
<CheckBoxPreference android:title="@string/pref_autofill_enabled" android:key="autofill_enabled" android:summary="@string/pref_autofill_enabled_summary" android:defaultValue="true" />
<PreferenceScreen android:title="@string/pref_autofill_profile_editor" android:key="autofill_profile" android:summary="@string/pref_autofill_profile_editor_summary" android:fragment="com.android.browser.AutoFillSettingsFragment" />
</PreferenceCategory>
</PreferenceScreen>

The purple code shows the UAstring item in General Preferences just above the "Set homepage" item.

== Compile

Go back to the apkmanager window.

Select 11 "Compile apk"

It'll output "Building Apk" and think about it for a while.

Apkmanager will ask, "Is this a system Apk?"

"y" - yes it is.

Then it will ask, "Aside from the signatures, would you like to copy over any additional files that you didn't modify from the original apk in order to ensure least # of errors?"

"y" - yes, you want to do that.

apkmanager will extract those original files and then present you with this screen:

Read that, then I'll explain it :)

Right. At this point apkmanager has made a copy of the original, compiled Browser.apk files in C:\apkmanager49hc\keep

As the name "keep" suggests, whatever is in here will be kept and carried on to your new build, so:

For every file that you have changed in /projects/Browser.apk/, you need to delete the counterpart in /keep/.

That way, apkmanager knows to keep your unchanged files unchanged but grab your changed file(s) from /projects/Browser.apk. It may seem like dumb way of doing it but it makes sense that you don't want your computer to compile more than it has to. Compiling takes time and CPU, and...well...the less is done, the less can go wrong.

In this case you edited /projects/Browser.apk/res/xml/general_preferences.xml

So you have to delete /keep/res/xml/general_preferences.xml

AND you have to delete /keep/resources.arsc as well!

Whenever you have changed any XML in an .apk, you also have to delete /keep/resources.arsc when compiling. The apk's resource table is compiled into resources.arsc, so if you dont delete it from keep/, you're gonna keep that and carry it over into your new, modified Browser.apk, and your changes won't come through :)

Ok, after deleting those two files, you "Press any key to continue ...", all the resources are compressed, and now you have a modified Browser.apk in place-apk-here-for-modding/

Wrap it in a flashable zip and flash it.

("How" is outside the scope of this guide)

As it turns out, this is actually a rather general guide on decompiling, editing and recompiling stuff for honeycomb. You can use the exact same method to edit other apks like, framework-res.apk and SystemUI.apk.

Let me know what you think of this guide. If it's good, I'll bump it to the O.P.