[Guide]How I tweak, mod and hack my Defy

Search This thread

zyxwvut

Senior Member
Jun 4, 2008
294
111
I just expanded this z4root.apk file before installing it and I'm curious to know why it contains res/raw/rageagainstthecage in it's contents. Has is been messed with?
It looks like a virus to me - especially after I ran it, I found 100's of the above executables running and I've had to reset my phone to factory. Can someone explain?

Rageagainstthecage is an exploit used to gain root access so that it can install the su binary and superuser.apk and busybox. I'm pretty sure though that rageagainstthecage will only work on older defy's as Motorola squashed this exploit on newer ones. Thats why z4root wont work on newer defys. I could be wrong though about them squashing the exploit, I just know z4root wont work on newer defuse and I assume this is the reason. I use superoneclick 1.6.5 with the psneuter exploit. Or just use gingerbreak

Sent from my MB525 using XDA App
 

maccboy2010

Senior Member
Oct 27, 2011
338
24
Samsung Galaxy S21 Ultra
Keewan that's what I mean it would be great for a guide on how to use it, someone said change the build prop to Samsung s. :)

sent from my cyanogen mod 2.3.7 defy running at 1ghz and I absolutely love it :)
 

juadagu

Member
Oct 11, 2010
15
0
Excellent Job on this post!! I read it several times and, after the third time I think, got enough information to tweak my Defy. The versionning of Motorola's roms really got me confused for a little while.

I just want to point out a little error on step 7: (So you can correct it)

7) Overclocking time!
Install Milestone Overclock from the market and fire it up. Load the module and Press the menu button, go to settings and enter "1000000" as Custom rate and "54" as custom vsel. After pressing OK, pull the slider all the way to the right, so the selected frequency shows up as "1000MHz, 52vsel (Custom)". Click Apply and tick the box for "Autoload on boot"

The vsel value doesn't match on the instructions. The slider should show 54vsel as it was the value set on the settings.

I'll use my phone for a while and let you know how it works with the overclocking. (edit) I just ran the Quadrant test... and WOW I'm impressed! unfortunately I didn't run a baseline but the score after all the hacking was: 1735

Take care,

