Go Back   xda-developers > General discussion > General


Reply
 
Thread Tools Search this Thread Display Modes
  #91  
Old 5th April 2008, 03:24 PM
chrisd1a1's Avatar
chrisd1a1 chrisd1a1 is online now
Senior Member
 
Join Date: Nov 2007
Location: leeds
Posts: 521
Default 4.1 working with c++ version

As far as i can see the default setting for both the mort and the c++ varies depending on when the application was added to jbed, (ie if it is the first app you ever added will be s_0 if it is the second s_1 etc. which means this will vary for everyone.

have tweaked the c++ as easier to hexedit.

1/ open and install the cab
2/ copy the exe from the seperate folder (the default for the cab is s_0, so start at s_1?) and paste into windows, overwiting the original
3/ try an email link
4/ if does not work try the next exe

i,ve edited and signed up to s_6 so should work for most. and quick and easy to do

with the fact that this can be set as default for email, you can upload and download, and it's faster than the 4.0 ver, i gotta admit i'm impressed. works well for a beta

think this is my new browser
Attached Files
File Type: zip opera 4.1 default.zip (25.4 KB, 210 views)
__________________
eek:

Yes. i Mitty and hard reset every time!!!

XDA IGNITO - chrisd1a1 sense rom

Device history

XDA Mini s stock O2UK WM5 rom
XDA Argon stock O2UK WM5 rom
XDA orbit2 various roms
Reply With Quote
Sponsored Links

  #92  
Old 5th April 2008, 09:37 PM
badbob001 badbob001 is offline
Senior Member
 
Join Date: Mar 2005
Posts: 164
Default

If you look at JZ's scripts, he actually parses the selector.utf file to figure out which suite number Opera Mini is installed under, which eliminates the guessing. He also parses the registry to find out where the jvm executable is located so most things are pretty automatic. Very cool work.

Last edited by badbob001; 10th April 2008 at 09:38 PM..
Reply With Quote

  #93  
Old 5th April 2008, 11:09 PM
chrisd1a1's Avatar
chrisd1a1 chrisd1a1 is online now
Senior Member
 
Join Date: Nov 2007
Location: leeds
Posts: 521
Default

Quote:
Originally Posted by badbob001 View Post
If you look at JZ's scripts, he actually parses the selector.utf file to figure out which suite number Opera Mini is installed under, which eliminates the guessing. He also parses the registry to find out where the jvm executable is located so most things are pretty automatic. Very cool work.
i know, very neat work (i go with brute force and ignorance) must improve my skills one day
__________________
eek:

Yes. i Mitty and hard reset every time!!!

XDA IGNITO - chrisd1a1 sense rom

Device history

XDA Mini s stock O2UK WM5 rom
XDA Argon stock O2UK WM5 rom
XDA orbit2 various roms
Reply With Quote

  #94  
Old 6th April 2008, 12:16 AM
JZ SmartMort's Avatar
JZ SmartMort JZ SmartMort is offline
Senior Member
 
Join Date: Mar 2008
Location: Lost in Hollywood
Posts: 612
Default Give me a break :)

We can trade skills you did it in C++, the real way, I just took a shortcut cuz it was available and heavily documented on forums like this.

I did put some love into that script though, for a good 2 months, saying to myself I wish it could do this or that. It's finally a script full of many features and if I see more suggestions, I'll add them in. That's the nice thing about the script, easy editing --- but you were right Chris, pauses are a bitch to deal with. I already replied to somebody with that issue on the BrightHand crosspost of this thread. Next version will have the pauses at the top with an explanation in the release notes.
__________________
Quote:
\\\\\\\
--\\\\ Change the way you use your Windows Mobile device with - JZ SmartMort.
--//// See screenshots & download it HERE or on SourceForge!
///////
Aiming to supplement everything Windows Mobile lacks.

Last edited by JZ SmartMort; 14th April 2008 at 10:00 AM..
Reply With Quote

  #95  
Old 6th April 2008, 09:13 AM
badbob001 badbob001 is offline
Senior Member
 
Join Date: Mar 2005
Posts: 164
Default

This updated script contains parts that is based on JZ's automatic detection of jbed's location and opera suite number. The script works with both Opera mini 4.0 and Opera mini 4.1.

You will need to edit the top part of the script to specify the opera mini version you are running: opera_version_to_run = "4.1" or opera_version_to_run = "4.0". While the script can detect if opera mini 4.0 or 4.1 is installed, it can't read your mind to figure out which Opera to run if you have both installed.

If you have 4.1 with direct address input turned off, then set direct_address_input = False. This is ignored if you have 4.0.

Adjust the delays as needed.

Tested with jbed 20080222.3.1 on a T-mobile shadow.

Much thanks to JZ for your great work and inspiration for me to dust off my old script.

