webOS Nation Forums > Homebrew > webOS patches > iPhone User Agent Spoof - How to make all mobile websites display perfectly
First ... 6 7 8 9 10 11 12 13 14 15 16 21  ... Last
Member: stflush
at: 11:41 PM 10/09/2009
Originally Posted by pdog197804:
is this not the same patch as the iphone spoof agent???
Yes, this is the iphone spoof agent patch.
Reply
Member: Zoen22
at: 04:20 AM 10/10/2009
Only problem I'm having is it is not reformatting mobile pages to be viewed correctly. Still coming up with very small text
Reply
Member: todivefor
at: 08:22 AM 10/10/2009
wtgreen, thank you. The patch works fine. Have missed it for the pgatour website alone.

I tried looking at the script (change-user-agent) , to try and learn something, and don't understand it. Obviously, I am missing something. All I see is:

#!/bin/sh
#
# Generic installer Copyright 2009 Carl E. Thompson

NAME=$(basename $0)
NUM_LINES=$(( $(grep -n -m 1 -- "^# ---END-SCRIPT---$" $0 | cut -d : -f 1) + 1 ))

do_error()
{
while [ -n "$1" ]
do
echo "ERROR: $1" >&2
shift
done
exit 1
}

TEMPDIR=/tmp/$NAME.install

rm -rf $TEMPDIR || do_error "Could not remove old temporary directory ($TEMPDIR)"
mkdir $TEMPDIR || do_error "Could not create temporary directory ($TEMPDIR)"

tail -n +${NUM_LINES} $0 > $TEMPDIR/data.tar.gz || do_error "Could not create data file"

cd $TEMPDIR || do_error "Could not change to temporary directory ($TEMPDIR)"
tar xzf data.tar.gz || do_error "Could not extract data file"
sh runme.sh "$@" || do_error "Installer exited abnormally"

rm -rf $TEMPDIR
exit 0

# ---END-SCRIPT---

and then gibberish after ---END-SCRIPT--- which I assume is the WebKitLuna.so.

What am I missing?
Reply
Member: wtgreen
at: 11:42 AM 10/10/2009
The change_user_agent script is a sophisticated little program. I learned quite a bit by disassembling it myself. It's a text script followed by a binary payload, a compressed archive containing another script, runme.sh, a program that patches binary files, bspatch, and the binary patch instruction data file itself, the *.bsdiff file.

When change_user_agent runs, it searches its body for the END-SCRIPT marker, saving everything after it - the binary payload - to a file called data.tar.gz, and then uncompresses it to a temp directory, and finally executes the runme.sh script that it uncompressed.

The runme.sh script then checks the OS version and md5sum value of the current libWebKitLuna.so file. If these match what it expects, it backs up the existing .so file and runs the bspatch program to actually apply the patch changes described in the .bsdiff file to the libWebKitLuna.so file. If all goes well and the modified file's md5sum checks out, the phone reboots.

The .bsdiff file itself was created ahead of time by running a program called bsdiff to compare the manually revised libWebKitLuna.so file to the original. This produced the small instruction file describing the differences that bspatch then uses to make the changes, and it allows us to avoid distributing the *.so file itself which would be a clear violation of Palm's rights.

It's really a clever little process which I enjoyed figuring out. It's well written with good error handling too. When you understand how it works you can't help but appreciate ClipCarl's work even more.
Reply
Member: todivefor
at: 12:44 PM 10/10/2009
Originally Posted by wtgreen:
The change_user_agent script is a sophisticated little program. I learned quite a bit by disassembling it myself. It's a text script followed by a binary payload, a compressed archive containing another script, runme.sh, a program that patches binary files, bspatch, and the binary patch instruction data file itself, the *.bsdiff file.

When change_user_agent runs, it searches its body for the END-SCRIPT marker, saving everything after it - the binary payload - to a file called data.tar.gz, and then uncompresses it to a temp directory, and finally executes the runme.sh script that it uncompressed.

The runme.sh script then checks the OS version and md5sum value of the current libWebKitLuna.so file. If these match what it expects, it backs up the existing .so file and runs the bspatch program to actually apply the patch changes described in the .bsdiff file to the libWebKitLuna.so file. If all goes well and the modified file's md5sum checks out, the phone reboots.

The .bsdiff file itself was created ahead of time by running a program called bsdiff to compare the manually revised libWebKitLuna.so file to the original. This produced the small instruction file describing the differences that bspatch then uses to make the changes, and it allows us to avoid distributing the *.so file itself which would be a clear violation of Palm's rights.

