Page 2 of 10 FirstFirst 1234 ... LastLast
Results 21 to 40 of 193

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


Thread: Free Cydgets

  1. #21
    I have to say I very, very much apprecipate your cydget/cycript lessons. It is a lot to take in for somebody who has an idea what Objective-C can do, but not a clue about the programming language.
    I have 2 suggestions, but they are more of personal interest, then "mainstream".
    1.) how to execute shell scripts using cycript?
    2.) can the "writeToFile" being used to save a xml/json response file?

    And two more off topic question, can cycript also being used for Swift code?
    Finally, this depends on the future development (if cydget adopts WKWebView and the inability for javascript to read local files still exists) and is more theoretical, can cycript being used to read local files, e.g. xml, json, plist?

    PS I have to support the suggestion from reddit for you to write a cydget/cycript tutorial. Even though it involves html, css and javascript, leave these out and assume a certain basic knowledge of them. This would be true for most themers. What they, including me, struggle is the cydget/cycript part.
    There is not as much coverage of this subject as there is for other languages (html, css and javascript) and most definitely not in ONE place.
    Don't do a "do this, then do that" style tutorial. Everybody can follow those steps but they don't know why they are doing it. Take simple examples, like above, with just one feature and explain why what needs doing to achieve the goal with code example. People that are seriously interested will have the motivation to dig deeper and that's how you learn.
    Last edited by rasputin007; 2015-01-15 at 09:30 AM.
    Nothing is impossible only miracles take a bit longer!

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

    June'sIphone (2015-01-15)

  3. #22
    Quote Originally Posted by rasputin007 View Post
    1.) how to execute shell scripts using cycript?
    I've never needed to run a shell script with cycript, so I have no idea. Would be a question for Saurik or maybe Google.

    Quote Originally Posted by rasputin007 View Post
    2.) can the "writeToFile" being used to save a xml/json response file?
    Sure xml is much is very similar to a plist. In an old version of LockBuilder I had an iconoclasm maker which would allow you to move icons then save a plist. To make an xml would be very similar. Even now in LockBuilder all themes are 1 plist. The plist stores all the values for a theme, then I just read them like a normal object in javascript.

    Code:
    function makeplist(){
        LBEvoIcono = [[NSMutableDictionary alloc] init]; //create a dictionary 
        array=[[NSMutableArray alloc] init]; //create an array
        var mobj = localStorage.getItem("icono"); // where I stored x and y coordinates from icons
        if(mobj){ 
             obj=JSON.parse(mobj); //turn the localStorage back to an object  
         }
         $.each(obj, function (key, value) { //loop over each key in the object
            ids=value.name;
            x=value.x;
            y=value.y;
    
        ids=[NSMutableDictionary dictionary]; //call the dictionary
        [ids addObject:[NSNumber numberWithInt:x] forKey:@"x"]; //add number for key x
        [ids addObject:[NSNumber numberWithInt:y] forKey:@"y"]; // add number for key y
        [array addObject:ids]; // add objects to the array
    
    });
          [LBEvoIcono setObject: array forKey: @"Origins"]; create Origins in the dictionary and add the array
           saveDir = "/Library/Iconoclasm/Layouts/"; //where to save plist
           plistName = @"LBEvoiPad.plist" // name of plist could changed to .xml
           filePath = [saveDir stringByAppendingString: plistName]; //complete dir and name
           [LBEvoIcono writeToFile: filePath atomically: YES]; // write the file
            [LBEvoIcono release]; // release the dictionary
    }

    Which would create a plist like this.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Origins</key>
    	<array>
    		<dict>
    			<key>x</key>
    			<integer>152</integer>
    			<key>y</key>
    			<integer>167</integer>
    		</dict>
    	</array>
    </dict>
    </plist>
    I haven't tried creating an xml, but should be easy to do. Actually had a few requests to write the WW xml, which I felt was a waste of time and would add unnecessary code to my projects.

    Quote Originally Posted by rasputin007 View Post
    And two more off topic question, can cycript also being used for Swift code?
    Would be another question for Saurik, but I believe I saw a video of him using Swift code in cycript.

    Actually here is the video



    Quote Originally Posted by rasputin007 View Post
    Finally, this depends on the future development (if cydget adopts WKWebView and the inability for javascript to read local files still exists) and is more theoretical, can cycript being used to read local files, e.g. xml, json, plist?
    If Cydget adopts WKWebView, Cycript would have to run in a background process and not SpringBoard.

    "Note that if Cydget uses WKWebView, then the Cycript code would have to be run in the background process and not SpringBoard, which would make a lot of what it does more frustrating." - Saurik

    Hard to say at this point, but I would hope we wouldn't lose any Cycript abilities. Read and write files is very simple so I don't see why we would.

    Quote Originally Posted by rasputin007 View Post
    PS I have to support the suggestion from reddit for you to write a cydget/cycript tutorial. Even though it involves html, css and javascript, leave these out and assume a certain basic knowledge of them. This would be true for most themers. What they, including me, struggle is the cydget/cycript part.
    There is not as much coverage of this subject as there is for other languages (html, css and javascript) and most definitely not in ONE place.
    Don't do a "do this, then do that" style tutorial. Everybody can follow those steps but they don't know why they are doing it. Take simple examples, like above, with just one feature and explain why what needs doing to achieve the goal with code example. People that are seriously interested will have the motivation to dig deeper and that's how you learn.
    I will keep this in mind. I do have the basic procedure I use over and over to find code to use in these cydgets. Cydgets: Searching headers to use in cycript This is basically the same thing I did to find this weather hook. What it took was me almost memorizing all of the weather headers. Once I had a full picture of the puzzle I could slowly start adding pieces together. Which in the end was a very small part of code, but not knowing how Apple used each header was the hard part.

    Basically it's not learning obj-c it's just finding a hook or sending a message that returns the value you want. For things like creating a plist (more about obj-c) I would just google it, look at peoples example code, or Apple's documentation. Then try to repeat it in Cycript. Compare this iphone - How to write data in plist? - Stack Overflow or https://developer.apple.com/library/...00048i-CH5-SW1 to my code above (for writing a plist) and you will see they are very similar.

    The other very difficult part is I have a 1mb connection. If I was to do a video showing the process you would be amazed the patience I do have lol. You would need patience to sit through the page loading or cycript trying to connect to my phone. Also I would like to mirror the device as well. At this moment in time I don't think it's very possible.
    Last edited by June'sIphone; 2015-01-15 at 11:07 AM.

  4. The Following User Says Thank You to June'sIphone For This Useful Post:

    rasputin007 (2015-01-15)

  5. #23
    Livin the iPhone Life V3RSAC3PYTHON's Avatar
    Join Date
    Jan 2015
    Location
    North Mississippi
    Posts
    1,059
    Thanks
    938
    Thanked 642 Times in 403 Posts

    Anyway to disable default unlock on the day 3 cydget?

  6. #24
    Quote Originally Posted by V3RSAC3PYTHON View Post
    Anyway to disable default unlock on the day 3 cydget?
    Already answered on the previous page.

  7. #25
    Livin the iPhone Life V3RSAC3PYTHON's Avatar
    Join Date
    Jan 2015
    Location
    North Mississippi
    Posts
    1,059
    Thanks
    938
    Thanked 642 Times in 403 Posts

    Im sorry, i missed it. Thanks

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

    June'sIphone (2015-01-15)

  9. #26
    I use shell script, see http://modmyi.com/forums/file-mods/8...ml#post7195980, to update my weather.xml file from WeatherUnderground. It runs on a infinite loop every 5 minutes and gets started with LaunchDaemon at every reboot. However during times of being locked it does not always update every 5 minutes. If cycript could run this shell script (without infinite loop), then the LS loads the last downloaded weather.xml file, aka instant LS display as no url calls are being made, but at the same time in the background the shell script downloads the newest weather for the current GPS (thanks to cycript). So all it needs is an "Update" touch on the LS. That is one path of the idea.
    I tried cgi-bin, which can run shell scripts, but only very simple ones. That was the same case with starting shell scripts through a home screen icon, which worked, but again with very simple shell scripts.
    I got a Settings menu for WeatherUnderground, an earlier version of that can be seen at GPS and weather update - MobileModding.US, since then I also added the 80+ languages in which Weather Underground can be downloaded. Is much better as I don't need any translation files. The shell script reads the values from that resulting plist file and use them to fetch the weather.xml file.
    That all because I don't like WW or better weather.com, which is utter crap here in the UK.
    I did that a long time ago, where a shell script on the iPhone would download any weather html you could see on your computer, with some "sed" magic it would rebuild that computer html page into a nice scrollable table on the LS.
    Shell scripts are very very powerful!

    I tried to get the header from the Living Earth app with class dump, but surprise, surprise it is an encrypted app unlike stock apps. Saurik's gdb is too old to do this but there is an example on how to get a more updated gdb youself from iH8sn0w. Just have to find the time to carry on with this.
    Last edited by rasputin007; 2015-01-15 at 09:27 PM.
    Nothing is impossible only miracles take a bit longer!

  10. #27
    What's Jailbreak? Suraj HD's Avatar
    Join Date
    Jan 2015
    Location
    New York
    Posts
    8
    Thanks
    2
    Thanked 8 Times in 5 Posts

    hey June i was wonder how could i put together something like this. just adding the notification icons -img_1214_zps0d0e4368.png

  11. #28
    Quote Originally Posted by Suraj HD View Post
    hey June i was wonder how could i put together something like this. just adding the notification icons -img_1214_zps0d0e4368.png
    Have you attempted doing this yet? If so where did you get stuck?

  12. #29
    Quote Originally Posted by rasputin007 View Post
    I use shell script, see http://modmyi.com/forums/file-mods/8...ml#post7195980, to update my weather.xml file from WeatherUnderground. It runs on a infinite loop every 5 minutes and gets started with LaunchDaemon at every reboot. However during times of being locked it does not always update every 5 minutes. If cycript could run this shell script (without infinite loop), then the LS loads the last downloaded weather.xml file, aka instant LS display as no url calls are being made, but at the same time in the background the shell script downloads the newest weather for the current GPS (thanks to cycript). So all it needs is an "Update" touch on the LS. That is one path of the idea.
    I tried cgi-bin, which can run shell scripts, but only very simple ones. That was the same case with starting shell scripts through a home screen icon, which worked, but again with very simple shell scripts.
    I got a Settings menu for WeatherUnderground, an earlier version of that can be seen at GPS and weather update - MobileModding.US, since then I also added the 80+ languages in which Weather Underground can be downloaded. Is much better as I don't need any translation files. The shell script reads the values from that resulting plist file and use them to fetch the weather.xml file.
    That all because I don't like WW or better weather.com, which is utter crap here in the UK.
    I did that a long time ago, where a shell script on the iPhone would download any weather html you could see on your computer, with some "sed" magic it would rebuild that computer html page into a nice scrollable table on the LS.
    Shell scripts are very very powerful!

    I tried to get the header from the Living Earth app with class dump, but surprise, surprise it is an encrypted app unlike stock apps. Saurik's gdb is too old to do this but there is an example on how to get a more updated gdb youself from iH8sn0w. Just have to find the time to carry on with this.
    I don't see why you need a shell script. You have the url http://api.wunderground.com/api/$API$ALERT$ASTRO$CONDI$FORE$FORETEN$HOUR$HOURTEN/lang:$LANGU/q/$LAT,$LNG.xml just replace the variables with javascript variables, pull the other info such as lat and long from cycript and that's all you need. As I mentioned before I have no need for a shell script, i've only used it to change permissions of folders and require a respring after installed from cydia so my expertise is minimal at best.
    Last edited by June'sIphone; 2015-01-15 at 10:10 PM.

  13. The Following User Says Thank You to June'sIphone For This Useful Post:

    rasputin007 (2015-01-16)

  14. #30
    What's Jailbreak? Suraj HD's Avatar
    Join Date
    Jan 2015
    Location
    New York
    Posts
    8
    Thanks
    2
    Thanked 8 Times in 5 Posts

    Quote Originally Posted by June'sIphone View Post
    Have you attempted doing this yet? If so where did you get stuck?
    could i attempt it on an iphone in ifile? because im at work for the next 5 hrs. i have a feeling all i would have to do is just take the notification portion of the code and just find the right place to put in the lockscreen. that would be my approach to doing this. the most experience i have with this stuff is just editing some files and there values.

  15. #31
    Day 6

    Last edited by June'sIphone; 2015-01-15 at 10:26 PM.

  16. The Following User Says Thank You to June'sIphone For This Useful Post:

    dmick89 (2015-01-16)

  17. #32
    Quote Originally Posted by Suraj HD View Post
    could i attempt it on an iphone in ifile? because im at work for the next 5 hrs. i have a feeling all i would have to do is just take the notification portion of the code and just find the right place to put in the lockscreen. that would be my approach to doing this. the most experience i have with this stuff is just editing some files and there values.
    You could attempt via iFile, but even I find it very difficult to code in iFile. You have the gist of it, basically move all the parts from the notification cydget and add them to that cydget. Css would go in the <style> tag, divs for the icons and notifications would go in the <div id="pagewrap"> section, Cycript code would go in the <script type="text/cycript"> section.

  18. #33
    I got a problem!
    I have a simple LS with GPS display which is determined by cycript (you know the code).
    Works fine and writes to files every time.
    However if I incorporate that little bit of working code into another LS cydget it no longer works. Identical code, but the other LS cydget uses Jquery. Could that be the problem?
    Nothing is impossible only miracles take a bit longer!

  19. #34
    Quote Originally Posted by rasputin007 View Post
    I got a problem!
    I have a simple LS with GPS display which is determined by cycript (you know the code).
    Works fine and writes to files every time.
    However if I incorporate that little bit of working code into another LS cydget it no longer works. Identical code, but the other LS cydget uses Jquery. Could that be the problem?
    jQuery should not effect it at all. What exactly is failing? Just to be sure, did you make sure a cycript url is declared in the info.plist?

  20. The Following User Says Thank You to June'sIphone For This Useful Post:

    rasputin007 (2015-01-16)

  21. #35
    Quote Originally Posted by June'sIphone View Post
    Day 3

    On this one (day 3) how can I change the image in the circle after I've already set one. I set the wrong one on accident, and can't figure out how the heck to change it again.

    Thanks!

    Nevermind, figured it out, clicked on the image three times (not sure if I needed to three times) and it pulled up the camera roll settings to change it.
    Last edited by raeldude; 2015-01-16 at 03:06 AM.

  22. #36
    Hi Junes,

    I'm very interested in your Day 2 Cydget and just wondering how could I move the battery info, date and weather a bit closer? The original one is not really appeal to me because of this. I saw your tutorial video it was pretty close at first so please guide me how to modify it.

    Thank you

  23. #37
    Quote Originally Posted by wishmeluck View Post
    Hi Junes,

    I'm very interested in your Day 2 Cydget and just wondering how could I move the battery info, date and weather a bit closer? The original one is not really appeal to me because of this. I saw your tutorial video it was pretty close at first so please guide me how to modify it.

    Thank you
    date is named #date, battery is named #batteryicon and #battery, weather icon is named #weathericon and the temp is named #temp.
    top: controls how far away the item is from the top in pixels go up in the number and it will move down, go down in the numbers and it will move up, left controls how far away the item is from the left lower number moves left, higher number moves right.

  24. The Following User Says Thank You to June'sIphone For This Useful Post:

    wishmeluck (2015-01-16)

  25. #38
    Quote Originally Posted by raeldude View Post
    On this one (day 3) how can I change the image in the circle after I've already set one. I set the wrong one on accident, and can't figure out how the heck to change it again.

    Thanks!

    Nevermind, figured it out, clicked on the image three times (not sure if I needed to three times) and it pulled up the camera roll settings to change it.
    If you press in the center it should only take one press.

  26. #39
    Livin the iPhone Life V3RSAC3PYTHON's Avatar
    Join Date
    Jan 2015
    Location
    North Mississippi
    Posts
    1,059
    Thanks
    938
    Thanked 642 Times in 403 Posts

    Hey june, how to get the time not to have zero if <9 ? I see code just cant figure out how to put it lol

  27. #40
    Quote Originally Posted by June'sIphone View Post
    jQuery should not effect it at all. What exactly is failing? Just to be sure, did you make sure a cycript url is declared in the info.plist?
    What a plonker I am, LOL.
    But that was not the solution.
    I finally got it working. I think the problem was a $function() call that starts a couple of functions in jquery (did not use body onload tag).
    However now I made the 2 function calls AFTER the cycript has finished, which get started with body onload=("UW()" tag and that seems to do the trick.
    Nothing is impossible only miracles take a bit longer!

Page 2 of 10 FirstFirst 1234 ... 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
  •