Page 7 of 9 FirstFirst ... 56789 LastLast
Results 121 to 140 of 171

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: MYO5 Lockscreen cydget for iOS 8

  1. #121
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Default MYO5 Lockscreen cydget for iOS 8
    Thanks, Ras. I read a lot about trying to feign a different user agent in js or shell scripts in iOS and it's pretty hard.. As you'll see I did exactly what you asked.. And yet the OVER QUERY LIMIT error message lingers.. And yet when I use Mobile Safari itself it has no trouble getting the response from Google. Just can't get it to work in my widget's live call from iWidgets - nor in your widget to the address.xml. Only logical answer is they're blocking my phone by a specific userAgent call type.. If it were by MAC address, even Mobile Safari couldn't retrieve the data.. Right?

    These results below in these screenshots also indicate only one logical conclusion: that the code you had me add to the .sh didn't effectively change userAgent in the script.

    Any other tests? (By the way I've uninstalled and reinstalled your tweak several times and done various resprings and reboots and iCleaner cleanings.. Removal of prefs files.. Are there any cookies I should remove?





    Last edited by NewD; 2015-03-22 at 08:28 PM.

  2. #122
    Quote Originally Posted by NewD View Post
    Thanks, Ras. I read a lot about trying to feign a different user agent in js or shell scripts in iOS and it's pretty hard.. As you'll see I did exactly what you asked.. And yet the OVER QUERY LIMIT error message lingers.. And yet when I use Mobile Safari itself it has no trouble getting the response from Google. Just can't get it to work in my widget's live call from iWidgets - nor in your widget to the address.xml. Only logical answer is they're blocking my phone by a specific userAgent call type.. If it were by MAC address, even Mobile Safari couldn't retrieve the data.. Right?
    Yepp, right!

    Quote Originally Posted by NewD View Post
    These results below in these screenshots also indicate only one logical conclusion: that the code you had me add to the .sh didn't effectively change userAgent in the script.
    If you tap /usr/bin/address-gps.sh in Filza, then "continue" you will see a terminal window like this

    Now that tells me that the User-Agent is no longer lynx.

    The error message talks about exceeding the daily limit, from that I would conclude that the next day you should have a new daily 2500 call limit, but this does not look like to be the case.

    What is the http protocol you use in mobile Safari? I can not see the full url address. Is it a http:// call (as being used in the shell script) or is it a https:// call as mostly used?
    Last edited by rasputin007; 2015-03-23 at 01:26 AM.
    Nothing is impossible only miracles take a bit longer!

  3. #123
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Quote Originally Posted by rasputin007;7243603
    What is the http protocol you use in mobile Safari? I can not see the full url address. Is it a http:// call (as being used in the shell script) or is it a http[B
    s[/B]:// call as mostly used?
    AHA!!! The url I was using in Mobile Safari was https !!!!

    When I switch that url to "http" in Mobile Safari IT ALSO READS Over Query limit!!!

    SOOOO next test is to change the url in yours and my tweak to https and see if that clears the block!

    Will write back after test..

  4. The Following User Says Thank You to NewD For This Useful Post:

    rasputin007 (2015-03-23)

  5. #124
    OK, now we found the cause of the problem.
    Next step is to find a solution.
    From my initial testing I know that lynx did not work with https protocol - you can try to change the http in the address-gps.sh file into a https, then tap the file in Filza and see what appears in the terminal window, and no content in address.xml.
    I have to see if I can find a way to use lynx with https.
    Nothing is impossible only miracles take a bit longer!

  6. #125
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Quote Originally Posted by rasputin007 View Post
    OK, now we found the cause of the problem.
    Next step is to find a solution.
    From my initial testing I know that lynx did not work with https protocol - you can try to change the http in the address-gps.sh file into a https, then tap the file in Filza and see what appears in the terminal window, and no content in address.xml.
    I have to see if I can find a way to use lynx with https.
    Test failed. address.xml is blank now with https

  7. #126
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    But the good news is that making the live call to https in my widget itself now works!! Don't know if they'll eventually lock me out of their secure server too but for now I'm happy. Haven't seen this in 2 weeks..

    But I still prefer your method of getting the data. So I'd appreciate you finding a Lynx solution if possible..


  8. The Following User Says Thank You to NewD For This Useful Post:

    mike42 (2015-03-23)

  9. #127
    That will not be so easy!
    Testing lynx with the https call in Linux works spot on, but yet in iOS it connects to secure server, then tries to connect without TLS (one secure protocol) and then loses connection.
    This is what the terminal says



    Have to figure out WHAT causes the difference behaviour running in Linux and iOS.
    Nothing is impossible only miracles take a bit longer!

  10. #128
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Default MYO5 Lockscreen cydget for iOS 8
    Quote Originally Posted by rasputin007 View Post
    That will not be so easy!
    Testing lynx with the https call in Linux works spot on, but yet in iOS it connects to secure server, then tries to connect without TLS (one secure protocol) and then loses connection.
    This is what the terminal says

    Have to figure out WHAT causes the difference behaviour running in Linux and iOS.
    Well, no pressure , of course, sir. The http protocol works fine for all people who haven't "overused" the API in their testing, as I have, enough for Google to blacklist my MAC address when using http.. Lol!!

    So my original theory was correct: It's a MAC address lockdown from Google (using the http url) on my phone and not a UserAgent restriction at all.. Agreed?

    Whatever you can do, my friend, with regard to your shell.. But zero pressure. You've already been so much help. Many thanks, Ras!

  11. #129
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Rethinking... It it were a MAC Address lock down then my widget and yours would ALSO NOT work on my phone when it were on a WIFI HotSpot- and yet they DO WORK on WIFI.. ONLY when on LTE/4G/3G on my phone using the http:// am I blocked.

    So the only other conclusion is that they've blocked the IP address that's autogenerated by my SIM connection to the towers.. In fact they've blocked a 'group' of IP Addresses.. because I read about a secret on a hacker forum that everytime you place your phone in Airplane Mode it refreshes the IP address assigned to your phone while on LTE/4G/3G. I was able to verify this two weeks ago when I started playing around. Each time I got the OVER LIMIT message I would go to airplane mode then back off again and the myipaddress.com website showed a different 'last number' in the IP address, and for a while your shell script AND my live call would start working again.

    I guess Google's servers are clever enough to figure out what I was doing - as the the Airplane mode on and off trick no longer works.. So my best educated guess is that my phone, on LTE, only uses 34.124.9.15-35.. when it accesses an IP.. So Google must have blocked all those IP's with 15-35 as the last number.. Seem logical?

    If it were my MACAddress that they blocked then on Wifi I'd also be blocked? Right?

  12. #130
    I still have not looked at the https problem with lynx on iOS yet. I am sure there is a solution, but not one that stares into my eyes and simply too busy for a lengthy trail & error session. LOL
    However I tried a different approach, which is quite funny.
    Remember the MMUS server link?
    That one does all the work for you, like the google address url call. If it runs on the MMUS server it will run on the iPhone Web Server.
    Now with some php "magic", the latitude, longitude and address can be saved in an xml file or txt file (ahhh choices!), ready for any theme/widget to be read.
    So how does this work, well, if the theme/widget does a url call to the iPhone Web Server, like
    Code:
    http://127.0.0.1/GetMyAddress.html
    which will get GPS and then the address for this GPS position, which will be "send" to a php file which saves them in a xml or txt file, which can be read by the theme/widget.
    If you now add a refresh interval to the GetMyAddress.html call the theme/widget will get an updated GPS/address each time. Needless to say that the reading of the xml/txt file also needs to be refreshed to get the updated data.

    Not sure if that helps in your quest, but this would be without cycript, LaunchDaemon, lynx and shell scripts.
    Just an alternative to get GPS & address, also this way it would not run all the time (like shell script), as it only needs to run when a theme/widget request it. That would mean even a lower refresher rate of 45 seconds would leave you below the daily limit.
    Nothing is impossible only miracles take a bit longer!

  13. #131
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Thanks, Ras. But that method sounds a little 'more' convoluted to me than the simpler shell script you wrote. It's likely running a widget inside another widget.. I'm already able to do refreshing at 45 sec in Javascript with a refreshTimer and now using https as my live url call api address in my widget I can get all the data I need again. I liked the idea of a script running in background that could print data to an xml. It seemed cleaner than doing a live call all the time.. but in the final analysis using the live call to Google based on the lat/long coordinates generated by WW is the cleanest least resource intensive method.. I liked your daemon method because it seemed cleaner resource-wise - but I'm not convinced of that now..

    Thanks for all your help! Please share any new ideas you have here. I like thinking 'outside the box' - as you do.

  14. The Following User Says Thank You to NewD For This Useful Post:

    rasputin007 (2015-03-30)

  15. #132
    OK, back to the original shell script.
    After some lengthy research it came down to a difference in lynx version. There has been a bug documentation about lynx problems connecting to https urls, which has been addressed in recent lynx versions. Sadly Saurik still has the "old" lynx version from 2007 in the repo.
    So no solution with lynx!
    However, if one path fails there is always, at least, another way to get where you want to go, one of the reasons why I love Linux.
    Lynx uses "curl" or it's libraries, so I looked into curl and got it working with https.
    Attached is the changed "address-gps.sh" shell script that goes in /usr/bin. Just copy and replace the existing address-gps.sh file, check it is executable, which it should be as you replaced an executable address-gps.sh file. It would not be executable when you delete the original and then copy the updated one.
    Should work fine, well, it does on my iPad.
    Attached Files Attached Files
    Nothing is impossible only miracles take a bit longer!

  16. The Following User Says Thank You to rasputin007 For This Useful Post:

    NewD (2015-03-30)

  17. #133
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Default MYO5 Lockscreen cydget for iOS 8
    Wow! You are a most resourceful fellow, Ras. Thank you so much! I did exactly as you described, file is executable by all 3 user groups.. Settings switch is on.. Rebooted twice. Still no address.xml file. I tried the command line trick in Fliza you taught me to force the creation of the address.xml to no avail. You mentioned 'curl'.. Did EricaUtilities download that for me? Do I need to get that from Cydia?

    This is the error message in mobile terminal that I'm getting..


  18. The Following User Says Thank You to NewD For This Useful Post:

    rasputin007 (2015-03-30)

  19. #134
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Default MYO5 Lockscreen cydget for iOS 8
    THAT WAS THE PROBLEM! As soon as I installed cURL and rebooted it began to work, Ras! The address.xml is populated with the data from Google. Wonderful! And thank you! May I ask, as you did for me last time, to create a new .deb file for easy installation? And that has EricaUtilities and cURL as dependencies?

    At your leisure of course.

  20. #135
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    And one last question-- where is the .sh file or .plist file where I can change the update time from :45 to some other number?

  21. #136
    Ah, yeah, these dependencies. You see I have cURL already installed, as I have almost all command line tools.
    OK, will make a deb file with dependencies.
    To change the refresh interval open /Library/LaunchDaemons/com.gps.location.switch.plist in Filza, Texteditor. Then change the <integer> value (currently 45) for the <key>StartInterval.

    EDIT
    Attached is the new updated deb file. Lynx has been replaced as a dependency with cURL. Use Cydia to uninstall "GoogleGPS", respring or reboot (better), then install googlegps_updated.deb. Reboot and all should be working.
    Attached Files Attached Files
    Last edited by rasputin007; 2015-03-30 at 07:31 PM.
    Nothing is impossible only miracles take a bit longer!

  22. The Following User Says Thank You to rasputin007 For This Useful Post:

    NewD (2015-03-30)

  23. #137
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Default MYO5 Lockscreen cydget for iOS 8
    Thank you VERY MUCH, sir!!

    Now I feel like we need a new mountain to climb.. It's who we are, Ras... Lol!

    First a technical issue.. When I turn off the OFF switch in the settings pane you built for the Google shell.. then turn it back in.. it takes a full reboot to start working again. Is there any way you can fix that? Or is it a limitation of shell scripts? As you test it on your iPad, flipping the switch off for a minute then back on, I don't doubt you'll be able to observe the address.xml updating with a new file modify time every :45 after the switch is back on.. BUT the data inside the xml, if you were traveling, is NOT updating. Until after a reboot..

    Now to something more fun.. As much as I love WidgetWeather - the Location iWidget I've been perfecting for the last year doesn't need all the weather data grabbed by WW, or, for that matter, by myWug. So riddle me this.. Can you, within the shell that's currently getting me Google data - get me yahoo's location data at the same time, same time interval, and write it to a separate xml file called, maybe "yahooaddress.xml"? Or would we need 2 separate shell scripts?

    The url used by WW to get its location data is:
    Code:
    http://query.yahooapis.com/v1/public/yql?q=select * from geo.placefinder where text="’lat,long’” and gflags=“R"&format=xml’
    If cURL can't use space bar character or certain punctuation.. Here's the no spaces url version..

    Code:
    http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text=%22%27lat,long%27%22%20and%20gflags=%22R%22&format=xml%27
    If I have to run 2 shells no prob.. But as I'm learning your shell syntax better it seems like it could be all in one shell.

    Let me know..
    Last edited by NewD; 2015-03-31 at 05:22 AM.

  24. #138
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Well interestingly, this morning when I flipped the switch for myGPS back on from it's off position it began updating the address.XML file immediately. So I'm not sure what was different yesterday. Maybe these shell scripts are finicky with regards to getting started. I think I remember you saying that early on in this process.

  25. #139
    Open /usr/bin/address-gps.sh and add the red line.
    Code:
    curl -k -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://maps.googleapis.com/maps/api/geocode/xml?latlng=$LAT,$LNG -o /var/mobile/Documents/address.xml 
    lynx -source 'http://query.yahooapis.com/v1/public/yql?q=select * from geo.placefinder where text="'$LAT','$LNG'" and gflags="R"&format=xml' > /var/mobile/Documents/yahoo.xml 
    fi
    I tried with curl, but lynx is better suited for this job.

    Usually the LaunchDaemon will run address-gps.sh every 45 seconds, no matter if switch is On or Off. The address-gps.sh script will check if that switch is On or Off, if Off it kills the whole process ID. If the switch is On, then it runs the cycript shell to get the GPS position and then fetches the xml files.
    Sometimes this can happen within 10 seconds after flipping the switch or it can take up to 45 seconds, depends when you flip the switch in the usual 45 second rhythm.

    Occationally, after a few days, it can happen that the update is "lagging" (also GPS & WUG), a quick reboot solves this. Don't know if iOS is getting suspicious about something "alien" running in the background and gets into a muddle, after all shell scripts are not iOS native, even though shell scripts are native to all UNIX systems and iOS is related to UNIX.
    Last edited by rasputin007; 2015-03-31 at 06:30 PM.
    Nothing is impossible only miracles take a bit longer!

  26. #140
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,709
    Thanks
    8,335
    Thanked 16,464 Times in 7,696 Posts

    Default MYO5 Lockscreen cydget for iOS 8
    Ah.. nice and simple.. Great! Thanks!.. Am testing now...

    EDITED: -- WORKED PERFECTLY, Ras.. A simple respring and the Yahoo.xml file was created.. I believe my widget is near completion.. Thanks for helping me imagine the 'cleanest' way to get ONLY the data I need..
    Last edited by NewD; 2015-04-01 at 04:53 AM.

  27. The Following User Says Thank You to NewD For This Useful Post:

    rasputin007 (2015-03-31)

Page 7 of 9 FirstFirst ... 56789 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •