View Single Post
Old 04-18-2008, 01:01 PM   #1 (permalink)
rivviepop
BlackBerry Extraordinaire
 
rivviepop's Avatar
 
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
Posts: 2,166
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Script: Download OTA app to install from SD card

Please Login to Remove!

A utilitarian script to download a large OTA app and all it's COD/JAR/JAD files - such as the Mobipocket Reader - to your workstation so you can install it on your device using your SD card instead; handy if the app is really large, have problems with your device data connection, or pay a lot for the data usage on your device. Usage is simple and easy:

Download Usage

1) save the below code as 'getapp.sh'
2) edit getapp.sh to put in the proper URL and JAD file (Mobipocket eReader used as an example)
3) comment/uncomment the use of wget or curl as needed (depends on what you have installed, I like curl)
4) make a new directory and run the script in that directory

Example:
Code:
cd ~
vi getapp.sh (edit/save/exit)
mkdir mpocket
cd mpocket
sh ../getapp.sh

Install Usage

1) copy the folder "mpocket" to your SD card, it should contain all the random COD, JAD and JAR files
2) from your device launch the Media applet
3) Menu key -> Explore -> Media Card -> mpocket folder
4) click on the JAD file to start the install (i.e. mobireader.jad)


getapp.sh
Code:
#!/bin/sh
#
# retrieve an OTA app locally, copy to SD card and install
# from there instead (for large OTA apps)

URL=http://www.mobipocket.com/mobile/downloadsoft/download/mobile4.2.0/
JAD=mobireader.jad

# curl or wget may be used, comment/uncomment as needed
#CMD="wget --quiet"
CMD="curl -s -O"

echo "Retrieving: ${URL}${JAD}"
${CMD} "${URL}${JAD}"

echo "Converting ${JAD}"
dos2unix "${JAD}"

CODS=`cat ${JAD} | grep -i url | cut -f2 -d ' '`
for ii in ${CODS}; do
  echo "Retrieving: ${URL}${ii}"
  ${CMD} "${URL}${ii}"
done

exit 0

# rivviepop at blackberryforums.com
# licensed under the GPLv2
getapp.sh: download OTA app to install from SD card rivviepop phantom :: knowledge in passing
__________________
[ Linux & BlackBerry ] http://www.blackberryforums.com/linux-users-corner/

Last edited by rivviepop : 09-03-2008 at 06:50 PM. Reason: add blog link (go me!)
Offline   Reply With Quote