webOS Nation Forums >  webOS Developers >  webOS Development > Modified Amazon app to download over 3G
Modified Amazon app to download over 3G
  Reply
 
Thread Tools Display Modes
Old 06/16/2009, 06:41 PM   #1 (permalink)
Member
 
Posts: 633
Have successfully modified the Amazon app to download music over 3G/EVDO. The stock app only allows downloading over WiFi. Am hesitant to post this. Is it OK with Pre Central mods to post? Delete if need be.

Have tested with WiFi off. Kept the original and have a modified version as a separate app. Running the original says it needs wifi, modified version just downloads it with wifi off. See download progress bar for song below, note WiFi is off. Search for 'free' songs on Amazon to test.

Pre must first be rooted.

Amazon Store app directory
# cd /usr/palm/applications/com.palm.app.amazonstore/app/models

Always always save a backup
# cp download-manager.js download-manager.js.sav

Edit script... (or copy to /media/internal, USB mount and edit on PC, copy back)
# vi download-manager.js

(comment out lines by placing // at start of each line)

Code:
Comment out lines 416-423  (if condition stating songs must be downloaded via wifi)
Force lines 446 and 447 to be always true.... replace wifi tests with "if ( 1 == 1 )"
Line 446:         if (1 == 1) {
Line 447:                        if (1 == 1)
Comment out line 448 (test for "desktop")
# reboot (or press orange-sym-r)

I've posted this to PreDev Wiki. Ya might find more tips here from others...
http://predev.wikidot.com/stock-application-mods



Note that WiFi is off and EV is on.

Last edited by xorg; 06/20/2009 at 10:48 AM.
xorg is offline   Reply With Quote
Old 06/16/2009, 07:20 PM   #2 (permalink)
Member
 
Posts: 813
post it up!
Protagonist is offline   Reply With Quote
Old 06/16/2009, 07:24 PM   #3 (permalink)
Member
 
Posts: 35
Yes this would be incredibly valuable!!! Excellent work!!!
mhelfer is offline   Reply With Quote
Thanked By: xorg
Old 06/16/2009, 07:38 PM   #4 (permalink)
Member
 
Posts: 633
BTW, it took about 30 seconds to download a 3 minute song over EVDO with speedtest showing about 1Mbps or so, but hard to say as speed keeps bursting up to 2Mbps and down to 1Mbps for each test.
xorg is offline   Reply With Quote
Old 06/16/2009, 07:55 PM   #5 (permalink)
Member
 
Posts: 144
Have you checked with Sprint to see if this conflicts with their TOS?

-n8
natrixgli is offline   Reply With Quote
Old 06/16/2009, 07:58 PM   #6 (permalink)
Member
 
Posts: 633
They allow streaming music so there doesn't seem to be a difference.
xorg is offline   Reply With Quote
Old 06/16/2009, 08:03 PM   #7 (permalink)
Member
 
bulls96's Avatar
 
Posts: 2,103
i guess i have to jailbreak my Pre to do this....
bulls96 is offline   Reply With Quote
Old 06/16/2009, 08:08 PM   #8 (permalink)
Member
 
Posts: 633
yes
xorg is offline   Reply With Quote
Old 06/16/2009, 10:22 PM   #9 (permalink)
Member
 
Posts: 633
I've posted to Dev Wiki, might find more ideas here from others...

http://predev.wikidot.com/stock-application-mods

Last edited by xorg; 06/18/2009 at 09:59 PM.
xorg is offline   Reply With Quote
Old 06/16/2009, 11:37 PM   #10 (permalink)
Member
 
Posts: 167
Excellent work Xorg!
pyrognome is offline   Reply With Quote
Thanked By: xorg
Old 06/17/2009, 11:07 AM   #11 (permalink)
Member
 
Posts: 1
I'm getting the error "-sh: edit: not found" on edit download-manager.js

What am I doing wrong?
Ericrph is offline   Reply With Quote
Old 06/17/2009, 03:13 PM   #12 (permalink)
Member
 
BeingBoston121's Avatar
 
Posts: 1,688
i haven't found any other editing apps besides vi on the Pre. I'm tempted to install Nano

Tim
__________________
Iím a lucky man to count on both hands
The ones I love..

Visor Pro -> Visor Edge -> Treo 180 -> Treo 270 -> Treo 600 -> Treo 650 -> T|T2+SE T68i -> Treo 600 -> T-Mobile MDA -> Treo 755p -> Treo 800w -> Treo 755p -> PALM PRE -> Palm Pre 2 -> HP Palm Pre 3

Twittering about
BeingBoston121 is offline   Reply With Quote
Old 06/17/2009, 03:53 PM   #13 (permalink)
Member
 
Posts: 56
Could you modify this so the user only needs to comment the lines in question? ie. place "//" at the beginning of 416-422, and 448?

This is important, since an unexperienced user will delete line 448 which offsets lines 416-422. They could possibly delete the wrong code.

Great work, by the way.
nebj00la is offline   Reply With Quote
Thanked By: xorg
Old 06/17/2009, 05:21 PM   #14 (permalink)
Member
 
Posts: 633
Quote:
Originally Posted by bigredgpk View Post
i haven't found any other editing apps besides vi on the Pre. I'm tempted to install Nano

Tim
You could copy the file to /external/media then USB mount the drive and edit with a PC editor. You'd need to use an editor that shows line numbers and saves back as text. Then copy back to amazon store...models directory.

Always always make a backup copy of the file you are working on and save the original somewhere else.

Newbies might want to backup the entire amazon application before starting....

# cd /usr/palm/applications
# cp -rp com.palm.app.amazonstore /media/internal

If you screw up the app, restore it...
# cd /media/internal
# cp -rp com.palm.app.amazonstore /usr/palm/applications
xorg is offline   Reply With Quote
Old 06/18/2009, 04:00 PM   #15 (permalink)
Member
 
Posts: 633
This method will allow you to make the Amazon mod as a separate app and keep the original. If the original is updated, your mod app will still work.

http://forums.precentral.net/web-os-...-original.html

Note the "x" before the app name for the modified version.

xorg is offline   Reply With Quote
Thanked By: brotato
Old 06/18/2009, 06:17 PM   #16 (permalink)
Member
 
jack87's Avatar
 
Posts: 1,216
i am having trouble understanding how i make line 446/447 forced true. whats it supposed to look like?

as for modding the file via vi you can type ":###" the # being the line number and it jumps to it for example :446 will jump to line 446 so you dont really need an external editor.
jack87 is offline   Reply With Quote
Old 06/18/2009, 06:36 PM   #17 (permalink)
Member
 
Posts: 633
446 if (1 == 1) {
447 if (1 == 1)

Be sure to check all matching parens/brackets through the whole first if statement. I can't go into much more detail. I don't think I can post their code.

For those who don't know what I mean by 'matching parens/brackets', modding code is probably not wise.

Last edited by xorg; 06/18/2009 at 07:05 PM.
xorg is offline   Reply With Quote
Thanked By: scotbotmosh
Old 06/18/2009, 07:02 PM   #18 (permalink)
Member
 
Posts: 633
Exactly as I've typed it. You don't need two parens on 447 because you will also be commenting out 448 with a closing paren, so only 1 set is needed for line 447.

Good luck. Please post if you get it going. I'll help if you don't. You'll be the second validation if it works. No one else has posted yet they've done it.
xorg is offline   Reply With Quote
Thanked By: jack87
Old 06/18/2009, 07:09 PM   #19 (permalink)
Member
 
Posts: 19
Epic! Thanks for finally giving me an excuse to go ahead and root my Pre. I'm downloading from the Amazon Mp3 store over 3g at this very moment.

If, like me, Vi frightens and confuses you, SSH into your Pre and copy the download-manager.js file to the USB portion of your Pre like so:

Code:
cp /usr/palm/applications/com.palm.app.amazonstore/app/models/download-manager.js /media/internal
  • Next connect to your Pre via USB Mode and find the download-manager.js file you just put into your /media/internal folder.
  • Back it up and open the original in your editor of choice.
  • Make Xorg's edits, than save over the download-manager.js file on your Pre's mounted USB drive.
  • SSH back into your Pre and copy your now modified download-manager.js back to its original directory with this command:
Code:
sudo cp /media/internal/download-manager.js /usr/palm/applications/com.palm.app.amazonstore/app/models
Reboot your Pre and enjoy downloading Mp3's over Sprint's cellular network.
atourgates is offline   Reply With Quote
Thanked By: xorg
Old 06/18/2009, 07:17 PM   #20 (permalink)
Member
 
jack87's Avatar
 
Posts: 1,216
working got it

i tried using /* */ to comment oout the first set of lines that did not work out the amazon store would open but everything will be dim and unable to select just like it does when you first open

Thanks again!!! PS sorry for the double post bellow
jack87 is offline   Reply With Quote
Thanked By: xorg
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0