| Quote: |
| You don't need to have a signed application to access the API! You can enable access by unsigned applications!
Cristian hope this is the answer for Sprint? |
| arpruss wrote: |
| I downloaded the QJAE docs, and made a dummy Gps package following them. (You can get it from http://prussfamily.us/qjae.zip ; you can use it under GPL 2 or later or BSD revised licenses.) This was missing all the static final constants (the docs don't specify their values), but was good enough to compile GpsTester.java (I made some changes, but the original source would have compiled, too). After compiling, I just deleted the dummy classes from my jar file, copied to the phone with BitPim. I do get a dialogue asking whether to enable location access, and then eventually I get a GPS timeout error, so I think it's connecting to the GPS API just fine. That may just be because I don't have Vision, and so the phone can't connect to the location server. |
| Cristian Streng wrote: |
| Some things have changed since the last post in this topic... I already have an implementation based on the main qjae implementation, |
| Quote: |
| just waiting for someone to be able to test it - as I don't live in the U.S. so I have no access to the Sprint network. Let me know if you would be able to beta-test and I'll send it to you by email or upload it on the server. |
| Cristian Streng wrote: | ||
Some things have changed since the last post in this topic... I already have an implementation based on the main qjae implementation, just waiting for someone to be able to test it - as I don't live in the U.S. so I have no access to the Sprint network. Let me know if you would be able to beta-test and I'll send it to you by email or upload it on the server. Cristian |
| Cristian Streng wrote: |
| Get the alpha version from http://wap.mgmaps.com/mgmapssp.html (open it on your phone)... let me know how it goes. You may need to unlock the application as described by others previously on this thread. |
| arpruss wrote: |
| If you unlock by editing the __access.txt file as described in my post, you won't need to edit the index files. In fact, your phone should edit the index files for you in accordance with your answers to the qeustion whether to enable location access.
For a simpler test of just the GPS code, you might also try editing the __access.txt file and then trying GpsTester. |
| Cristian Streng wrote: |
| And one other thing - even if it doesn't work, please look in Help/Debug and let me know if you find any GPS-related messages there (like "GPS: Starting gps service of type: ...")
Cristian |
| goesh wrote: | ||
Installed the alpha version. First start I enabled GPS and restarted. Now the program will not launch. While the top of the screen reads 'Application Loading, please wait...' an error appears at the bottom titled 'Unhandled Exception' and displaying the text 'NullPointerException'. |
| arpruss wrote: |
|
(1) GPS access is easy. Use BitPim to download /Brew/__access.txt (I think that's the file--it's got some pretty obvious name and is in the /Brew directory). Save a backup of it. At the end there is a list of what signed and unsigned apps are permitted to do. Add an entry to the section for unsigned apps (at the very end) that says "blanket(oneshot): gps_api". That's all! |
| arpruss wrote: |
|
(1) GPS access is easy. Use BitPim to download /Brew/__access.txt (I think that's the file--it's got some pretty obvious name and is in the /Brew directory). Save a backup of it. At the end there is a list of what signed and unsigned apps are permitted to do. Add an entry to the section for unsigned apps (at the very end) that says "blanket(oneshot): gps_api". That's all! |
| Cristian Streng wrote: |
| I have another alpha version available at http://wap.mgmaps.com/alpha3.html. I hope you'll be able to at least start this one. |
| Cristian Streng wrote: |
| Anyway, can you try GpsTester first? - http://www.shaftek.org/projects.shtml in the New Download section
|
| goesh wrote: | ||
I also tried testing the GpsTester.jar application as suggested by arpruss, however, with the suggested change of my _policy.txt file, I dont get any errors other than a GPS Error: Timeout. I do have vision and had the phone outdoors with clear line of sight to the sky. |
| Cristian Streng wrote: |
| I have another alpha version available at http://wap.mgmaps.com/alpha3.html. I hope you'll be able to at least start this one. Anyway, can you try GpsTester first? - http://www.shaftek.org/projects.shtml in the New Download section
Cristian |
| goesh wrote: | ||
This version does launch, but I get no location data. DEBUG: An exception has occured! Exception class java.lang.illegalArgumentException, message: Invalid number of fixes, |
| arpruss wrote: |
| And other post says that there are costs for doing GPS fixes, and these need to be discussed with Sprint by the developer. And only Sprint partners are allowed to use location services. It sounds like they've decided to lock things by locking the access to the PDE server. |
| Cristian Streng wrote: |
| We'll see about this... I'm still not convinced that I need to put in the server IP in the application, maybe we can find a workaround. There's an earlier post in this topic - http://forum.mgmaps.com/viewtopic.php?p=270#270 - that guy says he was able to install GpsTester AND get valid coordinates.
There are also some (more complicated) instructions to unlock the program at the beginning of this thread, they direct to this page. I think whoever tests MGMaps should first try to install and use GpsTester to get valid coords, then move on to MGMaps. |
| Cristian Streng wrote: | ||
Oh, and another thing... maybe you need to wait a bit longer to get the first coordinates. Try to start MGMaps, start the GPS code (have GPS Device configured to Internal) then leave the app running for 10-15 minutes - maybe it helps. Same with GpsTester. |
| goesh wrote: |
| I have followed the instructions for editing the index files on the phone, I got nothing working doing it that way, in fact, Iwouldnt even get a GPS timeout error. arpruss' instructions about editing the _policy.txt file seems to be the most promising, for the A920 I have anyhow. As arpruss aluded, it did update the index files acordingly.
Also, just as an FYI, about a month ago I installed AllSportGPS for location data, this program does successfully access the GPS data. The only downside is that it does cost $6.99/month. However, the GPS data is very accurate and works very well. I took arpruss' suggestion about getting a fix from the paid program then quickly switching over to either GpsTester.jar or MGMaps, same result, GPS Timeout. |
| arpruss wrote: |
| I tried a modified GpsTester set to connect to an ip address and port number on my server. I then listened for a connection on my server with nc -v, but nothing happened. That may just be because I don't have vision (but vision doesn't seem to be required for GPS). |
| Cristian Streng wrote: | ||
Did you try TCP? Maybe it uses UDP instead... or maybe it uses TCP but the Sprint server filters the packets (if that is the case, set GpsTester to connect to TCP port 80 on your server, it will just be a bit more difficult to filter the GpsTester connection from regular web traffic). |
| Cristian Streng wrote: |
| We'll see about this... I'm still not convinced that I need to put in the server IP in the application, maybe we can find a workaround. There's an earlier post in this topic - http://forum.mgmaps.com/viewtopic.php?p=270#270 - that guy says he was able to install GpsTester AND get valid coordinates. |
| errr0r wrote: |
| Arpruss, talk to me on AIM. We will work on this together.
AIM: pc2pctransfer Time: sometime tonight 9pm-ish EST. |
| arpruss wrote: |
| Looking at Sprint dev forums, it looks like in mid January Sprint made some changes that restricted access to location data, and thereby they locked out GpsTester. What's interesting is that that post was made several months after that. But maybe that poster was describing something done before mid-January... Can you contact that poster to see if GpsTester is STILL working? |
| mikelee wrote: |
| It seems to give correct coordinates but it doesn't stay correct. If I have it set to move the map with what GPS coordinates it gets, it'll be correct for one moment and then it shifts to many blocks off. I'll have to observe it more to see what's happening. I'll mess with the intervals to see if that makes a difference. Maybe I have it set to not wait long enough. I've noticed that my phone takes a while to get GPS coordinates and sometimes it's not correct. This happens with commercial programs that use the internal GPS. |
| arpruss wrote: |
| Where did you get the IP address? |
| Code: |
| if(command == setCustomCommand)
{ short port = 5017; Gps.setTransportProtocol(0); Gps.setServerType(1); Gps.setCustomServerConfig(convertIpAddressToInt("68.28.31.49"), port); } |
| Code: |
| try {
Gps.startSession(this); Logger.debug("GPSQJAE started"); // one-shot Gps.setOptimizationType(Gps.OPTIMIZE_FOR_ACCURACY); Gps.setQoS(31); // max 31 seconds for a fix Gps.requestPosition(Gps.SVC_TYPE_ALL); // tracking Gps.setOptimizationType(Gps.OPTIMIZE_FOR_ACCURACY); Gps.setQoS(31); Gps.requestPositionTrack(Gps.SVC_TYPE_ALL, 65500, (UPDATE_INTERVAL<<1)/1000, Gps.TRACK_NETWORK); } catch (Exception ex) { Logger.handle(ex, false, "Error initializing Qualcomm location services"); } |
| Code: |
| public void handleEvent(GpsEvent gpsevent)
{ if (gpsevent instanceof GpsPositionEvent) { GpsPositionEvent ev = (GpsPositionEvent) gpsevent; updatedPos = new GPoint(ev.getLongitude() * 10, ev.getLatitude() * 10); Logger.debug("GPS: Lat: " + updatedPos.y + " / Long: " + updatedPos.x); } else if (gpsevent instanceof GpsErrorEvent) { GpsErrorEvent ev = (GpsErrorEvent) gpsevent; Logger.error("GPS: Error: " + ev.getMessage()); } } |
| sakha wrote: |
| P.S. I think we probably need to get the GPS fix a few times like maybe 3 times or so and then get an average, because when i did get the lat/lon info it was off by 1/4 mile sometimes. |
| Cristian Streng wrote: |
| I don't think the port is related to the developer (developer of what? isn't that some phone setting? is it separately configurable for each app?). I'm more inclined to believe it has to do with the actual location of the phone owner, for load balancing reasons - something like a zip code... |
| arpruss wrote: | ||
In new Sprint phones, the values are not set at all, and must be set by the developer of a GPS enabled app. So I don't know if it has to do with the phone or what. I don't know where the values that were posted here were originally extracted from--maybe from some app? (But I may be completely confused.) |
| Cristian Streng wrote: | ||||||||||
I have de-compiled the GpsTest.jar archive from sakha (it was not obfuscated), and got:
I googled 68.28.31.49, and I ended up here. I guess it explains how to use that Universal PST software to get or change various settings, including this IP address. Now my questions: 1. Are the IP/port fixed? common for all phones? are they different for each phone? The port in that article linked above is different from the port sakha gave. If that's the case I should probably leave them configurable in the application. 2. As I understand, a single call to Gps.setCustomServerConfig should be enough, right? My code currently looks like this (the update interval is set to 2000, I hope it's in milliseconds
and then:
The rest of the code does not use any QJAE specific functionality, it just uses the value in updatedPos whenever it is set by handleEvent.
I think this is not a solution, it probably has to do with the fact that the Sprint phone is not a very accurate GPS receiver. It could also have to do with the optimization type or QoS set. Cristian |
| arpruss wrote: |
| I sent Sprint a query whether it's OK to use this address.
By the way, someone sent me the same IP address by email, with a different port number. And the port number on the site that you get googling the IP address is different again. I worry a bit that maybe Sprint assigns different port numbers to different "official" developers and then tracks usage, so by using this we might be causing charges to some other developer. |
| arpruss wrote: |
| Interestingly, the PDE protocol looks like it's fully documented:
http://www.3gpp2.org/Public_html/specs/C.S0022-0_v3.0_121203.pdf |
| sakha wrote: | ||
Here is the hexdump of the data that the phone sent to a spoof server i was running on port 5017 on my home machine if anyone is interested in it and can make any sense from it. $ hexdump.exe -d PDE_DATA.dat |
| Code: |
| private static final int NET_IPADDRESS = 1142693681; // 68.28.31.49
private static final short NET_PORT = 5017; ... Gps.setTransportProtocol(0); Gps.setServerType(1); Gps.setCustomServerConfig(NET_IPADDRESS, NET_PORT); |
| Cristian Streng wrote: | ||
OK, I have a new version available at http://wap.mgmaps.com/alpha3.html, I added these lines to the constructor of GPSQJAE:
Hope it helps Cristian. |
| arpruss wrote: | ||||
Could you post a hex dump instead of an octal dump? (-t x1) Thanks a lot! Alex |
| sakha wrote: |
| The other problem is also that the midlet permission have to include com.qualcomm.qjae.gps.Gps could you possibly put that into the JAD file and also the MANIFEST file under META-INF in the jar file.
Oh I just decompiled your alpha-3 jar looks like the changes are not there, maybe you forgot to put the correct jar. |
| Cristian Streng wrote: | ||
I don't think you got the right files. Maybe you had the old ones cached. The com.qualcomm.qjae.gps.Gps permission is included in the JAD and in the manifest, also the changes are in the jar (class aj). |
| arpruss wrote: |
| Sachin:
Out of curiosity, is this working without any editing of the policy file on your handset, and without signing, just with developer access enabled? Alex |
| sakha wrote: | ||
Alex, Nope it works cause I have edited the policy file on the handset and also enabled developer root. |
| arpruss wrote: | ||||
Actually if you edit the policy file, then you don't need developer root at all, I think. I may be paranoid, but I am afraid that editing the policy file might violate the DMCA, in that it may count as circumventing Sprint's/Qualcomm's access controls on their copyrighted qjae classes. (The DMCA is bad law, but alas it is law.) |
| sakha wrote: |
| I would say if we can somehow use a Thwate or Verisign self signed certificate... |
| Cristian Streng wrote: | ||
It makes no sense. A self-signed certificate is a certificate where the signer (the CA) is the same as the certificate issuer. When you generate a self-signed certificate you create a CA and issue a certificate, then you sign it. Cristian |
| sakha wrote: |
| Now the sprint developer forums clearly state that we need a $400 verisign certificate for putting an app on the phone without each user having to enable the developer root on their phone, I am looking into checking whether a Thwate certificate would work instead, if the Thwate certificate works ( i can try to use a personal certificate) then we dont need the $400 verisign certificate. I can try that out on my wife's phone which is not developer enabled.
|
| sakha wrote: |
| you are right, what i said made no sense, what i wanted to saywas that if we could get a free email certificate from someone like Thwate and try o use that to sign the application then we could see if it works, meaning if the Verisign Certificate that sprint is asking for us to purchase is just hoopla and whether a free Thwate Email certificate could work instead.
The reason i say this is because i saw a Thwate Certificate installed on my phone alongwith a Verisign certificate. Thx -Sachin |
| Cristian Streng wrote: | ||
I understand now, but I doubt it would work. These companies usually have a lot of CAs defined, with each CA for a specific purpose (web server cert, mail cert, code signing cert, etc.). The free certificates are most likely checked against a separate authority, which is not imported by the phone. It would be great however if we could import or add root CAs to the phone CA database - that can be done on some Nokia/Symbian phones as described here. I'll try to set up a certificate and upload it on my server, set the content-type and everything and then see if it works. Cristian |
| sakha wrote: |
| I dunno seems like the _policy.txt file is just some convinience thing, I reset my _policy.txt file to the original one, which did not have permission for untrusted application, now when i check the permissions for the GpsTester App it shows "Never Allow" for everything including network, location, filesystem, bluetooth. Still the application works like a charm.
I would say if we can somehow use a Thwate or Verisign self signed certificate, we dont need to jump any hoops and still be perfectly legally doing this, of course that still leaves the PDE server IP/Port usage question unasnwered. Thx -Sachin |
| chris52131 wrote: |
| I have been following this thread and I thought I'd jump on. I have a new KRZR k1m on Sprint in the US. I have figured out how to use BitPim and edit files and have tried several versions of mobile gmaps on my phone but none of them can access the internal GPS. I registered my phone as a developer handset and I'd like to test a new version that is signed by a certificate as soon as it is available. I can't find the _policy.txt on my filelist, the brew folder does not contain it nor do any of its subdirectories.
If anyone knows what the _policy.txt file is called on this handset, let me know. Also as soon as new versions of mobilegmaps are posted on this forum I'll be testing them and providing my feedback. Thanks! |
| sakha wrote: | ||
Hi chris, I dont know about your specific phone model, but on my phone the _policy.txt file is located under brew/mod/obione folder. I would suggest that you should look through all the folders. Also I checked up phonescoop.com your phone KRZRk1m supposedly has builtin AGPS and is LBS aware. Having said that it could be using the motorola location api and not the sprint one, if that is the case i would suggest that you try the motorola version of MGMaps. The other thing you could do is if you have the OnDemand application bundled on your phone then you could try to use it to check out the weather or the maps service within that to see if GPS works on your phone. As far as a signed version of this application goes, I guess might never happen since signing an applet requires the application creator to buy a $400/yr Hope this helps. Please lemme know if you have any questions. -Sachin |
| Quote: |
| "It would be great however if we could import or add root CAs to the phone CA database - that can be done on some Nokia/Symbian phones as described here. I'll try to set up a certificate and upload it on my server, set the content-type and everything and then see if it works." |
| arpruss wrote: |
| Bad news: Sprint tells me they cannot condone unauthorized use of GPS on the Sprint network, and they recommend Nextel instead. So I'm out of this discussion: I don't want to use Sprint's server against their will (that's wrong and perhaps even a crime). |
| Cristian Streng wrote: | ||
Hmm... I kinda expected this. I also thought Sprint and Nextel were the same thing. |
| arpruss wrote: |
| They don't like editing the access file on the handset either: "You'd basically be hacking the phone and if you do that and damage your phone, you'd have no recourse to fix it. The signing protocol is put in place for the protection of customers and our network. Any known violations of this policy are referred to the Sprint corporate security department for investigation. " |
| Cristian Streng wrote: | ||
Hmm... I kinda expected this. I also thought Sprint and Nextel were the same thing. |
| sakha wrote: |
| Also the big question of signing the app instead of hacking the _policy.txt file still remains, I wonder if there would be a way of using a Thwate free email signing certificate to sign the midlet to make it work. I have seen that my phone contains a Thwate certificate in addition to the Verisign one. Can people with other phones confirm what kind of certificates they see on their phones. |
| sakha wrote: |
| One of the BIG questions I had was, how much is having the GPS a critical feature? The reason I ask is that since MGMaps does not support turn-by-turn directions right now i dont know how getting the GPS fix helps us right now. |
| sakha wrote: |
| Also Cristian, I was wondering how hard would it be to zero in to a map location based on an address or intersection punched in to MGMaps, google maps pc version and i guess their mobile version too, has this feature. |
| Cristian Streng wrote: | ||
I don't think it will work. Usually every big cert. provider (Verisign, Thawte, Equifax, etc.) has a set of different CA definitions for different purposes: email, web, code, etc. It's most likely they can't be interchanged, but it's worth a try. |
| Cristian Streng wrote: | ||||
I'm afraid I don't quite understand everything here. MGMaps is fully functional on Sprint phones except for the GPS features. Still it remains a very important feature, as it's one that differentiates it from other apps (like the official google maps).
What do you mean by this? Would you like to enter coords and go to that place? You can do that in MGMaps. Would you like to search for an address and move the map to that address? You can do that, it's implemented. Cristian |
| sakha wrote: |
| The reason i think it might actually work, is because it is the AMS ( Application Management System) on the Sprint phones, which controls if an application which has a JAD file requesting permissions for any of the restricted API's get installed on the phone or not. Once an application is installed then the AMS does not check if it has the right permissions to access the restricted API's that is the reason why the MGMaps application works after changing the policy file to install it and then the policy file is changed back to its original state.
Also I believe the AMS on sprint phones probably just checks if the app is signed by a verisign or thwate root cert. |
| arpruss wrote: | ||
I think that's not correct, but I could be wrong. You can always install apps directly via a USB cable, and then, I assume, there is no permissions check, but unsigned apps still don't work. I think what happened was that when you edited the policy file and installed, the index file for the app got modified with a note about the jar file being allowed to access these APIs. When the policy file got changed, the index file stayed the same. |
| jerm wrote: |
| So I originally purchased the Samsung A920 phone specifically because I thought the Java OS would be more versatile for this type of thing than the alternative Brew OS, like on the A900. Was I incorrect? BitPim has no support for the A920, and I'm not clear on how to get this thing unlocked. I registered this phone as a devel device... apparently, there's more I need to do. Dying to try/test the app, just need to know how to get my a920 to allow it.
thx- Jeremy |
| Cristian Streng wrote: |
| Thanks for letting me know, I'll probably make an "official" release for Sprint soon. Maybe you or someone else can write some instructions for newbies on how to enable Sprint developer access...
Cristian |
| mystica555 wrote: |
| For what its worth, even if BitPim does not "support" your phone, it is still quite able to view the filesystem and make the same sort of changes QPST is able to make, with the added benefit of being Free software, rather than pirated proprietary software. (Free as in 'free speech', not just cost)
Mike |
| sakha wrote: |
|
To whoever reported that the GpsTester was not working, you need to get a modified version of the app, which specifies the sprint location server and port, not the stock app. Cheers again for such a nice app. And while we are on that topic, may i suggest another really nifty app ORB ( google for it) which lets you stream music and video to your phone from you home PC, including even internet radio and TV, i use it all the time and i luv it. Thats it for now. -Sachin |
| sakha wrote: |
|
mystica555, really? id did not know that, i tried hard to use BitPim but it refuses to communicate with my phone, a SAMSUNG A920, cause i would luv to use that one instead of the QPST ( which like you pointed out correctly is priated propreitery software ) can you instruct me how to use BitPim to communicate with my phone i mean what settings do i use etc. Cheers -Sachin |