1. Are you ready for the Galaxy S20? Here is everything we know so far!

Boot loop when replacing .jar

Discussion in 'Android Devices' started by Xdaemon, Oct 21, 2010.

  1. Xdaemon

    Xdaemon Lurker
    Thread Starter

    Hello everyone,

    I'm new to Android - working on it for about 2 weeks now and trying to solve a problem when I push my compiled froyo .jar file over to my phone.

    First, a little about my environment:

    I have a rooted Droid 1 with Froyo and Bugless Beast. I am developing on Ubuntu 9.10 with a relatively updated kernel; Froyo compiles without any issues. I have tried this on two different machines with similar Ubuntu environments, and have the same boot loop issue. I'm using a simple approach to development - editing in vi and using make as my tools. I'm not building any .apks, so I'm not messing with Eclipse at this point.

    Specifically, I made a simple edit to <froyo root>/frameworks/base/services/java/com/android/server/connectivity/Tethering.java, then did the following:

    adb remount
    adb push out/target/product/generic/system/framework/services.jar /system/framework/.
    adb reboot

    And now -- I'm sure you've heard this part of the story before -- the system reboots, then I get a boot loop shortly after my launcher appears. Replacing the compiled services.jar with the one pulled from the stock phone fixes things, but even if I remove my changes from Tethering.java, rebuild froyo, and push that newly compiled .jar to my phone still results in a boot loop, which makes me wonder about my build environment...

    I have compared a normal booting logcat against one that is stuck in a boot loop, and the first sign of trouble is here:

    I/dalvikvm( 1013): DexOpt: source file mod time mismatch (3cdb08b6 vs 3d52b020)
    D/dalvikvm( 1013): Stale deps in cache file; removing and retrying
    I/ ( 1014): ServiceManager: 0xacd0
    E/AudioPostProcessor( 1014):
    E/AudioPostProcessor( 1014): AudioMgr Error:Failed to open gains file /data/ap_gain.bin
    E/AudioPostProcessor( 1014):
    E/AudioPostProcessor( 1014): AudioMgr Error:Failed to read gains/coeffs from /data
    E/AudioPostProcessor( 1014): Audio coeffs init success.
    I/CameraService( 1014): CameraService started: pid=1014
    D/Audio_Unsolicited( 1014): in readyToRun
    D/Audio_Unsolicited( 1014): Create socket successful 9
    I/AudioFlinger( 1014): AudioFlinger's thread 0x11c48 ready to run
    D/dalvikvm( 1013): DexOpt: --- BEGIN 'services.jar' (bootstrap=1) ---
    D/dalvikvm( 1097): creating instr width table
    I/BATTD ( 1020): SBCM_GLUE ****BRT SUCCESS****
    I/BATTD ( 1020): BM_BATT_DATA: status valid
    I/BATTD ( 1020): BM_BATT_DATA: uid valid
    I/BATTD ( 1020): BM_BATT_DATA: family_code = 137
    I/BATTD ( 1020): BM_BATT_DATA: uid_lsb = 0
    I/BATTD ( 1020): BM_BATT_DATA: uid_msb = 80
    I/BATTD ( 1020): BM_BATT_DATA: page_2_checksum = 0
    I/BATTD ( 1020): BM_BATT_DATA: page_3_checksum = 0
    I/BATTD ( 1020): BM_BATT_DATA: cpyrght_vld = 1
    I/BATTD ( 1020): SBCM CORE convert_rom_data: bcap= 1390, raw= 0x8b
    I/BATTD ( 1020): BATTD_SetBattCapacity BATT CAP = 182199
    I/BATTD ( 1020): SBCM_GLUE BATT CAP = 1390
    I/BATTD ( 1020): set_charge_current=0
    I/BATTD ( 1020): Battd USB INSERT = Success
    I/BATTD ( 1020): Battd USB INSERT = Success
    I/BATTD ( 1020): Battd USB INSERT = Success
    I/BATTD ( 1020): Event from SBCM Driver=Coulomb Counter Calibration Interrupt
    I/BATTD ( 1020): set_charge_voltage=4200
    I/BATTD ( 1020): set_charge_current=0
    I/BATTD ( 1020): set_charge_voltage=4200
    I/BATTD ( 1020): set_charge_current=500
    D/dalvikvm( 1097): DexOpt: load 556ms, verify 1563ms, opt 48ms
    D/dalvikvm( 1013): DexOpt: --- END 'services.jar' (success) ---

    I have noticed that the native froyo services.jar file is 633200 bytes in size and mine is 623407 bytes in size (with no source code changes). A few KB off, but different none the less. I thought my issue might be that my compiled .jar was unsigned, but creating my own key with keytool and using jarsigner was to no avail - the loop still happens. Of course, I'm assuming that ANY signed .jar will do (which it may not).

    I have also tried pushing the entire /system/framework directory over (despite the fact that services.jar was the only file with different mod time), and still I get the loop.

    I've looked into using baksmali and smali to crack open the .dex inside of the .jar, and edit the Tethering.smail file, which seems to work (no boot loop), but this is too clunky for the development that I wish to do. I just want to edit, compile, push the newly built .jar to my phone and test my changes.

    Am I missing a completely obvious step (perhaps in my build environment or steps), or does anyone have any insight?

    Thanks in advance.

    1. Download the Forums for Android™ app!



Motorola Droid Forum

The Motorola Droid release date was November 2009. Features and Specs include a 3.7" inch screen, 5MP camera, 256GB RAM, processor, and 1400mAh battery.

November 2009
Release Date

Share This Page