tag:blogger.com,1999:blog-10812101756075485382024-03-13T11:41:46.978-07:00CydgetsAnonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1081210175607548538.post-84990843364238571292015-01-19T18:27:00.001-08:002015-01-19T18:27:10.220-08:00Getting Calendar Event with Cycript<span style="font-size: large;"><b>Testing in Cycript</b></span><br />
<span style="font-size: large;"><b><br /></b></span>
This is how I would go about finding the Calendar Event in Cycript.<br />
First I would look at Apple's documentation on the calendar. <a href="https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/EventKitProgGuide/ReadingAndWritingEvents.html">LINK</a> <- this can usually be found by searching their documents or using Google.<br />
<br />
Not far down this page you will see listing 1-1.<br />
<i>NSCalendar *calendar = [NSCalendar currentCalendar];</i><br />
<i><br /></i>
Easy enough here is how we can get the calendar object, it even shows us how to retrieve events. Lets work on altering this to run in Cycript. First log into cycript via terminal. To do this type in <i>ssh root@yourip</i> it will ask for your password enter it. Default password is <i>alpine</i>. Then type <i>cycript -p SpringBoard</i><br />
<i><br /></i>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGYmbZ4d2ughmW2_tLSD-XoqR4v_LB7Eb6VDTlTf59Xin1quieSNvulxPrVxPvbXIMgCfJINROARqHULKU87Qm4KkfSgRA0x5cTsKrN18zGquNgoBVx4_6dZKVMtI7gG5ZTnDXMg4FG6E/s1600/login.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGYmbZ4d2ughmW2_tLSD-XoqR4v_LB7Eb6VDTlTf59Xin1quieSNvulxPrVxPvbXIMgCfJINROARqHULKU87Qm4KkfSgRA0x5cTsKrN18zGquNgoBVx4_6dZKVMtI7gG5ZTnDXMg4FG6E/s1600/login.png" height="253" width="320" /></a></div>
<i><br /></i>
You are now logged into Cycript you can tell by the cy#<br />
<br />
We start adding what the Apple dev center says. As you see below I followed most of what the Apple site shown, only removing things which look like <span style="background-color: #f1f5f9; color: #666666; font-family: Courier, Consolas, monospace; font-size: 12px; line-height: 13.5020751953125px; white-space: pre-wrap;">NSCalendar *-</span> as we only need a variable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj7x80802v5vmr1WHJ_v7OlZQwpMLJjF_w0ryRGl-CcXi6QVdFYq-saLls90SnXqw30vq1GmNYpL1wJDbIFgbH0RHqpryMRCUhfudkIZV2yD_51lUyHTOxrBcqEpv32GRhXmNZ7FqdHaI/s1600/cal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj7x80802v5vmr1WHJ_v7OlZQwpMLJjF_w0ryRGl-CcXi6QVdFYq-saLls90SnXqw30vq1GmNYpL1wJDbIFgbH0RHqpryMRCUhfudkIZV2yD_51lUyHTOxrBcqEpv32GRhXmNZ7FqdHaI/s1600/cal.png" height="400" width="276" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Lets go line by line.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
calendar = [NSCalendar currentCalendar];</div>
<div class="separator" style="clear: both; text-align: left;">
<i>Gets the calendar wrapper</i></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
oneDayAgoComponents = [[NSDateComponents alloc] init];</div>
<div class="separator" style="clear: both; text-align: left;">
<i>Gets the current date</i></div>
<div class="separator" style="clear: both; text-align: left;">
<i><br /></i></div>
<div class="separator" style="clear: both; text-align: left;">
oneDayAgoComponents.day = -1; </div>
<div class="separator" style="clear: both; text-align: left;">
<i>Sets the day -1 from today</i></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
oneDayAgo = [calendar dateByAddingComponents:oneDayAgoComponents toDate:[NSDate date]options:0];</div>
<div class="separator" style="clear: both;">
<i>Takes the calendar wrapper and gets a date from the oneDayAgoComponents which will return a complete date for today.</i></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
!.. Apple uses <span style="background-color: #f1f5f9; color: #666666; font-family: Courier, Consolas, monospace; font-size: 12px; line-height: 13.5020751953125px; white-space: pre-wrap;">oneYearFromNowComponents</span> we don't need one year from now instead we need a day or two from now.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
nextDayFromNowComponents = [[[NSDateComponents alloc] init]autorelease];</div>
<div class="separator" style="clear: both;">
<i>Allocate (create) a new date component</i></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
nextDayFromNowComponents.day = 1;</div>
<div class="separator" style="clear: both;">
<i>set it to a day after current</i></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
nextDayFromNow = [calendar dateByAddingComponents: nextDayFromNowComponents toDate: [NSDate date]options: 0];</div>
<div class="separator" style="clear: both;">
<i>get complete date.</i></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
store = [[[EKEventStore alloc] init]autorelease];</div>
<div class="separator" style="clear: both;">
<i>Allocate (create) a new EKEventStore</i></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
predicate = [store predicateForEventsWithStartDate: oneDayAgo endDate: nextDayFromNow calendars: nil];</div>
<div class="separator" style="clear: both;">
<i>Take the store and add our dates. It will return the days we want to get.</i> (EKEventPredicate start:1/18/15, 7:27 PM; end:1/20/15, 7:29 PM; cals:(null))</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
events = [store eventsMatchingPredicate: predicate];</div>
<div class="separator" style="clear: both;">
<i>Call the store and get the matches for our dates. This will return all events for these days. As you see above, which I will post again here. It gives us events.</i></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj7x80802v5vmr1WHJ_v7OlZQwpMLJjF_w0ryRGl-CcXi6QVdFYq-saLls90SnXqw30vq1GmNYpL1wJDbIFgbH0RHqpryMRCUhfudkIZV2yD_51lUyHTOxrBcqEpv32GRhXmNZ7FqdHaI/s1600/cal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj7x80802v5vmr1WHJ_v7OlZQwpMLJjF_w0ryRGl-CcXi6QVdFYq-saLls90SnXqw30vq1GmNYpL1wJDbIFgbH0RHqpryMRCUhfudkIZV2yD_51lUyHTOxrBcqEpv32GRhXmNZ7FqdHaI/s1600/cal.png" height="640" width="441" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The events returned is an object. So we can pull info just as you would any object.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
events[0] would return the first event</div>
<div class="separator" style="clear: both; text-align: left;">
events[1] would return the second and so on.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once we get each event say event[0] (first event) we can get certain values such as title, location, and any other info in the object.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6yWfDKn7kobJ6Bm3lRHeHx3cTTTTh8LjHK1cBIZ-sDd5WUyYSlBo_uUOe1gL0BZBhlTAjouVxt9sKGvNdH-nlDM6vFvNJxtGsFtMzu0bpbxS1CGq9LVP2opO3Rg2MzpCMo0JjRmZFT50/s1600/calev.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6yWfDKn7kobJ6Bm3lRHeHx3cTTTTh8LjHK1cBIZ-sDd5WUyYSlBo_uUOe1gL0BZBhlTAjouVxt9sKGvNdH-nlDM6vFvNJxtGsFtMzu0bpbxS1CGq9LVP2opO3Rg2MzpCMo0JjRmZFT50/s1600/calev.png" height="640" width="579" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
events[0].title</div>
<div class="separator" style="clear: both; text-align: left;">
<i>shows current event title which is what we are going to put in our cydget.</i></div>
<div class="separator" style="clear: both; text-align: left;">
<i><br /></i></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="font-size: large;">Creating the Cydget</span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<i><br /></i></div>
<div class="separator" style="clear: both; text-align: left;">
I will start by thinking you have the basic concept how to create the cydget and jump straight into the html code.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGe-9-2nj040SNNPS7nqjuMs92Nh4meXVJgA0aOGqQCexEd5Zcy0oCvTRoNJnsfl0yh0oXpNCV8LZXwa8izwb9nSqrWw8kAfKxWptDeZdEfytf2O7sRTyDG_fn9TM549biIsyltM1FEtw/s1600/ht.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGe-9-2nj040SNNPS7nqjuMs92Nh4meXVJgA0aOGqQCexEd5Zcy0oCvTRoNJnsfl0yh0oXpNCV8LZXwa8izwb9nSqrWw8kAfKxWptDeZdEfytf2O7sRTyDG_fn9TM549biIsyltM1FEtw/s1600/ht.png" height="308" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
Here we do basically the same thing we did in Cycript itself. More than likely if it works in Cycript it will work the same way in Cydget.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
At the end of the getcalendarEvents I put an if statement if(events) this means if there is an event it will return events[0].title. There needs to be and could be more optimization here. For example and else{} statement could be added incase there is no event.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Here is a more advanced process that will give you all events instead of one.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_kUXH7e1F2QqW689BAcCUynTes1DAXhu4L3-b4EpYDEmxpIPAD5bI6kFkwBB4p6yiRFKUaJ8W9zGGT8s5jUShrs9Xs94pcwz-0mt6U7jEL1IRmP2lVRbt69F0lr0lyLQ9JUpqmKJxsD0/s1600/j.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_kUXH7e1F2QqW689BAcCUynTes1DAXhu4L3-b4EpYDEmxpIPAD5bI6kFkwBB4p6yiRFKUaJ8W9zGGT8s5jUShrs9Xs94pcwz-0mt6U7jEL1IRmP2lVRbt69F0lr0lyLQ9JUpqmKJxsD0/s1600/j.png" height="600" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN9DslW0ITykB5ccD5wioWH2V9P5MDnL9MNsc09Oo3I1XwV4RiJIbbwQIIRaPozizTQdOJCzY2G94I26jbcqZUw4UC6ltQSAAcJGL2Adbftqgv0-ZtVBS7S9pXIBBdYFaLDdpyApLTSUA/s1600/IMG_1265.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN9DslW0ITykB5ccD5wioWH2V9P5MDnL9MNsc09Oo3I1XwV4RiJIbbwQIIRaPozizTQdOJCzY2G94I26jbcqZUw4UC6ltQSAAcJGL2Adbftqgv0-ZtVBS7S9pXIBBdYFaLDdpyApLTSUA/s1600/IMG_1265.PNG" height="640" width="321" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><a href="http://www.mediafire.com/download/n4l0yu84dyqzdms/tests.zip">DOWNLOAD</a></b></div>
<br />
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-24210979381959859012014-12-28T19:59:00.001-08:002014-12-28T20:00:13.982-08:00iOS8 UIWebViewiOS8.. Horrible when it comes to lockscreens. Why? Well Apple is now pushing a different webview.<br />
<br />
Which is good for people who get to use the new WKWebView, but most of us are stuck with the old webview. Case in point Cydget. Cydget still uses UIWebView. When I asked Saurik if he planned on updating to the new WebView he explained a few points on why that wouldn't be a good idea. After doing some research, I would rather keep the UIWebView we have for the time being. The new WKWebView has bugs, as does most new implementations. It kills javascript timers and the ability to read local files. Two big things when it comes to lockscreens. Although it does run sooo much "leaner" than UIWebView I feel it isn't ready yet.<br />
<br />
My theory is since Apple is moving forward with WKWebView they are not giving UIWebView as many resources as it once had. This leads to performance issues when we use this UIWebView. By running quite a bit of javascript you may see lockscreen cause a respring. This is iOS8's way of clearing this memory. So how do we work with the old UIWebView on iOS8?<br />
<br />
Well we remove stuff.<br />
<br />
First thing I decided to tackle was the lockscreen background. This image is quite large, just think of the size of a 6+ device. Since most lockscreens just cover up the settings set wallpaper (yes its always there) why not just change the settings set wallpaper?<br />
<br />
Now this can only be done in Cydget as it has the ability to use Cycript, so this is mainly for people who use cydget.<br />
<br />
Here is how I was able to take a wallpaper and set it as the settings set wallpaper.<br />
<br />
setWeatherWall = function(url){<br />
img=[UIImage imageWithContentsOfFile:@""+url];<br />
wViewController = [[[PLStaticWallpaperImageViewController alloc] initWithUIImage:img] autorelease];<br />
wViewController->_wallpaperMode=2;<br />
wViewController.saveWallpaperData = YES;<br />
[wViewController _savePhoto];<br />
}<br />
<br />
I just created a function with a url as a parameter. I would then use this function where I pulled my weather info. Basically setting a weather wallpaper, but instead of displaying the wallpaper in the html, I just sent the url of the wallpaper being used to this function and it would set it to the stock wallpaper.<br />
<br />
Example of what I would have in my weather code. currentIcon would be the current condition.<br />
var newimage="var/mobile/Library/LBEvoWeatherWalls/Icons/"+currentIcon+".jpg";<br />
setWeatherWall(newimage);<br />
<br />
So what does this function do?<br />
<br />
img=[UIImage imageWithContentsOfFile:@""+url];<br />
<i>takes the image and converts it to a UIImage</i><br />
<br />
wViewController = [[[PLStaticWallpaperImageViewController alloc] initWithUIImage:img] autorelease];<br />
<i>creates a view controller. Think of this like the window you see when you go to settings/wallpaper and set a wallpaper.</i><br />
<br />
wViewController->_wallpaperMode=2;<br />
<i>sets the wallpaper mode to 2. This will set the wall to the lockscreen instead of springboard. for springboard set to 1. (thanks to kirbylover for the help with this)</i><br />
<br />
wViewController.saveWallpaperData = YES;<br />
<i>set to YES to save wallpaper data</i><br />
<br />
[wViewController _savePhoto];<br />
<i>set the photo to lockscreen. basically this would be when you press set lockscreen.</i><br />
<br />
Doesn't that seem like the right thing to do? I sure do, and wish more people would open their eyes and add Cycript ability to their lockscreen platforms (GroovyLock, LockHTML4 etc).<br />
<br />
You now have your weather wallpaper set to the lockscreen, and you didn't have to load it in your html at all, also it will fit all devices.<br />
<br />
Next up would be handling blurs. Since you no longer have a wallpaper in your html, you can no longer blur it with say -webkit-transform:blur(); which is good as it really eats up resources. I achieved a blur using the code below. This blurs the lockscreen wallpaper, much like when a notification comes it.<br />
<br />
[[[[SBLockScreenManager sharedInstance]lockScreenViewController]lockScreenView]_showFakeWallpaperBlurWithAlpha:1 withFactory:null];<br />
<br />
_showFakeWallpaperBlurWithAlpha: can be from 0 to 1. You can set a float such as 0.5, 0.2 etc. This will change the amount of blur added. 1 being the highest and 0 being no blur at all. This will blur any wallpaper set to settings. You can see the effect in the video below. When the lockscreen is scrolled it applies the blur, when it is set back to top it will unblur it.<br />
<br />
<a href="http://t.co/2humzGBsUP">http://t.co/2humzGBsUP</a><br />
<br />
<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-21368441843670928452014-02-16T12:56:00.003-08:002014-02-16T13:29:34.803-08:00Using a preference bundle in cydgetRecently I found this <a href="http://www.reddit.com/r/iOSthemes/comments/1xa00f/concept_global_variables_for_cydget_cydgetvars/">Reddit post</a> from looking at <a href="http://www.reddit.com/user/saurik">Saurik's reddit</a> It further explained how to use preferenceloader to load plist entries. After fiddling around a bit, I was able to add this to <a href="http://cydia.saurik.com/package/com.macciti.miweathercydget/">miWeather Cydget</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://cydia.saurik.com/package/com.macciti.miweathercydget/"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI9q7_QpgS8QKzCnCbS_oWG8QIFD73D96IMId8YqKz09w7KonjaZyjg59f66yUSASw5J_7nIFx21Z9TqKXo9ENfvVAI_ykalbF7x90C_AxSHxu5TspLdRGYzIrrvUMuXvSLREIBVh2l1g/s1600/IMG_1661.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://cydia.saurik.com/package/com.macciti.miweathercydget/"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_VxqTZaK92dmhPeSPIvMUTDCMyNQ5n0zzGrACRTIy89f3Vm7dk9tkSWVHQszWGywnPcf_762DeA8tKRH-pc7AN8lYWpO_Qi4BWC_AoIFdsdaDN_FenPOC7Ayqo9mkTy4_7GMtSmalIbU/s1600/IMG_1664.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It implemented very easily, a lot easier than you would think. Now I don't see how we went so long without adding this to Cydget Lockscreens. So I have recorded me creating one, to maybe help some understand the procedure. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="//www.youtube.com/embed/FZscRYEpLfY" width="560"></iframe>
<br />
<br />
Included in the description is the complete files.<br />
<br />
<br />
Links:<br />
<a href="http://iphonedevwiki.net/index.php/PreferenceLoader">http://iphonedevwiki.net/index.php/PreferenceLoader</a><br />
<a href="http://modmyi.com/forums/file-mods/22453-how-make-custom-menus-preferences-app-custom-preferences.html">http://modmyi.com/forums/file-mods/22453-how-make-custom-menus-preferences-app-custom-preferences.html</a><br />
<br />
<br />
Written instuctions<br />
<br />
PreferenceLoader includes a few files.<br />
<br />
The plist. This can be named however you see fit.<br />
The icon. Can also be named however you like.<br />
<br />
The Plist<br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b><?xml version="1.0" encoding="UTF-8"?></b></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"></b></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b><plist version="1.0"></b></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b><dict></b></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b></dict></b></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b></plist></b></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><b><br /></b></span>
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;">This is your plist in its lowest form. To add options to the plist we will enter them in between <dict></dict></span><br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><br /></span>
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;">For example we want to call our icon.</span><br />
With this entered in between <dict></dict> it will tell our plist its icon.<br />
<span style="color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: x-small;"><br /></span>
<key>entry</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSLinkCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>icon</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo@2x.png</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<br />
Give it a title<br />
<key>title</key><br />
<string>Demo</string><br />
<br />
Make items in your plist<br />
<key>items</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><array><br />
</array><br />
<br />
Inside the <arrary></array> we can enter separate <dict></dict> tags to contain certain items. Toggles, Text Entry and more.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
Above will give you a cell name.<br />
Then under it we can apply different cell items.<br />
<br />
<dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key> //What it is<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSEditTextCell</string> //What type of cell<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>default</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string></string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string> //plist it will save to<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key> //depicts a key<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>sCityCodes</string> //name of our key<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key> // label for this key<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Zip Code/Weather Code</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>placeholder</key> //what will show when cell is blank<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Enter Zip Code/Weather Code</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
There are multiple cell types.<br />
<br />
<ul>
<li>PSEditTextCell //shown above</li>
<li>PSLinkListCell //lets you choose from a list of items</li>
<li>PSSwitchCell // on/off switch (shows true or false)</li>
<li>More i'm unaware of at this point</li>
</ul>
<br />
<br />
<b>Complete Plist for miWeather</b><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><br />
<plist version="1.0"><br />
<dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>entry</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSLinkCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>icon</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>miWeatherPrefs@2x.png</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>miWeather LockScreen</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>items</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><array><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Weather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSEditTextCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>default</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string></string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>sCityCodes</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Zip Code/Weather Code</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>placeholder</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Enter Zip Code/Weather Code</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<b> <span class="Apple-tab-span" style="white-space: pre;"> </span><dict></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span></dict></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><dict></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSLinkListCell</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>detail</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSListItemsController</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>options</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>Options</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>validTitles</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><array></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>0</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>1</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>2</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span></array></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><key>validValues</key></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><array></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>0</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>1</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><string>2</string></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span></array></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span></dict></b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSSwitchCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>default</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><false/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>sUnit</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Turn on for celsius</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSSwitchCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>default</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><false/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>TwentyFourHourClock</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Turn on for 24hr</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>System/Library/LockCydget/miWeather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSSwitchCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>default</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><false/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>userwall</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>User Wall</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Radar</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSSwitchCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>default</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><false/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>defaults</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>com.JunesiPhone.miWeather</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>key</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>world</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Turn on for outside US</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>footerText</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>miWeather by JunesiPhone<br />
http://JunesiPhone.com</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></array><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>title</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>miWeather</string><br />
</dict><br />
</plist><br />
<br />
<br />
<b>Complete Plist for the demo</b><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><br />
<plist version="1.0"><br />
<dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>entry</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSLinkCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>icon</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo@2x.png</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>label</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>items</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><array><br />
<br />
<b> <dict></b><br />
<b><key>cell</key></b><br />
<b><string>PSGroupCell</string></b><br />
<b></dict></b><br />
<b><dict></b><br />
<b><key>cell</key></b><br />
<b><string>PSLinkListCell</string></b><br />
<b><key>defaults</key></b><br />
<b><string>com.JunesiPhone.demo</string></b><br />
<b><key>detail</key></b><br />
<b><string>PSListItemsController</string></b><br />
<b><key>key</key></b><br />
<b><string>options</string></b><br />
<b><key>label</key></b><br />
<b><string>Wallpaper Choices</string></b><br />
<b><key>validTitles</key></b><br />
<b><array></b><br />
<b><string>0</string></b><br />
<b><string>1</string></b><br />
<b><string>2</string></b><br />
<b></array></b><br />
<b><key>validValues</key></b><br />
<b><array></b><br />
<b><string>0</string></b><br />
<b><string>1</string></b><br />
<b><string>2</string></b><br />
<b></array></b><br />
<b></dict></b><br />
<span class="Apple-tab-span" style="white-space: pre;"><b> </b></span><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dict><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>cell</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>PSGroupCell</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>footerText</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo by JunesiPhone<br />
http://JunesiPhone.com</string><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></dict><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></array><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><key>title</key><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><string>Demo</string><br />
</dict><br />
</plist><br />
<div>
<br /></div>
<br />
It looks like a lot, but it is very easy once you get the hang of it.<br />
<br />
Once you have these items you place them into Library/PreferenceLoader/Preferences<br />
Close your settings app and reopen it. You will see your preferences.<br />
<br />
Now to cydget.<br />
<br />
<script type="text/cycript"><br />
try{<br />
var settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.JunesiPhone.demo.plist"];<br />
if(settings!=null){<br />
image=settings.options;<br />
}<br />
}catch(err){<br />
alert(err);<br />
}<br />
</script><br />
<br />
Thats pretty much it for cydget. This script will pull the plist listed. This plist is created by the preferenceloader, and you set the name for it under your defaults key. So once this toggle, switch etc is pressed it updates this plist.<br />
<br />
If you see above there is a part of the plist that is bold. It is pertaining to this script I just wrote. You can see our key is called options. Also take note that I gave our cycript a var of settings.<br />
<br />
Therefore if you alert(settings); it will show our plist entries. If you alert(settings.options); then it will show the value of the key options. You can now use this key in your javascript.<br />
<br />
For the example I used image=settings.options. I passed this value to image. now if you alert(image); it will alert this value.<br />
<br />
In the demo code I wrote, I used image to decide on which image to show as the background. Here is the complete html<br />
<br />
<!DOCTYPE html><br />
<html><br />
<head><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><title>Demo Cydget</title><br />
</head><br />
<body><br />
<br />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/><br />
<br />
<style type="text/css">#wallpaper{position: absolute;top:0px;left:0pc;}</style><br />
<div id="wallpaper"><img src="1.jpg" width="320"></div><br />
<script type="text/javascript"><br />
image="1";<br />
</script><br />
<br />
<script type="text/cycript"><br />
try{<br />
var settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.JunesiPhone.demo.plist"];<br />
if(settings!=null){<br />
image=settings.options;<br />
}<br />
}catch(err){<br />
alert(err);<br />
}<br />
</script><br />
<br />
<script><br />
width="320"<br />
imageset=image+".jpg"<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById("wallpaper").innerHTML='<img width='+width+' src='+imageset+'>'<br />
</script><br />
</body><br />
</html><br />
<br />
Also note I set the var at the top image="1"; if it doesn't detect a plist, or doesn't read it. Then it will default to that value. If it does, then it changes it accordingly.<br />
<br />
The complete code is located in the Video description. EnjoyAnonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com1tag:blogger.com,1999:blog-1081210175607548538.post-42767234223030098852014-02-16T09:32:00.002-08:002014-08-02T20:42:49.043-07:00A few cycriptsThese are a few things you can 1. Run from terminal while in cycript. 2. Add to your lockscreens to use.<br />
<br />
Turn on the lockscreen<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 36px; line-height: 12px; overflow: scroll; padding: 6px;">[[SBBacklightController sharedInstance] turnOnScreenFullyWithBacklightSource:1]</pre>
Unlock iPhone (Terminal only)<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 36px; line-height: 12px; overflow: scroll; padding: 6px;">[[SBLockScreenManager sharedInstance] _finishUIUnlockFromSource:1 withOptions:1]</pre>
Stop dimming of the lockscreen
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 36px; line-height: 12px; overflow: scroll; padding: 6px;">[[SBBacklightController sharedInstance] cancelLockScreenIdleTimer]</pre>
Pull info from settings set plist
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 36px; line-height: 12px; overflow: scroll; padding: 6px;"> var settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.JunesiPhone.miWeather.plist"];</pre>
Pull info from settings code
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
script type="text/cycript"
try{
var settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.JunesiPhone.miWeather.plist"];
if(settings!=null){
}
}catch(err){
alert(err);
}
/script
</pre>
SB switcher stuff
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBUIController sharedInstanceIfExists]_toggleSwitcher]
[[SBUIController sharedInstanceIfExists]dismissSwitcherAnimated:YES]
[[SBUIController sharedInstanceIfExists]getRidOfAppSwitcher]
</pre>
Unlock with passcode
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBLockScreenManager sharedInstance] attemptUnlockWithPasscode:@"1234"]
</pre>
Small status on SB
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
SBLockScreenViewController.messages['statusBarStyle']=function(){return 0}
</pre>
Allow folders to be placed in folders.
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
SBIconView.messages['canReceiveGrabbedIcon:'] = function (icon){ return YES; }
</pre>
See if notifications are showing on the Lockscreen
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[[SBLockScreenManager sharedInstance] lockScreenViewController] lockScreenIsShowingBulletins];
</pre>
Use location services
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
manager = [[[CLLocationManager alloc] initWithEffectiveBundle: [NSBundle bundleForClass: CLLocationManager.class]]autorelease]
manager.delegate = CLLocationManagerDelegate;
manager.desiredAccuracy = kCLLocationAccuracyBest;
[manager startUpdatingLocation];
var GPS = manager.location.coordinate;
[manager stopUpdatingLocation];
var Latitude = JSON.stringify(GPS[0]);
var Longitude = JSON.stringify(GPS[1]);
</pre>
See if location services is enabled
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[CLLocationManager sharedManager] locationServicesEnabled];
</pre>
Detect if passcode is on
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBDeviceLockController sharedController]isPasscodeLocked];
</pre>
Open url in safari
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
mySafari = [UIApplication sharedApplication];
myURL = [[NSURL alloc]initWithString:@""+url];
[mySafari openURL:myURL]; //myUrl is your link
[myURL release];
</pre>
Disable lock bounce iOS7.1
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
SBLockScreenView.messages['hintDisplacement']=function(){return 0}
</pre>
Get app notification badge
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
SBIconController.sharedInstance.model.leafIconsByIdentifier["com.apple.MobileSMS"].badgeValue;
</pre>
Device stuff
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[UIDevice currentDevice] name];
[[NSFileManager defaultManager] attributesOfFileSystemForPath:@"/var/mobile" error:NULL];
[NSProcessInfo processInfo].physicalMemory;
[NSProcessInfo processInfo].processorCount;
[NSProcessInfo processInfo].operatingSystemVersionString;
[NSProcessInfo processInfo].systemUptime;
</pre>
Battery Percent
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBUIController sharedInstance]batteryCapacityAsPercentage];
</pre>
Unlock device on iOS7. Thanks to Saurik for his help on this one.
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[^void(){[[UIApplication sharedApplication] launchApplicationWithIdentifier:@""+bundle suspended:NO];}
performSelectorOnMainThread: @selector(invoke) withObject: nil waitUntilDone: NO];
</pre>
Hide LS items
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[[[SBLockScreenManager sharedInstance]lockScreenViewController]lockScreenView]setSlideToUnlockHidden:1 forRequester:1];
[[SBAppStatusBarManager sharedInstance] hideStatusBar];
[[[[SBLockScreenManager sharedInstance]lockScreenViewController]lockScreenView]setTopGrabberHidden:1 forRequester:1];
[[[[SBLockScreenManager sharedInstance]lockScreenViewController]lockScreenView]setBottomGrabberHidden:1 forRequester:1];
</pre>
Get last touched icon
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBIconController sharedInstance]lastTouchedIcon];
</pre>
Home button tap by code
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBIconController sharedInstance]handleHomeButtonTap];
</pre>
Display icons or bundles
<br />
<pre class="bbcode_code" style="background-color: #f2f6f8; background-repeat: repeat no-repeat; border: 1px inset; color: #333333; direction: ltr; font-size: 12px; height: 100px; line-height: 12px; overflow: scroll; padding: 6px;">
[[SBApplicationController sharedInstance]allDisplayIdentifiers]
[[SBApplicationController sharedInstance]allApplications]
</pre>
Hope this helps, has taken me quite awhile to get most of these. Sometimes weeks at a time to figure one out. If you have any let me know, and I will add them. Most all of these can be found in <a href="http://lbevo.com/">LockBuilder Evo</a>Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com8tag:blogger.com,1999:blog-1081210175607548538.post-89385096878655900102013-09-14T16:04:00.002-07:002013-09-14T16:05:55.252-07:00Running Cycript from CydgetsMy main objective here.<br />
<br />
At this moment in time, I have no interest in tweaks. Cycript seems like a great tool for the tweak maker.<br />
<br />
Cycript is great for executing code while runtime. I can image how great this is for Tweak developers.<br />
<br />
What about themers? One issue, themers theme. Majority are graphic designers, and picked up how to use some code for there lockscreens. With knowing a little about code, you can run script that affect apples code at runtime. (basic javascript)<br />
<br />
Saurik makes it very simple with Cydgets. I personally have created a lockscreen (Only using Cydgets)<br />
It will unlock itself in 10 seconds. Great thing is its not a trick. Meaning it actually uses apples code to unlock the device.<br />
<br />
You can also write files to text. Tweaks like infoStats. This can be done from inside an html. No tweak needed. Cycript merges that boundary.<br />
<br />
Want to get values from apps? Sure just use cycript. Display missed calls on your lockscreen for your theme? Yes, Use an unlock other than slide to unlock? YES! Anything is possible, and is worth looking at. I will explain my code below.<br />
<br />
<br />
To run [[SBAwayController sharedAwayController] unlockWithSound:NO] we first need to create a script, this way cycript knows it needs to run this code. You can do this by<br />
<br />
<div style="text-align: center;">
<script type='text/cycript'> Your Code Here</script></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
Standard script, but notice text/cycript. Now we can insert obj c right here O_o </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: center;">
<script type='text/cycript'> </div>
<div style="text-align: center;">
setTimeout(function(){unlock()}, 10000);</div>
<div style="text-align: center;">
function unlock(){</div>
<div style="text-align: center;">
[[SBAwayController sharedAwayController] unlockWithSound:NO]</div>
<div style="text-align: center;">
}</div>
<div style="text-align: center;">
</script></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
The entire code. It is set to run after a few seconds. This means if you put this in cydgets as a cydget:P It will unlock your phone after the timeset.</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
ISSUES: So far I have had one issue. If I connect this to a button. Meaning if I press a button it executes this code, then I will go into safe mode. At this time i'm not sure why, but I will report back. Working as timeout and not button, makes me thing that maybe the pressed action needs to be canceled. Not sure yet. This does work, reason I am posting. I myself didn't see it possible. It surely is.</div>
<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-8039939628666136532013-09-14T15:27:00.002-07:002013-09-14T15:30:05.408-07:00Cycript Woah! That about sums it up.. Within a few days I have learned things, I could only dream of. One as a developer/themer/coder. The other just as a normal Jailbreaker. I would like to share my findings with you.<br />
<br />
Reason for this Cydgets blog, is learning new things is a pain! Sometimes hour upon hours researching until you find that one piece that the last tutorial missed. Although i'm not here to give you all the answers. I do want to share what i've learned.<br />
<br />
A new page has been added to the blog. <b><a href="http://cydgets.blogspot.com/p/cycript-pronounced-ssscript.html">Cycript</a></b> At this point i'm speechless. Cannot find the exact adjective to describe what kind of tool Cycript is. So its Amazing.<br />
<br />
You can view my page here: Cycripts <a href="http://cydgets.blogspot.com/p/cycript-pronounced-ssscript.html">http://cydgets.blogspot.com/p/cycript-pronounced-ssscript.html</a><br />
<br />
I am new to this tool, as with Cydgets. Comments are very welcome.<br />
<br />
<br />
<br />
<script async="" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Download Button Ad -->
<br />
<ins class="adsbygoogle" data-ad-client="ca-pub-9078058205056222" data-ad-slot="9566087674" style="display: inline-block; height: 60px; width: 428px;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-61440979320406629702013-09-12T19:05:00.002-07:002013-09-12T23:06:01.911-07:00Editing any lockscreen to use image set from setbackground.cydget<div style="text-align: center;">
With the setbackground.cydget, I have created a way to pick an image from your camera roll. Then set it to your lockscreen. What makes this great is, its easier to set wallpapers, and it can work across any cydget. I'll explain.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
I can save this image you picked for further use. You can read more on that <a href="http://cydgets.blogspot.com/2013/09/access-to-camera-roll-and-dealing-photo.html">here</a>.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
I save this image file in LocalStorage. It is not a link to the image, but the actual image itself.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Most of the time you would create a wallpaper </div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<div id="wallpaper"><img src=""/></div></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
No matter what the image src you can change this image at any time by.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<style>#wallpaper{background: url('')}</style></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
So if I was to take our saved photo. Which is saved as userbg. I just have to call it in my html.</div>
<div style="text-align: center;">
any time to get something from local storage you can locatStorage.getItem("your saved entry")</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
We can open any lock background and add this script.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
load();</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
function load(){</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
var getitems = localStorage.getItem("userbg");</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
$('#wallpaper').css('background-image', 'url(' + getitems + ')');</div>
<div style="text-align: center;">
}</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
All this does is pull the image from out storage, then applies it to the wallpaper via background-image. This in return overwrites whatever wallpaper the lockscreen used, and uses your own wallpaper. You can now pick any wallpaper via set background and it will set any cydget background to that image.</div>
Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-2607377075181160102013-09-12T11:01:00.002-07:002013-09-12T11:25:44.541-07:00Access to the camera roll and dealing photo binary data<div style="text-align: center;">
Best part of Cydgets, you still have to deal with security:)</div>
<div style="text-align: center;">
</sarcasm></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Simple to access your camera roll, just create and input file.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<input type="file" id="files" name="files[]" multiple /></div>
<div style="text-align: center;">
When you click on the input file it will open the camera roll.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Once you are there it is easily uploaded. The only issue is, we don't want to go pick a background every time we unlock our phone. We need to save this to LocalStorage so it can be used again.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Well it's against security. Meaning if you uploaded an image to a website, the actual location of the file is unknown. The browsers actually put a fake url here. Just for security purposes. While on safari I have access to the name, iPhone I do not.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Seems impossible to get. Well here comes the work around.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Since I have the image loaded, I am able to access the binary data of this image. If we create a file reader, and push through readAsDataURL(), then we can get the image 64base code. Which is not a url, it is basically the whole image.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Great thing is I figured out I can use it as a url:)</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Simply by </div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
getitems = "This would be where I return from images the one your clicked"</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
$('#wallpaper').css('background-image', 'url(' + getitems + ')');</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Now that getitems ends up being over 100,000 character of code. WAY to much for a cookie.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
I was able to store to LocalStorage, then render across not only pages, but cydgets as well. </div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<br></div>
Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com1tag:blogger.com,1999:blog-1081210175607548538.post-9034309935934382402013-09-12T09:38:00.001-07:002014-05-21T20:03:12.596-07:00Using LocalStorage with Cydgets<div style="text-align: center;">
<div style="text-align: left;">
If I ask a user for information, I don't want to have to keep asking them.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
With Cydgets when you unlock your phone everything resets. Just as if you closed your browser.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Recently i've been using jQuery Cookies, although very frustrating. They worked very well. Which gave me the ability to create amazing things.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Well through my experiments with Cydgets. I finally maxed out my cookies. I needed to return the binary for an image. Which was over 100,000 characters:P So I needed a replacement.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
I tried LocalStorage before, but with most doesnt work with winterboard. Reason I chose cookies. (My workaround so to speak)</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Gave LocalStorage another shot, and works perfectly. I will explain.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
var locale = "32118";</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Here is a location code for a weather widget. We need to save it so it doesn't reset.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Make a variable </div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;">var locale = prompt("Enter your ZipCode", "");</span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;"><br /></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;">save it to LocalStorage</span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;"><br /></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; line-height: 18px;"><span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;">localStorage.setItem('nameoffile', locale);</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; line-height: 18px;"><span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">how to get the file</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">var getitems = localStorage.getItem("nameoffile");</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">You can either alert(getitems); console.log or set it to variable</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">Now we need var locale to be dynamic. We cannot have it just a prompt.</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">For example. if(getitems != null){</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">var locale =getitems;</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">}</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">If get items is not empty, then var locale is equal to getitems, which is your LocalStorage</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">Below its saying if the getitems is empty then show a prompt, then save to localstorage.</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">else{</span></span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;">var locale = prompt("Enter your ZipCode", "");</span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: x-small; line-height: 18px;">localStorage.setItem('nameoffile', locale);</span></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #666666; font-family: Trebuchet MS, Trebuchet, Verdana, sans-serif; font-size: x-small;"><span style="line-height: 18px;">}</span></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-67938998009770200912013-09-12T09:12:00.000-07:002013-09-12T23:00:43.669-07:00Using keyboard for data in Cydgets<div style="text-align: center;">
Where the fun begins!</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Things I have done with lockscreens lately is pretty unbelievable. That doesn't even compare what they can be now.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
One great feature is access to a keyboard! YES! I've went to lengths to coding my own keyboards to work with widgets. I am so glad that I can say goodbye. Not only does take alot of time to code a keyboard, but the ram it takes to do the functions is much greater.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
I have yet to see anyone else implement keyboards or keypads like I have. I hope this changes it.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
In code we use variables for a lot of things. So of course when you give user access to change those variables a lot of great things happen.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
One most common, which is what made my decision, to make a keyboard is the location variable.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
You know it as var locale. This variable contains your zip code or weather code.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
To get this info you leave the lockscreen open a text editor and edit the code. Everyone isn't a coder, and they should NOT have to do this.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Ok now to the meaty stuff. How do I get a keyboard in Cydgets June?</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Easy use prompt. Has been on the web for ages. Here is how.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
var locale = prompt("Enter your ZipCode", "");</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Thats it:) haha. Yes, now your getting it. </div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
When this locale is called the keyboard will popup and ask for your zip. You enter it accepts.</div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
Now you have to do this every time you unlock/lock. Remember everything resets.</div><div style="text-align: center;"><br></div><div style="text-align: center;"><br></div>
<div style="text-align: center;">
Next post ill explain how to make up for it resetting.</div><div style="text-align: center;"><br></div><div style="text-align: center;"><a href="http://cydgets.blogspot.com/2013/09/using-localstorage-with-cydgets.html">http://cydgets.blogspot.com/2013/09/using-localstorage-with-cydgets.html</a></div>
<div style="text-align: center;">
<br></div>
<div style="text-align: center;">
<br></div>
<script async="" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Cydgets -->
<ins class="adsbygoogle" style="display:inline-block;width:336px;height:280px" data-ad-client="ca-pub-9078058205056222" data-ad-slot="3000432875" data-adsbygoogle-status="done"><ins style="display:inline-table;border:none;height:280px;margin:0;padding:0;position:relative;visibility:visible;width:336px"><ins id="aswift_0_anchor" style="display:block;border:none;height:280px;margin:0;padding:0;position:relative;visibility:visible;width:336px"><iframe width="336" height="280" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&&s.handlers,h=H&&H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&&d&&(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){w.location.replace(h)}}" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-32484217912994820362013-09-12T09:00:00.001-07:002013-09-12T09:00:40.329-07:00Editing Winterboard Lockscreens to work with Cydgets<div style="text-align: center;">
For many this will be an easy transition, only a few things to do.</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
First off we need to make sure your existing lockscreen is able to work correctly, in 'Webview'.</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
This is pretty simple the most part. Usually includes adding</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
This allows your html to fit the device screen.</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
File naming: In cydgets you will need to name your theme. myTheme.cydget</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
Info.plist: Here you set the name and location of your html. Also you can activate scrolling</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<?xml version="1.0" encoding="UTF-8"?></div>
<div style="text-align: center;">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"></div>
<div style="text-align: center;">
<plist version="1.0"></div>
<div style="text-align: center;">
<dict></div>
<div style="text-align: center;">
<key>Configuration</key></div>
<div style="text-align: center;">
<dict></div>
<div style="text-align: center;">
<key>Homepage</key></div>
<div style="text-align: center;">
<string>file:///System/Library/LockCydgets/upload.cydget/index.html</string></div>
<div style="text-align: center;">
<key>Scrollable</key></div>
<div style="text-align: center;">
<string>NO</string></div>
<div style="text-align: center;">
</dict></div>
<div style="text-align: center;">
<key>Plugin</key></div>
<div style="text-align: center;">
<string>WebCycriptLockScreen</string></div>
<div style="text-align: center;">
<key>Tagline</key></div>
<div style="text-align: center;">
<string>miLockSimple</string></div>
<div style="text-align: center;">
</dict></div>
<div style="text-align: center;">
</plist></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
This need to be added to the base folder of your theme.</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
Thats it.</div>
Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com0tag:blogger.com,1999:blog-1081210175607548538.post-35548554269009930992013-09-12T08:53:00.001-07:002014-05-21T20:02:43.912-07:00What is a Cydget?<div style="text-align: center;">
<div style="text-align: left;">
First off.. Welcome!! </div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
This blog will be dedicated to cydgets. Reason is my addiction to code.. Yes I said it. So lets move on.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Cydgets - In my own words</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Cydgets is Winterboard for Lockscreens.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Easy enough? Maybe, but I know you are leary.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
If you are familiar with Winterboard, it will not take you long to get used to Cydgets.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Cydgets is a place to keep all your lockscreens. It doesn't come with an icon.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
It has a settings icons in the settings.app</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
If you open it, you are displayed with a setup similar to winterboard. You have the list of lockscreens. (Which are installed in System/Library/LockCydgets)</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
You can select as many as you want. Move them around in whatever order you want.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
This is because you can switch between lockscreens by using the home button while on your lockscreen.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
It will cycle through each one. You still might be wondering why this is useful. Although the above sounds great, why bother.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
I will tell you. Cydgets opens up Lockscreens to more iPhone features.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
When HTML is run via winterboard it is run in a mobile view, also alot of features are not available. </div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
Things like Popups, Keyboards, EntryFields, LocalStorage, Fullpage views, and much more. These are available for us in Cydgets. Pretty much the entire iOS is opened and available to be exploited. I have created a few myself and will share them soon.</div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: left;">
There is tons more to get into stay tuned for more post.</div>
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
Anonymoushttp://www.blogger.com/profile/12023906842482853219noreply@blogger.com1