Code:
direct_address_input = True
opera_version_to_run = "4.1" # Use 4.0 or 4.1
delay_if_jbed_running = 3000
delay_if_jbed_not_running = 8500

if (substr(url,1,1) eq " ")
	url = substr(url,2)
EndIf

If ( Find( "file:///", ToLower(url) ) )
	Run("\Windows\iexplore.exe", url)
Else
	Call OpenOM
EndIf

Sub OpenOM
	opera40_string = "Opera Mini,"
	opera41_string = "Opera Mini 4.1,"

	utf_file = ReadFile(RegRead("HKCR","jarfile\Shell\Save\Save Location","") & "\selector.utf")
	counter = 0
	opera_found = 0
	ForEach line in split (utf_file, "^LF^", 1)
		If (opera_found = 0)
			counter = counter+1
			opera_version_found = "unknown"
			
			If (Find(line,"suite=" & opera40_string) ne 0)
				opera_version_found = "4.0"
			ElseIf (Find(line,"suite=" & opera41_string) ne 0)
				opera_version_found = "4.1"
			EndIf
			
			if (opera_version_found eq opera_version_to_run)
				prog_line = Part( utf_file,"^LF^",counter+3,1 )
				prog_id = SubStr( prog_line , Find(line,"=") , 3 )
				if (prog_id ne "")
					jbed_params = "-run " & prog_id
					opera_found = 1
				EndIf
			EndIf
		EndIf
	EndForEach

	If (opera_found = 0)
		message ("ERROR: Unable to find Opera Mini " & opera_version_to_run)
	Else
		jbed_exe = Part(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""",2,1)
		
		If (ProcExists("jbed.exe"))
		   Run(jbed_exe, jbed_params)
		   sleep(delay_if_jbed_running)
		Else
		   Run(jbed_exe, jbed_params)
		   sleep(delay_if_jbed_not_running)
		EndIf
	
		SendLeftSoft
		Sleep(100)
		SendLeftSoft
		Sleep(100)
		
		if (opera_version_to_run = "4.1" AND direct_address_input = True)
			sendup
			Sleep(100)
			sendup
			Sleep(100)
			sendcr
			Sleep(100)
		Endif
	
		SetClipText(url)
	
		SendHome ("",1,0)
		sleep(100)
		SendEnd ("",1,1)
		sleep(100)
	
		SendCtrlKey("V")
		Sleep(100)
		SendLeftSoft
		sleep(100)

		if (opera_version_to_run = "4.1" AND direct_address_input = True)
			sendcr
		endif
	EndIf
EndSub

Last edited by badbob001; 10th April 2008 at 01:29 PM..
Reply With Quote

  #96  
Old 6th April 2008, 11:15 AM
Menneisyys Menneisyys is offline
Moderator
 
Join Date: Jul 2005
Posts: 5,316
Default

UPDATE (04/06/2008): The native C++ version of the invocation script has been updated to be compliant with 4.1. In addition, badbob001 has updated his MortScript to be compatible with 4.1 and he is also doing automatic (!!!) descriptor parsing & discovery to automatically find the current position of the OM deployment (just like the JZ SmartMort's brand new script I've reported on above), which, so far, needed to be done (once) by hand. See his updated script HERE. Both advancements are discussed HERE, starting with page 10 (post #91).
__________________
Microsoft MVP - Mobile Devices, 2006, 2007, 2008. Make sure you follow my PPC & SP Mag Expert blog HERE.
Reply With Quote

  #97  
Old 6th April 2008, 11:48 AM
JZ SmartMort's Avatar
JZ SmartMort JZ SmartMort is offline
Senior Member
 
Join Date: Mar 2008
Location: Lost in Hollywood
Posts: 612
Default

Quote:
Originally Posted by badbob001 View Post
Much thanks to JZ for your great work and inspiration for me to dust off my old script.
Anytime! I'm glad people are finding it useful. badbob you should see some of your code in my scripts, so thanks goes to ya as well!

I have a little dilemma though, just released the friggin thing less than a week ago, and now Opera 4.1 beta comes out, and a few easy suggestions came in. I think I'm gonna release a new version, but I feel like I punked out with having a version 1.0 which lasted a week
__________________
Quote:
\\\\\\\
--\\\\ Change the way you use your Windows Mobile device with - JZ SmartMort.
--//// See screenshots & download it HERE or on SourceForge!
///////
Aiming to supplement everything Windows Mobile lacks.

Last edited by JZ SmartMort; 14th April 2008 at 10:04 AM..
Reply With Quote

  #98  
Old 7th April 2008, 04:39 AM
JZ SmartMort's Avatar
JZ SmartMort JZ SmartMort is offline
Senior Member
 
Join Date: Mar 2008
Location: Lost in Hollywood
Posts: 612
Default JZ SmartMort 1.1 Released - 04/06/2008

Hi all,

Posting new version of JZ SmartMort 1.1 - 04/06/2008

Download HERE on XDA-Devs or at SourceForge.

Pasting below the enhancements, please let me know if there are any issues. A few big reasons for re-release. Opera 4.1 beta came out so I added support. Also a lot of people like me tried Opera Mobile 9.x beta which really messed my WM5 with regards to icons and file associations. My Install script has functionality to clean the mess up, but you will need to use the Install script again to "re-activate" the JZ SmartMort Browser script after fixing your icons and associations.

- Added Opera Mini 4.1 support - leave Opera's defaults alone, don't mess with direct URL input. I try to build my scripts for default settings of all software.
- Added "DefaultBrowser" to the top of "JZ SmartMort Browser.mscr" script. Basically bypassing the question of "which browser" but you still have the option to use the browser script from the main Action script.
- Placed pause/sleep durations to the top of "JZ SmartMort Browser.mscr" script, so slower/faster devices can adjust accordingly. The settings you see, fit my Cingular 3125 like a glove. Up to you to try different sleep durations for your specific unit.
- Killing jbed.exe and jmm.exe to make sure that my script has success every time. It's a tradeoff, I sacraficed Java load time for constant success of my script.
- Added "Fix icons & associations" to the Install script. Opera Mobile 9.x beta messes with a bunch of defaulticons and associations. This function resets everything to Microsoft defaults. I had to do a lot of research comparing registry exports of before and after Opera Mobile 9.


Future enhancement: Add another item to "JZ SmartMort Install.mscr" script which allows users to change their "device speed" and I can manipulate the key press pauses accordingly, for now just modify top of browser script.

Sorry, screenshots are old, don't have time and with my luck, Opera Mini 5 will come out in the next 20 minutes and then I gotta go through this fiasco again
__________________
Quote:
\\\\\\\
--\\\\ Change the way you use your Windows Mobile device with - JZ SmartMort.
--//// See screenshots & download it HERE or on SourceForge!
///////
Aiming to supplement everything Windows Mobile lacks.

Last edited by JZ SmartMort; 14th April 2008 at 10:04 AM..
Reply With Quote

  #99  
Old 7th April 2008, 11:46 PM
badbob001 badbob001 is offline
Senior Member
 
Join Date: Mar 2005
Posts: 164
Default

This is an experimental version of my script that tries to eliminate any need to edit parameters in the script.

1. It tries to detect when Opera Mini is active by looking for the red color of the Opera Mini title bar in the upper-left corner. This eliminates figuring out the arbitrary wait time after launching or switching to opera mini. If you use opera in full screen, then this will not work. If you have a windows theme where the upper-left corner is the same red as opera's, this *might* not work.

2. If you only have one copy of Opera Mini installed, be it 4.0 or 4.1, the script will launch that version despite the opera_version_to_run setting in the script. If you have more than one copy of Opera Mini installed, it will try to run the version specified by opera_version_to_run.

3. If you run the script directly or via shortcut, there will obviously be no url specified and the script will just launch Opera Mini. So now instead of messing with the 'run s0_' stuff in shortcuts and in other launchers, you can just link to the script and have it figure it out for you.

The only time you should need to change a parameter in the script is if you have Direct Address Input disabled, then you need to set direct_address_input = False.

There is some delay while the script tries to figure out how to run opera mini, so I added a wait cursor. My code is not very clean so suggestions to improve speed are welcomed. For the impatient, it certainly would be fastest to just tell the script how to run opera instead of having to figure it out every time. Another idea was to have its settings saved to an .ini file. If the .ini file does not exist, such as when running for the first time, the script runs the detection routines and creates the .ini file.

I did notice one or twice the script close Opera accidentally. Most likely a sent key in the middle got ignored and the following sent keys hit exit. Oh well.

Anyone notice when you switch away from Opera Mini 4.1 and then back, it sometimes appears that it's not responding to your key presses, but in fact it is but it is just not updating the screen? If you switch away and then back a few times, it will update itself and you'll see that your key presses did get through. It is beta...

Code:
direct_address_input = True
opera_version_to_run = "4.0" #Use 4.0 or 4.1

ShowWaitCursor

if (substr(url,1,1) eq " ")
	url = substr(url,2)
EndIf

If (url eq "")
	Call OpenOM
ElseIf (Find("file://", ToLower(url)))
	Run("\Windows\iexplore.exe", url)
Else
	Call OpenOM
EndIf
HideWaitCursor

Sub OpenOM	
	opera40_string = "Opera Mini,"
	opera41_string = "Opera Mini 4.1,"

	utf_file = ReadFile(RegRead("HKCR","jarfile\Shell\Save\Save Location","") & "\selector.utf")
	linenum = 0
	opera_count = 0

	ForEach line in split (utf_file, "^LF^", 1)

		linenum = linenum + 1
		opera_version_found = "unknown"
		prog_id = ""
					
		If (Find(line,"suite=" & opera40_string) ne 0)
			opera_version_found = "4.0"
		ElseIf (Find(line,"suite=" & opera41_string) ne 0)
			opera_version_found = "4.1"
		EndIf
				
		prog_line = Part( utf_file,"^LF^",linenum+3,1)
		prog_line_position = find(prog_line,"root=")
		if (prog_line_position ne 0)
			prog_id = substr(prog_line, prog_line_position+5, 3)
			if (prog_id ne "")
				opera_count = opera_count + 1
				opera_array[opera_version_found] = prog_id
			EndIf
		EndIf

	EndForEach

	If (opera_count = 0)
		HideWaitCursor
		message ("ERROR: Unable to find Opera Mini")
		exit
	ElseIf (opera_count = 1)
		ForEach opera_array_key, opera_array_value in array (opera_array)
			opera_version_found = opera_array_key
			jbed_params = "-run " & opera_array_value
		EndForEach
	Else
		ForEach opera_array_key, opera_array_value in array (opera_array)
			if (opera_array_key = opera_version_to_run)
				opera_version_found = opera_array_key
				jbed_params = "-run " & opera_array_value
			EndIf
		EndForEach
		If (jbed_params eq "")
			HideWaitCursor
			message ("ERROR: Unable to find Opera Mini " & opera_version_to_run)
			exit
		EndIf
	EndIf
		
	jbed_exe = Part(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""",2,1)
	Run(jbed_exe, jbed_params)
	Call waitForOperaRed

	if (url ne "")
		sleep(100)
		SendLeftSoft
		Sleep(100)
		SendLeftSoft
		Sleep(100)
		
		if (opera_version_found = "4.1" AND direct_address_input = True)
			sendup
			Sleep(100)
			sendup
			Sleep(100)
			sendcr
			Sleep(100)
		Endif
	
		SetClipText(url)
	
		SendHome ("",1,0)
		sleep(100)
		SendEnd ("",1,1)
		sleep(100)
	
		SendCtrlKey("V")
		Sleep(100)
		SendLeftSoft
		sleep(100)

		if (opera_version_found = "4.1" AND direct_address_input = True)
			sendcr
		endif			
	endif

