Difference between revisions of "Patch webOS Bypassing Activation"

From WebOS Internals
Jump to navigation Jump to search
Line 88: Line 88:
 
15. Hold the volume up button while plugging in USB cable.
 
15. Hold the volume up button while plugging in USB cable.
  
16. Flash it by starting the flasher tool. (Windows Users: check "Custom Flash with WebOS Doctor" to complete this step if you don't know what "flasher.jar" is.)
+
16. Flash it by starting the flasher tool.
 
  java -jar flasher.jar
 
  java -jar flasher.jar
 
   
 
   

Revision as of 22:13, 3 September 2009


If you are outside of Sprint's service area in the United States and would like to still be able to use your Pre, you are required to possess a Palm profile. The phone will not let you past the "create profile" screen because it cannot hit Palm's servers over the non-working EV-DO connection.

This modification will allow you to enable WiFi and use that to create your Palm Profile. The phone is otherwise unchanged and would still work if it was brought back into a Sprint service area.

NOTE: You may need to use a Mac or Linux machine to do the file editing, otherwise the /dev folder will be empty and YOUR PHONE WILL NOT BOOT.

Procedure with a good ESN phone

Verified Working Procedure:

Note: These instructions and patches were created for WebOSdoctor 1.0.2, so the locations of lines may be different on later versions.

1. Download the WebOS image.

2. Rename this file to .zip, and extract it.

3. Untar resources\webOS\nova-cust-image-castle.rootfs.tar.gz.

4. Check to see that /dev has files in it after untarring. If it does not, try untarring as root.

5. Open file /usr/palm/applications/com.palm.app.firstuse/app/controllers/app-assistant.js.

6. Change the setUpFirstUse() function.

function setUpFirstUse () {
setupSimulator (); 
isDevice = true; 
}

7. Apply the diff's to the following 2 files:

command:

patch foo.js < patch

files to patch:

/usr/palm/applications/com.palm.app.firstuse/app/controllers/firstuse-util.js
95a96
>                       {label: $L('Enable WiFi'), command: 'peef-hack-mode'},
105a107,108
>               } else if (value == "peef-hack-mode") {
>                       AppAssistant.accountService.peefMode();
/usr/palm/applications/com.palm.app.firstuse/app/models/account-service.js
389a390,399
>       peefMode: function() {
>               return new Mojo.Service.Request("palm://com.palm.applicationManager/open", {
>                       parameters: {
>                               id: 'com.palm.app.wifi',
>                               params: {
>                               }
>                       }
>               });
>       },

8. Edit /usr/lib/ipkg/info/com.palm.app.firstuse.md5sums and add the correct md5 of app-assistant.js, account-service.js, and firstuse-util.js.

md5sum (file.js)

9. Edit /md5sums file and add the correct md5 of app-assistant.js, account-service.js, and firstuse-util.js, and /usr/lib/ipkg/info/com.palm.app.firstuse.md5sums. (These two steps are not necessary, but if you don't do them, the flashing will fail. The phone should still reboot and work as normally though.)

10. Pack the nova-cust-image-castle.rootfs folder into nova-cust-image-castle.rootfs.tar.gz (make sure that the tar's root contains the root file system, and not a folder containing the root file system).

tar cvpzf ../nova-cust-image-castle.rootfs.tar.gz ./

11. Pack the webOS folder into webOS.tar. Make sure that the root of the .tar contains the files in webOS and not a folder containing the files in webOS.

tar cvf ../webOS.tar ./

12. Remove JARKEY.RSA and JARKEY.SF from \META-INF.

13. Edit the MANIFEST.MF in \META-INF. Remove all of the SHA-1 hashes and leave just the following three lines at the top of the file.

Manifest-Version: 1.0
Created-By: 1.6.0_04 (Sun Microsystems Inc.)
Main-Class: com.palm.nova.installer.recoverytool.RecoveryTool

14. Pack the .jar back up. You can use zip to do this. NOTE: If zipping it is resulting in an unusable jar file, make sure you have the JDK installed and use:

jar cvMf flasher.jar * #if you are in the folder containing resources, META-INF and com folders

15. Hold the volume up button while plugging in USB cable.

16. Flash it by starting the flasher tool.

java -jar flasher.jar

17. Once you get to the "Create Palm Profile" screen, tap the little phone icon down in the lower right notification area.

18. Choose the "Enable WiFi" menu item.

19. When the WiFi control opens, enable WiFi and connect to your local WiFi network (must allow internet accesss).

20. Close the WiFi panel and then proceed normally to create your new Palm Profile. NOTE: If you find yourself unable to close the WiFi panel, remove the battery and reboot. Your phone will still connect to the network.

Bypassing modem errors

If your CDMA modem somehow gets into a bad state, firstuse will still fail with generic error messages (loading the "error" scene when it fails to initialize the modem).

Apparently changing (commenting out the isDevice line?)

function setUpFirstUse () {
setupSimulator (); 
// isDevice = true; 
}

and changing both instances of

if (PalmSystem.version.match("desktop")) {

to

if (true) {

will cause firstuse to use the same mechanism it does on the emulator and skip testing the CDMA modem.

FIXME: Would someone please validate this method and perhaps come up with a unified patch to solve both problems in fewer lines?

Credits

Courtesy of pEEf. Verified by Ajax.

Procedure with an bad ESN phone

Bypass the First Use app after booting

The bad ESN phone (can be for example bought off eBay) is quite a good choice for a developer if you know how to get around the activation process. If you follow the 'good ESN' procedure, the phone will end at the "Profile Creation Failed" screen with no possibility to get around it.

You can either use a developer ROM (currently only on at Early Access, the updated public ROMs are still in the works) with comparable functions with webOS 1.0.2 minus some profile-related stuff to get access to the phone while it's displaying the First Use app (and edit the file described below after the flashing) OR reflash it with a modified stock ROM (the procedure described above but only with one file) with the following change:

If you modify the /etc/event.d/LunaSysMgr the following way (comment out some lines), the First Use app will not launch after the reboot and you'll be able to use the phone normally...kind of. The application requiring the Palm Profile may not work as the supposed to do until you continue wit the 'Create a Palm Profile' procedure described below.

start on started java-serviceboot

# Stop when the Software Update tool is about to install an update.  The tool
# uses upstart to restart jobs when the installation is complete.
stop on started start_update

respawn

pre-start script
	echo "1" > /proc/sys/vm/overcommit_memory
	mkdir -p /var/luna/preferences
#	if [ ! -f /var/luna/preferences/ran-first-use ]
#	then
#		echo " -u minimal -a com.palm.app.firstuse" > /var/luna/preferences/sysmgr-args
#	else
		echo "" > /var/luna/preferences/sysmgr-args
#	fi	
end script

NOTE1: You can do an update from the developer SDK ROM to the latest stock ROM by launching the Update application. You only need to create /var/lina/preferences/ran-first-use (touch /var/lina/preferences/ran-first-use command) file to be able to pass trough the First Use app after the boot, othervise you'll get stuck again ;-)

NOTE2: (after update to webOS 1.1) I've tried the developer ROM procedure and after the system update finished, my phone suddenly stopped responding to keyboard and touchscreen input though the remote access still worked. I discovered that there was some problem with installing the hidd (Human Interface Device Daemon aka touchscreen/keyboard/proximity sensor/accelerometer driver) libraries. If you also run accross this problem, you need to copy /usr/lib/lib/libhidkeypad.so and /usr/lib/libhidproximity.so from the webOS doctor image to the device. These files are missing and therefore the daemon cannot start.

Create a Palm Profile

This may not be the everybody's case, but in my case, I needed to issue two modifications to the system to be able to create a Palm Profile with an bad ESN phone. First, you need to add the following two lines to /usr/palm/applications/com.palm.app.firstuse/app/controllers/provision-assistant.js file (webOS 1.1: line 50):

this.deviceIdRequest = AppAssistant.accountService.getDeviceId(
                            this.readDeviceId.bind(this),
                            this.deviceIdRequestFailed.bind(this), this.controller);

this.setupProgressBar();

this.provisionComplete(); // <==== add this line
return; // <==== add this line

ProvisionUtil.setScene(this);

if((!isActivated) && (activationFailed)) {

This modification will let you activate the phone without actually checking if it could be activated (you'll get Cannot Activate Your Phone screen if you don't do that).

To be able to create the Palm Profile, you need to modify the /dev/tokens/DMSETS file.

before modification:

{"sets":"94"}

after modification:

{"sets":"base"}

Then, you gotta kill the java (pkill java) and luna-prefs-service (pkill prefs) processes. When you do that, the phone will load the edited DMSETS value and provide it to the Profile creation process.

Finnally, you can launch the First Use app by issuing the palm-launch com.palm.app.firstuse command on your desktop (you need to have developer mode enabled).

Credits

  • xxrake for the original PreCentral forums post
  • czechdev for finding out what the "Profile Creation Screen" does really mean and how to solve it, SDK to stock ROM update process