+ Reply
Results 1 to 9 of 9

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


Thread: I need help creating a Cydia tweak (or adjusting another personís Cydia tweak)

is a discussion within the

OS Apps and Development

forums, a part of the

Computer Modding Software

section;
...
  1. #1
    What's Jailbreak?
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default I need help creating a Cydia tweak (or adjusting another personís Cydia tweak)
    Ok, so here goes, haha (you will understand why I preface with that after reading this post).

    I recently downloaded Weather Icon (displays up to date weather information in the status bar, great tweak by the way) from the Cydia store and thought to myself, wow, I would love a tweak like this, but instead of weather I would like it to display a stock, index or ETF. I then did some digging and found that there isnít anything like it (if there is please let me know). So I went ahead and emailed the developer asking if it would be easy to make the tweak. Anyway, I didnít get a response and figured that I would try to create it myself. That is why I am here.

    Here is some background before everyone prematurely tells me how hard it is to make a tweak and that I should quit while I am ahead. Please donít take the following Ďaccomplishmentsí as boasting either, as it is merely an attempt to weed out a certain type of commenter. However, I probably shouldnít assume the worst in people. (just used to similar comments when I post to my reef keeping forums)

    - College graduate at top 10 undergraduate school
    - Current investment banker
    - Have made a couple of websites out of boredom for friends Ė nothing too difficult, just adjusting CSS code in RapidWeaver.
    - I know my way around a computer fairly well; I doubt anything I have done up until this point is a 1-1 comparison to creating a tweak/app, but I have been messing around with this stuff since email bombers and proggs on dial up. (started pretty young Ė 26 now)

    Also note that I am using a Macbook pro that I got after graduating (about 4 years old running Snow Leopard).

    Questions I need answered before I embark on this adventure:

    - Is there a program out there that would allow me to adjust the code in the Weather Icon tweak? Basically instead of sourcing the information from the pre-loaded weather app, source it from the pre-loaded stocks app.
    o If so, does anyone have a good website that goes over what tweaks/apps are coded in and what programs I need to adjust the code?
    o If not, I guess all I really need is a good ďhow toĒ website on creating apps/tweaks.

    - Does anyone know of a good program to test the app on my computer? I assume it would be similar to a ps3 emulator, right? I donít want to test it on my Iphone since Apple does not assign blobs anymore and I canít imagine a life without my jailbreak

    - Any other advice would be greatly appreciated!!

    And if you have made this far, thank you!!

    PS I hope I didnít offend anyone by assuming people would be rude and say that it is too hard

    PPS If and when I do complete this tweak it will be available for free in the Cydia store for anyone interested.

  2. #2
    H4CK3R's Avatar
    Join Date
    Jan 2012
    Location
    java.lang.IllegalStateException: Location unknown.
    Posts
    5,832
    Thanks
    63
    Thanked 264 Times in 253 Posts

    For a tweak like this I would suggest that you search around in the app you want to go in the status bar. Let's take the Stocks app for example, You may find some interesting code in there that may be of use but I highly doubt it (I still suggest you do) I do respect you for your knowledge of CSS but in a tweak like this it's almost useless. Your best bet is to learn Obj-C (If you don't already know it) and use it to code the tweak. You could also look around in the coding of the Weather tweak and see how the guy did it, It may help you a bit more.

  3. The Following User Says Thank You to H4CK3R For This Useful Post:

    jdomasi4 (03-16-2012)

  4. #3
    What's Jailbreak?
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Hi,

    Thank you for your reply. Is there a program out there where I can see the entire code for a cydia tweak (similar to an HTML editor for a webpage)?

    If so, I can’t imagine it being too hard to read up on Obj-C and make adjustment to the Weather Icon code to source live data from the stocks app instead of the weather app.

    This is probably beyond the scope of the discussion, but if I can do that, is it ethical? Is there some un written rule not to steal developer’s code and use it as your own?

    Thanks again.

  5. #4
    H4CK3R's Avatar
    Join Date
    Jan 2012
    Location
    java.lang.IllegalStateException: Location unknown.
    Posts
    5,832
    Thanks
    63
    Thanked 264 Times in 253 Posts

    Yes ther is. If you don't already have iFile, Get it right away. It is the best file editor and creator on Cydia. Obj-C is not hard to read at all, In fact it's actually very simjple. Obj-C is like this:

    com.apple.SystemPermissions.plist
    <SystemPermissions>
    <integer>46254<integer>
    <integer>58374<integer>

    It's a very simple language to learn and should definetly be learned by any Developer. And yes you may change the code up. I do it all the time and there is nothing wrong with it. You just have to know what you're doing. Your idea is very good and I wish the best of luck to you. Good Luck! If you need any help feel free to PM me or reply to this.

  6. The Following User Says Thank You to H4CK3R For This Useful Post:

    jdomasi4 (03-16-2012)

  7. #5
    What's Jailbreak?
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Ahhh, didnít even think of Ifile. Thank again for the help/suggestions. If anyone is interested, I just found this link that goes over how to make a cydia tweak. I am going to look through it over the next couple of weeks and will provide updates as I move forward with creating my own tweak.

    Ömore to come

    How To Make A Cydia Tweak Or Application [In-Depth Article] | iJailbreak.com

  8. #6
    H4CK3R's Avatar
    Join Date
    Jan 2012
    Location
    java.lang.IllegalStateException: Location unknown.
    Posts
    5,832
    Thanks
    63
    Thanked 264 Times in 253 Posts

    Nice article. I found it useful myself. For a tweak you definetly need to know Obj-C

  9. #7
    Livin the i raduga's Avatar
    Join Date
    May 2009
    Posts
    1,631
    Thanks
    228
    Thanked 94 Times in 85 Posts

    Quote Originally Posted by X H4CK3R X View Post
    Yes ther is. If you don't already have iFile, Get it right away. It is the best file editor and creator on Cydia. Obj-C is not hard to read at all, In fact it's actually very simjple. Obj-C is like this:

    com.apple.SystemPermissions.plist
    <SystemPermissions>
    <integer>46254<integer>
    <integer>58374<integer>

    It's a very simple language to learn and should definetly be learned by any Developer. And yes you may change the code up. I do it all the time and there is nothing wrong with it. You just have to know what you're doing. Your idea is very good and I wish the best of luck to you. Good Luck! If you need any help feel free to PM me or reply to this.
    Huh?
    That's XML, not Obj-C.

    Tweaking XML properties in a plist isn't tremendously difficult to learn, but it may take considerable time to figure out which values to change and what to change them to.

    Objective C is a compiled low-level language. It's a profoundly different, and vastly greater challenge.

    Some of the (simpler) tweaks and mods involve simply changing plists; but WeatherIcon isn't one of those. It's got a compiled dylibs, and is a fairly involved project.

    Fortunately, it IS open source/free software!
    all the details in here:
    https://github.com/Stimpy5050/WeatherIcon


    Sample XML plist from WeatherIcon:

    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>entry</key>
            <dict>
                    <key>bundle</key>
                    <string>WeatherIconSettings</string>
                    <key>cell</key>
                    <string>PSLinkCell</string>
                    <key>icon</key>
                    <string>WeatherIcon-small.png</string>
    <key>isController</key>
    <true/>
                    <key>label</key>
                    <string>Weather Icon</string>
            </dict>
    </dict>
    </plist>

    Sample Obj-C from WeatherIcon:

    Code:
    extern "C" void WeatherIconStatusBarInit()
    {
            NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
    if (objc_getClass("UIStatusBar"))
    {
    Class $UIApplication = object_getClass(objc_getClass("UIApplication"));
    Hook(UIApplication, _startWindowServerIfNecessary, _startWindowServerIfNecessary);
    
    CFNotificationCenterRef darwin = CFNotificationCenterGetDarwinNotifyCenter();
    CFNotificationCenterAddObserver(darwin, NULL, (CFNotificationCallback) updateIndicators, (CFStringRef) @"weathericon_changed", NULL, NULL);
    CFNotificationCenterAddObserver(darwin, NULL, (CFNotificationCallback) updateIndicators, (CFStringRef) @"UIApplicationDidBecomeActiveNotification", NULL, NULL);
    }
    
    [pool release];
    }
    Quote Originally Posted by jdomasi4 View Post
    Hi,

    Thank you for your reply. Is there a program out there where I can see the entire code for a cydia tweak (similar to an HTML editor for a webpage)?
    Not generally, no.
    WeatherIcon is a special case though, since the devs made it's source freely available:
    https://github.com/Stimpy5050/WeatherIcon

    iFile as xh4ck3rx suggests, will let you view, edit, and copy raw files from your iPhone.
    This will allow you to edit .plist files - which is a good "first step".

    iFile won't really help you at all with viewing the source of .dylib files, which are compiled code. There are tools for tearing them apart, but really really NOT easy or intuitive or useful unless you already have a good idea on how they work.

    iFile is a paid app on Cydia- but it's a good one.

    If so, I canít imagine it being too hard to read up on Obj-C and make adjustment to the Weather Icon code to source live data from the stocks app instead of the weather app.
    I'd suggest going to a bookstore and finding a good thick reference (or two!) on the language,
    and another for general iPhone programming technique.

    Also, expect to invest some time into it.

    This is probably beyond the scope of the discussion, but if I can do that, is it ethical? Is there some un written rule not to steal developerís code and use it as your own?

    Thanks again.
    Depends on what you're doing, and how.
    • Reading someone's Obj-C source and using it as a general guide on how to roll your own- shouldn't be an ethical problem.
    • If you copy their code and actually use it in your new application you will need their permission. Check out what the license states.
    • If the license is GPL, then you can only copy their code if you use the same (free) GPL license. In this case permission normally should be granted (and not required), but it's common courtesy to ask anyway.
    • If the license is not stated, you need to ask the developer first. I don't see a license on WeatherIcon, so you should ask.
    • If you plan to release yours commercially (not for free) then: you MUST ask the dev for permission to borrow their code, and they are likely to not grant that permission.
    Last edited by raduga; 03-16-2012 at 07:33 PM.

  10. #8
    H4CK3R's Avatar
    Join Date
    Jan 2012
    Location
    java.lang.IllegalStateException: Location unknown.
    Posts
    5,832
    Thanks
    63
    Thanked 264 Times in 253 Posts

    I'm not much of a developer myself, I'm more of a hacker. Sorry for that *Facepalm* I did mean XML

  11. #9
    Green Apple
    Join Date
    Aug 2008
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts

    check out iosopendv.com it installs the packages needed to make cydia tweaks with xcode. I can make apps but so far the tweaks have been beyond my scope. Still this software should get you started maybe.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts