View Single Post
Old 07-21-2008, 05:57 PM   #110
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Quote:
Originally Posted by gczobel View Post
But I don't known how to detect if the device is a 500 or 505...
In the loadDict method in the autorun.js file add the following command.

Code:
	this.trace("Device INFO:[" + this.runCommandResult("uname -a")+ "]");
This will tell you the computer name, OS, kernel, processor, all in a single line. Then you can use JavaScript regular expression to find the actual text you are looking for. The output will be stored in the log files where the libfskLoad.so file exists.

After you find the string replace the code above with the following code.

Say your looking for 'PRS500' in the uname string (it's not there I've check uname on the PRS-505, but let's pretend it is)

Code:
var prsRegEx= /PRS500/gi;
var szUnameResults = this.runCommandResult("uname -a");
if (szUnameResults.match(prsRegEx)){
 //DO THE PRS 500 code here
} else{
 //DO THE PRS 505 CODE HERE
}
Again the only code that changes is what is string between 'PRS500' between the two backslashs "//" in the first line above. The text you replace it with should be within the string returned from running the uname command.

Last edited by =X=; 07-21-2008 at 06:01 PM. Reason: Upated instructions
=X= is offline   Reply With Quote