It's really a clever little process which I enjoyed figuring out. It's well written with good error handling too. When you understand how it works you can't help but appreciate ClipCarl's work even more.
Thank you for the excellent explanation. I sort of put some of that together after I asked the question. I think I'll continue looking at it as an exercise.

Thank you again for your work getting this working again. I missed it.
Reply
Member: wtgreen
at: 02:22 PM 10/10/2009
Originally Posted by jghacker:
Does anyone know if it will be incorporated for install via preware soon? Love the new preware patch installs - and so much less hassle than other methods.
No idea. I haven't looked into how they're done myself, and don't know who really manages it.
Reply
Member: mrdavis55
at: 03:52 PM 10/10/2009
i'm not seeing this in Preware anymore??? what happened???
Reply
Member: stflush
at: 03:57 PM 10/10/2009
Originally Posted by mrdavis55:
i'm not seeing this in Preware anymore??? what happened???
The fix that wtgreen posted for webOS 1.2.1 hasn't been set up for Preware yet. I posted a request in the Offical Patch Discussion thread for 1.2.1. Hopefully someone can help out.
Reply
Member: holley2583
at: 10:51 PM 10/10/2009
What do u open the zip with? i cant get it to open correctly with anything...i know it's a dumb question but hey, im pressured.
Reply
Member: wtgreen
at: 08:28 AM 10/11/2009
when you say open correctly, what do you mean? It doesn't take anything special to open it. It extracts to a single file that is a text script with a binary payload following it. It looks odd if you view the file, but it's designed that way intentionally.
Reply
Member: holley2583
at: 09:52 PM 10/11/2009
so just put the file in say quick install and that's it?
Reply
Member: wtgreen
at: 10:11 PM 10/11/2009
Originally Posted by holley2583:
so just put the file in say quick install and that's it?
Follow the instructions in the first post of the thread.
Reply
Member: myculito
at: 01:33 AM 10/12/2009
I'm a bit confused. Does this require that I root my Pre first?

I have PreWare installed, and I saw in the posts above that it's not on there yet.

However, I do see this under "tweaks" in WebOS Quick Install, but it gives a warning message that it's not guaranteed to work in WebOS 1.2.1

Should I install the one listed under "tweaks" in WebOS Quick Install?
Reply
Member: holley2583
at: 02:04 AM 10/12/2009
Originally Posted by wtgreen:
Follow the instructions in the first post of the thread.
Duh, I guess I wasn't sure if it worked the same way...but I got it workin and THANKS so much...really needed it!
Reply
Member: gage006
at: 03:19 AM 10/12/2009
Originally Posted by myculito:
I'm a bit confused. Does this require that I root my Pre first?

I have PreWare installed, and I saw in the posts above that it's not on there yet.

However, I do see this under "tweaks" in WebOS Quick Install, but it gives a warning message that it's not guaranteed to work in WebOS 1.2.1

Should I install the one listed under "tweaks" in WebOS Quick Install?
Required you have it rooted. You need novacom/novaterm installed and working. Quick Install/Preware version coming eventually.
Reply
Member: myculito
at: 03:59 AM 10/12/2009
Originally Posted by gage006:
Required you have it rooted. You need novacom/novaterm installed and working. Quick Install/Preware version coming eventually.
Gage, thanks. I already have Novacom installed. Am I considered "rooted"?
Reply
Member: wtgreen
at: 09:17 AM 10/12/2009
myculito,

If you can get to a root@castle prompt on your phone, you're "rooted" my friend.
Reply
Member: Forever92
at: 12:40 PM 10/12/2009
Say if you go to gmail though a web page on the pre will this help it to show more of the text of the email while in landscape? (standard mode)
Reply
Member: Paladin
at: 02:06 PM 10/12/2009
Should I still do this manually or use WebOSQuick install? Are they the same now?
What about the one from Preware? I am just confused on which way to do this.

Man I cannot even cut and paste to/from novacom, lame. ?
Reply
Member: todivefor
at: 02:13 PM 10/12/2009
Originally Posted by Paladin:
Should I still do this manually or use WebOSQuick install? Are they the same now?
What about the one from Preware? I am just confused on which way to do this.

Man I cannot even cut and paste to/from novacom, lame. ?
You will have to do this manually. Preware does not have it. It may be available in next release of WebOSQuickInstall.
Reply
First ... 6 7 8 9 10 11 12 13 14 15 16 21  ... Last
webOS Nation Forums > Homebrew > webOS patches > iPhone User Agent Spoof - How to make all mobile websites display perfectly