[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Fixing failed deodexes and debloating

If you were lucky, the firmware fully deodexed properly. However, often, it won't. For example, as covered in the previous post, with XWKL1, three files won't deodex. We will go through the process of manually dealing with these files in this post.

First, take the ZIP you obtained from the previous step, and unzip it to its own working directory somewhere. I will refer to it from now on as $FIRMWARE_ROOT .

You will find three APKs with .odex files in the following location for XWKL1:

$FIRMWARE_ROOT/system/app

Remove all three APKs and associated .odex files - these files are not useful to us. We now have to deal with the removed files.

Phonesky.odex

When I first saw this, I thought "WTF? I've never seen that before." - Time to Google it. It turns out that at some point, Google renamed the Market APK. It used to be Vending.apk, now it's Phonesky.apk - if we don't do something about this, the firmware will have no Market! So it must be fixed.

The good news is - The Market gets auto-updated frequently. As a result, we can obtain a replacement, AND that replacement is likely to be newer! What we need here is a device that is already running with a functioning Market.

Connect to your phone with ADB, and start navigating through directories. Downloaded apps are in the following location:

/data/app

Look for a Market APK there. (I need to take a few minutes to nandroid back to a different firmware - as mine currently has the latest market in /system, I don't have one in /data/app to pull.) OK, I'm on my UCKK6 Nandroid now, so, the Market is at the following location for me:

/data/app/com.android.vending-1.apk

Let's pull that into the right location in our firmware:

cd $FIRMWARE_ROOT/system/app
adb pull /data/app/com.android.vending-1.apk Phonesky.apk

OK, we've fixed the Market AND integrated the latest update!

Next up, VoiceSearch.apk:

While it is less critical than the Market, most users won't like a firmware without Google Voice Search. As this never gets auto updated and is not Market-downloadable, it's harder to find a working copy. Try deodexing other firmware bases (such as XXKI3) to get this file, or pull it from a firmware that has it properly deodexed. I grabbed mine from VillainROM 3.0 (Thanks Pulser!) initially, I'm going to try a different candidate before posting up my firmware this time around. This time, I'm gonna grab it from XWLA4. (Yes, after I finish with this guide based on XWKL1, I will be moving to XWLA4 to play with it. Also, yes - this file does deodex properly on LA4.)

Last, Maps.apk:

This is downloadable from the Market, so the safest thing to do is just remove it. However, you can use the same trick as with Phonesky.apk to grab the latest and greatest from an updated running system.

cd $FIRMWARE_ROOT/system/app
adb pull /data/app/com.google.android.apps.maps-1.apk Maps.apk

Note: If you outright remove Maps, you should also remove Street.apk - however if you are replacing Maps, you can leave Street.apk - it is often not in /data/app since it's updated far less frequently.

Removing Bloat:

Next, let's remove bloat. pulser_g2 has a great reference for what is safe to remove from I9100 firmwares at http://xdaforums.com/showthread.php?t=1069924

First, disable OTA updates by removing:

rm wssyncmlnps.apk
rm syncmldm.apk
rm syncmlds.apk
rm fotaclient.apk

FM Radio is NFG on the I777, so kill it:

rm FmRadio.apk

SNS (Samsung's own social media integration) is a battery hog. Kill it, remove it all:

rm Sns*
rm SevenEngine.apk

Nuke the Hubs:

rm GameHub.apk MusicHub_10.apk ReadersHub.apk SocialHub.apk

Per ryude's post at http://xdaforums.com/showpost.php?p=22719913&postcount=22, you can also:

rm $FIRMWARE_ROOT/system/lib/libnggame.so

Nuke the extra clocks - plenty of good ones on the Market:

rm DualClock.apk AnalogClock.apk DigitalClock.apk

Nuke Samsung's annoying panning tutorial:

rm PanningTryActually.apk

Nuke some other apps I never use, including all Samsung apps and widgets:

rm Kobo.apk Zinio.apk BuddiesNow.apk GenieWidget.apk PressReader.apk Samsung*

Live wallpapers are evil device-slowing battery eaters:

rm LiveWallpapers*
rm Microbesgl.apk

Some weird wifi file transfer stuff that is useless and starts a background service:

rm FTM.apk FTS.apk

Flashplayer can be installed from the Market:

rm install_flash_player.apk

Swype is 28 ****ing megabytes, I don't use it, and as I understand it, it sometimes conflicts with trying to update to newer versions. I was going to leave this in until I saw its size:

rm Swype.apk
rm $FIRMWARE_ROOT/system/lib/libSwypeCore.so

Some people will remove some of the DRM stuff such as SisoDrmProvider.apk - however the last time I tried to debloat DRM, I had some issues with even non-DRM videos. (Video player would hang on exit.)

At this point, we've fixed all of our failed deodexes and debloated. Now that we've digested that high-fiber kitchen product a bit, we can plop out our first flashable firmware image.

cd $FIRMWARE_ROOT
zip -r -9 ../PowerDump_XWKL1.zip *

This ZIP is actually flashable - if you wipe, flash this, then flash Hellraiser, you should have a working firmware. (going to test this now...) Note that with Hellraiser 0.3.1, you'll need to update to a newer Daily Driver (1/30/2012 or later) to get working Bluetooth HID. I'm going to put up 0.4.0 with DD 2/15-C later today. Note: If you want to flash one of JKay's themes, you must boot the firmware without the theme/mod at least once before flashing JKay. You may also want to flash one of ChainsDD's superuser packages - the firmware is not yet rooted.

Tested and uploaded - at this point in the process, this PowerDump will be your result - http://dev-host.org/I6C

Remember, it'll be a little rough, since you were digesting a high-fiber source and your system probably wasn't used to it, but it's still a good PowerDump.