Killing an app on a jailbroken iPhone - iphone

I am currently trying to build an app that will kill other apps on my jailbroken iPhone. I would like my app to be able to kill apps even when my app is in the background. I only have one problem though I can not find a kill command to do this. I am a newer programmer so as many details as you can give would be appreciated.
Thank You

A very simple way (untested, but should work):
system("killall \"NAME-OF-EXECUTABLE\"");
Generally speaking, however, I would recommend using a branch of the exec functions instead of system to perform this task.

Related

Make command-line application for jailbroken iphone

I looking for some tools to make application for jailbroken iPhone.
In my application, I need to run another application (Unix-command line with parameters).
Maybe, somebody can advice me some developer tools or libraries, because I think, that XCode is not very useful tool for these purposes.
Thanks.
you could check out iOS Open Dev
or start reading iphonedevwiki
but, you can certainly write apps with XCode (and maybe some scripts to postprocess your app ... fake code sign and install with dpkg), that issue system() calls.
you may need privilege escalation depending on what you're trying to do

iPhone - app which can not be killed

I am trying to understand, is there any way to develop iPhone app with following conditions:
1) This application should always run in the background
2) This application should not be killable
3) With out JailBreak?
All I am trying to do is want to track my iPhone.
Please help me.
Thanks
It's not clear exactly what you want to do, but one of the cases where Apple allows apps to run in the background is so that they can respond to changes in the GPS location. It's not unkillable per se, but apps do relaunch automatically (I think) if they're killed due to low memory, etc.
See here for the Apple docs.
No, this is not possible unless you are Apple.
No. I'm pretty sure attempting this is going to get your app rejected (if its even possible!). The iOS system has its own ways of managing running applications and will kill apps if certain conditions are met (e.g. unresponsive for a while).
Check out the App State & Multitasking doc.
Your requirements are:
1) This application should always run in the background
2) This application should not be killable
3) With out JailBreak?
Answer:
I think there is no Non-Apple app which has all the three features. I think even one of these feature is nearly not possible.
Also if you say that Photos and Phone and others like Newsstand cannot be deleted, then you need to consider that those are apps of Apple and they have some more capabilities than what they give in Public API's to the developers.
They have some greater access to the iOS and many of its private API's which make them non-deletable.
Hope this helps you.
If you don't plan to release it to AppStore, but rather will sign with enterprise distribution certificate and will use it in your enterprise then you can look at VOIP application for iOS. It runs in the background, system restarts it automatically. I think that's the closest you can get on non jailbroken device.

How to build an iPhone app, make sure this app only run on a no Jailbreak device?

I am an iPhone developer, I am doing a project. For security reasons, I must make sure my app run on a no jailbreak iPhone. I want to know how to check it use public API.
Thanks very much!
No API exists to perform such a check.
Jailbreaking a device (using any of the various forms of jailbreaking) only needs to touch files which are outside an application's sandbox. Attempting to inspect them therefore carries a risk that your app will be rejected. Even if you can inspect them you have no way to differentiate a change due to jailbreaking from a change due to an OS update.
Finally please be aware that a jailbroken device does not necessarily mean the user has pirated your app. Users of jailbroken devices are free to purchase and install apps via iTunes just like anyone else and are likely to be rightly unhappy if your app refuses to run.
also, Apple removed the API for detecting jailbreaking. Read here on ars
If that would be possible using a public API, there wouldn't be any problem using jailbreaked iPhones, would there. Every app (including the OS) could just use that API...
It's impossible to verify that your app is running only on a non-jailbroken device. Unfortunately there's nothing you can check.
There are a few tricks you can use to determine programmatically if your app has been pirated, but they're far from foolproof; the most you can really do is determine if your app was pirated using the most common automated pirating techniques. Anyone really determined to pirate it can ensure your app doesn't know it's been pirated even if you use the techniques.
I wouldn't invest time in such things cause sooner or later "they" will find a way to run your App on a jailbreaked iOS device.
Instead take this time and develop more unique feature. Feature people are glad to have and even they pirated your App they will pay for it.
Yeah I know this sounds ridiculous but I think quality software will find honest buyers.
I know this answer doesn't answer your question and I want to add that iOS doesn't have a API to check if the device is jailbroken.
I hope I could help.
As the other answers say, there's no full-proof way of blocking piracy on your apps. I have a couple of apps that have been pirated and, truth be told, I was kind of happy to see that. Unless these people hack every single app on the App Store, it made me feel a little proud that someone had decided my apps were worth pirating. Almost a "yup, I've made it" kind of feeling. :)

Running python/ruby script on iPhone?

From the recent news from the Apple, I learned that one has to use C/C++/Objective-C for iPhone App. Accordingly, it's not possible to use MacPython or similar to make iPhone App.
But as the python/ruby interpreter itself is written in C, isn't it OK to make python/ruby interpreter for iPhone to run the scripts on iphone?
Is this possible? Does Apple support this? Or does someone implemented this? Or, the user should hack to do this?
Added
I don't distribute the python script, I just use it for my own utility. Even in this case, do I need a jailbreak? I mean, can I compile the python with Xcode to get the binary? Or, I expect someone has already done this.
Apple recently changed their policy on this and allowed a python interpreter App called Python for iOS to be put up on the App store:
http://itunes.apple.com/us/app/python-for-ios/id485729872?mt=8&uo=4
Full disclosure: I am the sole creator/developer of Python for iOS.
At present not at all. Apple licenses forbid to run any intepreter on it, and this is even before iPhone OS 4. You can make an intepreter by jailbreaking it but it won't be official and you won't be able to distribute it.
I don't distribute the python script, I just use it for my own utility. Even in this case, do I need a jailbreak?
No, you don't. You can compile a Python interpreter and run it on your own iPhone, as long as you have a developer license.
Maybe you can use ad-hoc distribution (according to Apple, you can distribute your app to 100 devices by yourself, outside of the app store) ?
See here

iphone multitask

I want to make my iphone run application in the background.I know there is a program called "backgrounder",but it isn't I want.What should I do?
This is flat out not allowed... period.
You may want to look into the development community for jailbroken phones. I think there are projects like that there, although you are severely cutting off your userbase.