Juan.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    This thread is mostly to remind myself what needs to be done after a reflash. I reflash a lot. Tinkering, coding and hacking does *not* mate well with my ADHD (Attention Deficit ahh whatever), so I often find myself having to, pardon my french, unfuck my gear. Most of this thread will be links to the great work others have done, I'm just piling together the stuff I use. If you like your android experience to be nice and snappy, you might like these mods too. These steps work for me, your mileage may vary. If you screw something up, it's your own fault for taking advice from strangers over the Internet. But try asking for help here on XDA, somebody will most likely be able to help you.

    So, either you've just unpacked your Defy or you have just had to flash an SBF after screwing something up.

    Edit: 01/01/2011: Have added a few bits so the stuff below now applies to the 2.34.1 rom as well :)

    0) Install LauncherPro
    - Or ADW.Launcher, HELauncher or whatever you prefer. Press the Home button and set the new launcher as default.

    1) Root the damn thing! Download Z4Root.apk here. You'll need to allow installation of non-market apps, as well as enabling USB debugging. Go to Settings -> Applications, tick the box for "Unknown sources" and go to Development to enable USB debugging. A file manager should be included in the stock rom, otherwise get one (I prefer ES File Explorer) from the Market. Once you have your file manager, dig up the z4root.apk you just downloaded, install it and run the app, press the appropriate button to root the phone and watch it reboot.

    2) Get recovery!
    The custom recovery for the Defy is described here. Mad props to Tenfar for his work, please buy him a beer, he's earned it. Here's the APK you'll need. Using the same process as for the Z4Root app, install and run the recovery system app. Press the "Install recovery system" button.

    3) Get JIT'tery and deodexed :cool:
    Superb work by Higgsy and Antibyte! They've not only gotten JIT (jfgi, mate) to run on the Defy, they've zipped it up nicely with the deodexed /system files from Paul at Modaco.com so you can all just install them as a zip file in one go. 2.21 Roms: Download the nicely packaged zip here, if you're running the 2.34.1 rom, get this version instead. Save the file to your SD card and remember where you put it.

    4) Backup everything we've done so far
    Start the System Recovery App and do a Recovery Boot. When booting into recovery, select Backup/restore and do a backup. I you have installed a bunch of apps, made a lot of changes to your settins, you might want to do a seperate backup of that (but not the rom), using Titanium backup from the Market.

    5) Apply the coolness from step 3
    After doing a backup, wipe all user settings as well as the Dalvik cache. Then select "Install zip from SD card" and install the zip you downloaded in step 3. Wipe alle settings and the cache again. Reboot when done. Note: The wiping may not be necessary, but not doing it could screw something up and have you back at re-flashing an SBF to your phone...

    5.1) Re-root, using Z4Root.
    Fire up the app and press "permanent root".

    6) Weed out the bloat
    This bit assumes that you have ADB or MotoDev studio installed and can connect to your Defy. If not? Search the forums. - Or read the US guide for trimming the Defy, tons of info right there, thanks a lot to Rob-T for elaborating many of the steps!

    Assuming you have ADB fired up (or MotoDev Studio, which I prefer):

    Gain root access:
    Code:
    su

    Mount the /system partition with write access:
    Code:
    mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system

    Switch to the /system/app dir:
    Code:
    cd /system/app

    Now rename the apps you don't want: Thanks to NaeNee for proof-reading this hideous blob of commands!
    Code:
    mv AdService.apk AdService.rem; mv ArcPhotoworkshop.apk ArcPhotoworkshop.rem; mv ArcVideoEditorLite.apk  ArcVideoEditorLite.rem; mv BlurEmail.apk Bluremail.rem; mv revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.apk revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.rem; mv BlurSNMessagingEngine.apk BlurSNMessagingEngine.rem; mv FBAndroid-1.3.2.apk FBAndroid-1.3.2.rem; mv Kindle-1.0.2-OEM-SingleSign.apk Kindle-1.0.2-OEM-SingleSign.rem; mv MySpace.apk MySpace.rem; mv StickyNoteWidget.apk StickyNoteWidget.rem; mv SocialMessaging.apk SocialMessaging.rem; mv Swype.apk Swype.rem; mv BlurUpdater.apk BlurUpdater.rem; mv CarDock.apk CarDock.rem; mv ContactsUnconnected.apk ContactsUnconnected.rem; mv amazonmp3_1.8.19_signed_zipaligned.apk amazonmp3_1.8.19_signed_zipaligned.rem; mv esmusica_2_0_0012_embed_Signed_2010-04-13_11-05-17.apk esmusica_2_0_0012_embed_Signed_2010-04-13_11-05-17.rem; mv Fota.apk Fota.rem; mv FriendFeed.apk FriendFeed.rem; mv HelpCenter.apk HelpCenter.rem; mv hiphopofficial_2_0_0012_embed_Signed_2010-04-13_11-08-31.apk hiphopofficial_2_0_0012_embed_Signed_2010-04-13_11-08-31.rem; mv truecountry_2_0_0012_embed_Signed_2010-04-13_11-06-12.apk truecountry_2_0_0012_embed_Signed_2010-04-13_11-06-12.rem; mv KPT.apk KPT.rem; mv HomeSyncWizard.apk HomeSyncWizard.rem; mv LiveWallpapers.apk LiveWallpapers.rem; mv LiveWallpapersPicker.apk LiveWallpapersPicker.rem; mv MagicSmokeWallpapers.apk MagicSmokeWallpapers.rem; mv MessagesWidget.apk MessagesWidget.rem; mv NewsWidget.apk NewsWidget.rem; mv Protips.apk Protips.rem; mv QuickContactWidget.apk QuickContactWidget.rem; mv Quickoffice_BasicViewer_2.0.42.apk Quickoffice_BasicViewer_2.0.42.rem; mv Quickoffice_BasicViewer_2.0.52.apk Quickoffice_BasicViewer_2.0.52.rem; mv revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.apk revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.rem; mv SocialMessaging.apk SocialMessaging.rem; mv StatusWidget.apk StatusWidget.rem; mv Stk.apk Stk.rem; mv ToggleWidgets.apk ToggleWidgets.rem; mv VisualizationWallpapers.apk VisualizationWallpapers.rem; mv UniversalInbox.apk UniversalInbox.rem; mv WeatherWidget.apk WeatherWidget.rem; mv WorkContacts.apk WorkContacts.rem

    EDIT: NaeNee experienced a problem with the messaging app just closing (no FC or errors) after this... Update: This is caused by deleting or renaming BlurEmailEngine.apk, so it is no longer removed/renamed in the command above.

    In case you want to undo the above rename:
    Code:
    mv AdService.rem AdService.apk; mv ArcPhotoworkshop.rem ArcPhotoworkshop.apk; mv ArcVideoEditorLite.rem  ArcVideoEditorLite.apk; mv BlurEmail.rem Bluremail.apk; mv revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.rem revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.apk; mv BlurSNMessagingEngine.rem BlurSNMessagingEngine.apk; mv FBAndroid-1.3.2.rem FBAndroid-1.3.2.apk; mv Kindle-1.0.2-OEM-SingleSign.rem Kindle-1.0.2-OEM-SingleSign.apk; mv MySpace.rem MySpace.apk; mv StickyNoteWidget.rem StickyNoteWidget.apk; mv SocialMessaging.rem SocialMessaging.apk; mv Swype.rem Swype.apk; mv BlurUpdater.rem BlurUpdater.apk; mv CarDock.rem CarDock.apk; mv ContactsUnconnected.rem ContactsUnconnected.apk; mv amazonmp3_1.8.19_signed_zipaligned.rem amazonmp3_1.8.19_signed_zipaligned.apk; mv esmusica_2_0_0012_embed_Signed_2010-04-13_11-05-17.rem esmusica_2_0_0012_embed_Signed_2010-04-13_11-05-17.apk; mv Fota.rem Fota.apk; mv FriendFeed.rem FriendFeed.apk; mv HelpCenter.rem HelpCenter.apk; mv hiphopofficial_2_0_0012_embed_Signed_2010-04-13_11-08-31.rem hiphopofficial_2_0_0012_embed_Signed_2010-04-13_11-08-31.apk; mv truecountry_2_0_0012_embed_Signed_2010-04-13_11-06-12.rem truecountry_2_0_0012_embed_Signed_2010-04-13_11-06-12.apk; mv KPT.rem KPT.apk; mv HomeSyncWizard.rem HomeSyncWizard.apk; mv LiveWallpapers.rem LiveWallpapers.apk; mv LiveWallpapersPicker.rem LiveWallpapersPicker.apk; mv MagicSmokeWallpapers.rem MagicSmokeWallpapers.apk; mv MessagesWidget.rem MessagesWidget.apk; mv NewsWidget.rem NewsWidget.apk; mv Protips.rem Protips.apk; mv QuickContactWidget.rem QuickContactWidget.apk; mv Quickoffice_BasicViewer_2.0.42.rem Quickoffice_BasicViewer_2.0.42.apk; mv Quickoffice_BasicViewer_2.0.52.rem Quickoffice_BasicViewer_2.0.52.apk; mv revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.rem revolver_2_0_0012_embed_Signed_2010-04-13_11-07-08.apk; mv SocialMessaging.rem SocialMessaging.apk; mv StatusWidget.rem StatusWidget.apk; mv Stk.rem Stk.apk; mv ToggleWidgets.rem ToggleWidgets.apk; mv VisualizationWallpapers.rem VisualizationWallpapers.apk; mv UniversalInbox.rem UniversalInbox.apk; mv WeatherWidget.rem WeatherWidget.apk; mv WorkContacts.rem WorkContacts.apkk


    I've noticed that some APK's change depending on the rom, these work for the UK 2.21 rom after applying the JIT/Deodex trick. If you get any errors, please check the exact names of the apk's in your rom:
    Code:
    ls

    It simply renames all the app's I don't want to .rem instead of .apk. Want something back? Rename from .rem to .apk, say if you miss the weather widget:
    Code:
    mv WeatherWidget.rem WeatherWidget.apk

    Update: Pretty slick way of listing the apps in your particular rom can be found here, props to Rob-T for that!

    When you're done, reboot:
    Code:
    reboot

    7) Overclocking time!
    Install Milestone Overclock from the market and fire it up. Load the module and Press the menu button, go to settings and enter "1000000" as Custom rate and "54" as custom vsel. After pressing OK, pull the slider all the way to the right, so the selected frequency shows up as "1000MHz, 52vsel (Custom)". Click Apply and tick the box for "Autoload on boot"

    8) Scaling
    Install SetCPU from the market and start it up. Set scaling to "Ondemand" and tick the box for "Autoload on boot" and exit the program. Now it's time to make the vsel correspond to the cpu frequency and save some power, as explained so brilliantly by Higgsy. Buy the man a beer! My setscaling.sh is here, Higgsy's excellent startup script is here. Download both to the root of your SD card. Then connect your phone to your pc and fire up ADB/MotoDev Studio. Once connected to your phone, here's what you need to do:

    Code:
    su
    Code:
    mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
    Code:
    cp /sdcard/setscaling.sh /system/xbin/setscaling.sh
    Code:
    cp /sdcard/install-recovery.sh /system/etc/install-recovery.sh
    Code:
    chmod 755 /system/etc/install-recovery.sh
    Code:
    chmod 755 /system/xbin/setscaling.sh
    Code:
    mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system

    Reboot your phone, and it should now be humming along nicely at 300-1000mhz, sipping only the power it needs, without being held down by Motobloat. Again, I didn't come up with any of this, I just wrapped it up :)

    After doing all this, feel free to restore your apps and settings with Titanium backup, but ONLY user apps, don't re-install the old non-optimized system apps. Here's a few screenshots with all my stuff (including locale, pure calendar and other always-running apps) is installed, after running the above tweaks and mods:

    tweak1.png


    tweak2.png


    The above is at 1ghz. The phone is nice and snappy, while still getting two days use from a single charge. Here's how 1.2ghz looks:
    tweak3.png


    Happy hacking!
    3
    I've noticed that some APK's change depending on the rom, these work for the UK 2.21 rom after applying the JIT/Deodex trick. If you get any errors, please check the exact names of the apk's in your rom:
    Code:
    ls

    Thanks for this great guide!

    I have the t-mobile us version, and there are a bunch of other .apk files on there that probably should get removed, including:

    Blockbuster_Moto_Stub_0.9.3.apk - blockbuster movie download app (i thought BB was bankrupt?)
    FamilyRoom.apk - a social networking thing for tracking your family
    AppPack3_0_1.apk - t-mobile's app that scans the apps on your device and then recommends new ones.
    MyAccount.apk - t-mobile's my account app
    TN58-1051-jordan.apk - TeleNav navigation system

    Here is my process for screening all of the apps using a list in MS Excel:

    Within ADB, I typed the LS command, right clicked the command prompt window, hit "select all" pasted into MS Excel (Column A), and removed the excess so I had a list of all the .APK files.

    Then I copied that column and pasted it in next to it (Column B, so two identical lists of .apk files), selected Column B, Ctrl+H to find and replace all ".apk" with ".rem". Then I created two formulas to automatically generate the commands I would need to past into abd shell to enable and disable apps.

    If you've got the list of .apk files in column A and the .rem list in column B:

    Column C
    Code:
    ="mv "&A2&" "&B2
    Column D
    Code:
    ="mv "&B2&" "&A2

    So copying a cell from column C will allow you to paste in a command to disable the app, and copying a cell from column D will allow you to paste in a command to enable the app. (Right click the Command window and choose "paste")
    1
    Very nice try !

    I started yesterday something similar but in document way (PDF guide or equivalent).
    Maybe to avoid reading the long posts your linking to with fixes of issues and so on, you could maybe just detail a little bit more certain parts...

    To give an example of my try with table of content and rooting part:

    Table of content:

    * How to Root the Defy
    - Gain admin access
    - Different methods for different versions of ROMs
    * How to over clock the defy
    - increase processor speed
    * How to backup/install recovery
    - allow installation of custom ROMs
    - allow backup/restore of points of your Defy
    * How to clean up system/apps
    - uninstall not wanted apps or components
    * How to add a theme
    - make you phone look better
    * How to deblur/deodexe your phone
    - remove the installed moto blur to improve performance
    * How to factory reset
    - remove traces of what you have done
    -understand the limits of the factory reset

    All contributions are more than welcome to allow the completeness and improvement of this guide!

    How to Root the Defy
    All changes are done at own risk. I'm not responsible for a bricked phone. If you don't know what you do, stop reading here.
    Default Root method for the Defy
    This method was originally found by jboogie3 here urlOn modmobile 557910-motorola-defy-root-droid2method.html/url

    let’s get started:

    1. Put the phone in Debug Mode: Go to Settings > Applications > Development and check USB debugging box.

    2. Extract the files from the zip below, connect the phone via USB, and copy them to the phone via ADB like this:
    Code:
    Code:
    adb push Superuser.apk /sdcard/Superuser.apk
    adb push su /sdcard/su
    adb push busybox /sdcard/busybox
    adb push exploit.bin /data/local/tmp/exploit.bin
    3. Now we enter the phone's internal shell, also using ADB:
    Code:
    Code:
    adb shell
    4. Then we take advantage of the "fake" root exploit:
    Code:
    Code:
    cd /data/local/tmp
    chmod 0755 exploit.bin
    ./exploit.bin
    5. Now after that last command you should be back to your normal console, not the phone one, so we need to connect to it again, and doing so we should now see that we have root permissions since the "#" symbol is displayed instead of "$".
    Code:
    Code:
    adb shell
    6. Now we mount the /system partition as writable and copy the necessary files there, and set them with the right permissions:
    Code:
    Code:
    mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
    cp /sdcard/Superuser.apk /system/app/Superuser.apk
    cp /sdcard/su /system/bin/su
    cp /sdcard/busybox /system/bin/busybox
    chmod 4755 /system/bin/su
    chmod 4755 /system/bin/busybox
    mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
    exit
    7. Restart the phone and check if you have ROOT in a terminal by typing the "su" command, or by installing any other app that requires ROOT, and seeing it the SuperUser app pops up.

    Rooting.zip > urlexternal url/url
    Contains the fake root exploit, SuperUser version 2.3.6.1 and busybox

    Alternative easy Root method
    1. Download the z4root application on the market or elsewhere, install it
    Apply the root / permanent root, that’s all !
    Note: not working for all versions of phone, but dramatically easy to do.

    Specific UK 2.51 ROM as of 29th of Dec 2010
    1. Download attatched files
    defy_2.21_boot_only.sbf
    2.21boot.zip
    defy_2.51_boot_only.sbf
    2.51boot.zip

    2. Flash the defy_2.21_boot_only.sbf via rsd lite then reboot in to system
    Note: Power off DEFY. Then press 'Volume Up' and 'Power' together to boot to loader before you flash the SBF to your DEFY. Debug: If you RSD Lite did not recognize your DEFY, download the USB driver here:
    urlmotorola docstools USB_Drivers/url

    3. Open you phone's usb debug mode(settings>application>development>usb debug mode), then follow the standard process the root the Defy. When finished, your phone is rooted with superuser

    4. Flash back the defy_2.51_boot_only.sbf via rsd lite.

    Without links since iam newbee here.

    Cheers,
    Kribou
    1
    1
    There's another error in the command list:

    'mv Swype.apk Swype.rem mv BlurUpdater.apk BlurUpdater.rem'

    There should be a semicolon after Swype.rem.