iOS Jailbroken devices development: How to dump method calls - ios

I am pretty new to development for iOS devices with jailbreak. From what I am reading I understand that to be able to do all the cool things which you can't do on non-jailbroken phones you have to hook up to a given class and override some of its behaviour. Since there is no documentation how a developer tracks to which class exactly he should hook?
I imagine that for instance if I wanted to have my app respond to a given event such as phone boot, call hang up or user clicking on an icon I would manually generate the given event and see what invocations have been made. Is this the proper way to track where you should hook your code and if yes how is it done.
Note I am not interested in exactly those events mentioned above I am more interested the approach in general.

There are several approaches:
Disassemble binaries
You can disassemble a binary or just dump classes with something like class-dump.
So, you can see the whole hierarhy of classes.
Find dumped classes
Most of major iOS subsystems were dissasembled by somebody already. You can find quite a lot of useful stuff.
As example. Google search "Springboard headers" got this
Dump classes in a runtime.
Look at this question for explanation: List selectors for Objective-C object

Related

Making a shareit clone ios

I am making an app that involves sending and receiving files from one iPhone to several other iPhones. I did a lot of googling and came nowhere in finding the classes that support the above said features. I am wondering whether it is possible and if it is possible what are the classes that i can use to do that
Take a look at my library https://github.com/abdullahselek/Merhaba
you can send data with Bonjour networking

iOS - make changes to app without requiring update via app store?

This may seem like an odd question, but I'm in the middle of creating an iOS app, and was wondering if there is a way to, in the future, roll out changes to the app without requiring all of the users to download an update.
I've noticed that Snapchat can do this with their filters - new filters are added regularly, without me updating the app.
I've read into 'Cloud code', something Parse had that apparently let you accomplish this. Obviously that's no longer an option.
Also, do Apple even allow this? Seeing as they need to approve every app before letting it onto the App Store, it would seem like they would need to approve any changes first too.
I've thought of strange things like storing a function in a database, then getting the app to download that function and run it - naturally if I were to now change the function in the database, it would change on all users devices instantly. Just how ridiculous is that idea? Thanks!
Depends on how much flexibility you want.
For example, Spotify does this for UI mainly - backend-driven UI, as they call it. They send a kind of layout from the server and convert it to a real iOS layout, based of a predefined mapping. You can find pretty more details in the Spotify's presentation.
Slides: http://www.slideshare.net/JohnSundell/backenddriven-native-uis
Video (more details): http://www.downvids.net/backend-driven-native-uis-john-sundell-and-diego-cristina-ca--777281.html
So actions can also be divided in similar pieces and abstractions, received from the server and interpreted - sort of scripting is needed. You can't compile and run arbitrary functions on the fly.
Hope it'll give you some ideas you can think of.
See Apple's app store review guidelines: https://developer.apple.com/app-store/review/guidelines/ section 2.4.5 (iv). Apps are not supposed to download code or resources to add functionality or significantly change the app from what Apple sees during the review process. And executable memory isn't even writable by sandboxed apps, which makes downloading compiled functions fairly useless. But downloading Javascript that complies with the above guidelines seems to be allowed.

What are Issues with Using Two Crash Reporters in Your App?

I am currently using Crashlytics in my app and it's working well. However, we are thinking of using NewRelic on the backend to better be able to pinpoint issues in our platform. The NewRelic mobile library has a crash reporter built into it as well (that can be opted out of).
I am assuming you don't want to use two crash reporters considering one will trump the other, however, I haven't seen any information on this anywhere and would just like to confirm.
Additionally if you could explain why along with the answer that would be very helpful.
You can only have one signal handler installed. The last one that registers "wins".

IOS swift - Tracking used apps

I'm currently looking for a way to track user activity. I'm working on an IOS app using swift and i need stats of apps usage. basically I want to get-make a tracking of the used apps. Data like opened apps, start time and shut down time... I know that for get all stats, maybe is necessary run a backgroud service, but, this is another problem that i think to solve after. for now i want to know if it's posible, if there is some way to get stats for used apps. I know that the UIApplication class call the UIApplicationMain function when an app is launched. Maybe, from my app, there is a way for access this info?... Thanks, i have been a long time reading but really, i can't see some clear option.
If (as David has interpreted your question in the comments) you are trying to track usage of other apps that aren't yours, he's right; you can only track your own app's usage.
If you are needing to track events in your own app, there are a good number of analytic frameworks available to do exactly what you are needing to do.
Flurry is one I've used in the past with success, and is one of the more well know solutions. I've also utilized Google's analytics framework. Both are pretty straightforward to integrate into your app and to track the sort of fine grained events you are looking to capture. You can't go wrong with either one of those.
Here is a (slightly old) list of additional tracking/analytics options beyond Flurry and Google's offerings.
You can record your feedback and user experiences, and bug reports with lookback.io

Modify builtin framework ios

I am a developer working on a robotics application for iOS. I do not intend to submit this app to the app store, nor do I have any wish for suggested methods to be apple approved....
I am trying to get bluetooth working, and I think a good place to start is to try modifying the existing apple frameworks. Is it possible for me to modify the frameworks so that when they are built to my iOS device the frameworks will be modified for the app (but not other apps on the same device)?
As a matter of fact, you can!
Objective-C allows you to "swizzle" methods to override their default behavior, and yet still call the original implementation if you want to. You can do this for any number of Objective-C methods, as many times as you want.
If you wish to override behavior that is present in C functions, you will need a little bit more control over the platform. Jailbreaking allows you to use the full power of Jay Freeman's CydiaSubstrate to hook or swizzle both Objective-C methods and C/C++ functions.
While I don't recommend the use of MethodSwizzle per se, the following URL has a good discussion of swizzling http://cocoadev.com/wiki/MethodSwizzling.
But you should really use CydiaSubstrate's MSHookMessageEx and MSHookFunction instead. Especially since you're not submitting anything to the App Store.
Now regarding Bluetooth, I've done extensive work in this field (I developed Celeste, which is a systemwide tweak providing vanilla Bluetooth OBEX support to system apps on iOS). I suggest you look into using something like BTstack, which provides you with access to the bluetooth module from the HCI to RFCOMM levels, and supports things such as SDP and pairing, which you will probably need. It also has the added benefit of not requiring method swizzling, which some people seem to think is some sort of satanic ritual that should be avoided at all costs.
Aside from categories (which extend the functionality of base classes delivered in those frameworks), I don't believe you can "modify" the existing Apple frameworks per se. A better course of action might be to simply create your own framework (or find somebody else's open source, commercial or simply third party framework) and then build that framework into the app that you install onto the iOS devices you want to work with.

Resources