|
|||||||
| Register | FAQ | XDA-Portal | XDA-Wiki | Device database | Donate! | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#91
|
||||
|
||||
|
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 ![]()
__________________
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 |
| Sponsored Links |
|
#92
|
|||
|
|||
|
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.. |
|
#93
|
||||
|
||||
|
Quote:
![]()
__________________
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 |
|
#94
|
||||
|
||||
|
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:
Last edited by JZ SmartMort; 14th April 2008 at 10:00 AM.. |
|
#95
|
|||
|
|||
|
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.. |
|
#96
|
|||
|
|||
|
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. |
|
#97
|
||||
|
||||
|
Quote:
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:
Last edited by JZ SmartMort; 14th April 2008 at 10:04 AM.. |
|
#98
|
||||
|
||||
|
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:
Last edited by JZ SmartMort; 14th April 2008 at 10:04 AM.. |
|
#99
|
|||
|
|||
|
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.. |
|
#100
|
||||
|
||||
|
Quote:
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:
Last edited by JZ SmartMort; 14th April 2008 at 10:04 AM.. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|