EndSub

sub waitForOperaRed
	operaRed = rgb(107, 12, 8)
	loop_count = 0
	loop_done = 0
	while (loop_done = 0)
		upperRightColor = colorat(0,0)
		if (upperRightColor = operaRed)
			loop_done = 1
		ElseIf (loop_count >= 60)
			HideWaitCursor
			message("ERROR: Did not detect Opera Mini after 30 seconds.")
			exit
		Else
			sleep(500)
			loop_count = loop_count + 1
		EndIf
	endwhile
endsub

Last edited by badbob001; 10th April 2008 at 01:29 PM..
Reply With Quote

  #100  
Old 8th April 2008, 08:59 AM
JZ SmartMort's Avatar
JZ SmartMort JZ SmartMort is offline
Senior Member
 
Join Date: Mar 2008
Location: Lost in Hollywood
Posts: 612
Default

Quote:
Originally Posted by badbob001 View Post
This is an experimental version of my script that tries to eliminate any need to edit parameters in the script.

1. It tries to detect when Opera Mini is active by looking for the red color of the Opera Mini title bar in the upper-left corner. This eliminates figuring out the arbitrary wait time after launching or switching to opera mini. If you use opera in full screen, then this will not work. If you have a windows theme where the upper-left corner is the same red as opera's, this *might* not work.
badbob001, I think this time you did the motivating. You finally figured out how to get rid of the hard coded pauses, very cool! I tried messing with this concept a while ago but gave up after 20 minutes of no success, go figure. Hope you don't mind I snagged your concept also I decided to validate 2 pixels, to really make sure. I got it fully working in my script on all 3 browsers OM2, OM4 & OM4.1 but only in JBed, I should probably drop TAO Intent support, the blue softkeys at the bottom make it a pain to get color. I wonder what the market share is comparing TAO & JBed. Do most Windows Mobiles now use JBed or is TAO still in the game? Anybody?

badbob001 and I should just team up on SourceForge
__________________
Quote:
\\\\\\\
--\\\\ Change the way you use your Windows Mobile device with - JZ SmartMort.
--//// See screenshots & download it HERE or on SourceForge!
///////
Aiming to supplement everything Windows Mobile lacks.

Last edited by JZ SmartMort; 14th April 2008 at 10:04 AM..
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:45 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.