Is there an Iphone app <-> UID correlation? - iphone

Android maps each app to it's own UID. I was just curious if the iPhone does something similar.
To avoid confusion with another post, I'm referring to UNIX User ID here.
One more note on this. The way to check is, is to open up a terminal app and get a shell on the phone ( I'm assuming iPhone has one). Once you have the shell run the "ps" command. I just want to know if the user ids of the apps are different.

iOS's sandboxing doesn't work the same way Android's does. Apps all run as the user "mobile". If you're interested in how the sandboxing actually works, check out the Mac OS X documentation for the (optional) sandbox available to Mac apps—I'm pretty sure they're the same thing.

There is metadata in each iPhone app's .ipa file that contains information related to the purchaser's iTunes account user ID. However this iTunes account is not related to any OS user account on the device on which the app is run.

iOS does allow you to call getuid(), getgid() and friends. But they always return 501, if I recall correctly.
I don't recall seeing a call that allows you to fetch a 16-byte UUID created by the OS during install (similar to what Noah suggested). I think the closest thing is the identifier com.example.myproduct.

Related

Using company iOS Developer for private iPhone

I have an access to a comapny iOS Developer program and I was given an iPhone 4 for testing app. I wonder if it is possible to add//assign my private iPhone to the same account without letting admin know about that?
Probably not.
If you add a device, whenever the Admin will check the account, he will probably notice another device has been added. I am not fully sure how it works with the company accounts, but I think the only difference will be that you Device ID would pop up under the "registered devices" section, not your name.
BUT
If you shouldn't do it, don't. If it doesn't matter if you do add your device, then just tell your Admin. But the company account can only provision to so many devices, so if those spots for devices are needed, then you could find yourself in a bit of trouble if you used one up for your personal iphone.
IMO, be a good boy. Do whats right (not saying your doing something wrong though).
No, every single device registered will be listed under devices, in the developer center account, you can wait for iOS 7 it will be free to update, so be patient.

An iOS App how to find all other application on the iPhone?

Bump, Chomp & Appsfire all can list other application on the iPhone, how to do it?
By using Google I found this link quite helpful, it says basically there are two ways to find if certain apps are installed without jailbreaking your device:
checking if a specific URL scheme is supported by the device => canOpenUrl:
comparing the devices currently running processes to known app executable names => sysctl()
Short answer, you can't.
Longer answer you can't without violating the dev agreement and risking app rejection.
There are two methods of doing this (on a non-jailbroken phone):
Check to see if custom URL schemes that are known to be used by certain apps are registered as described in http://www.iphonedevsdk.com/forum/iphone-sdk-development/37103-finding-out-what-apps-installed.html (this allows you to check for certain known apps, not get a list of all installed apps.
The way appsfire does with a desktop 'companion' app, that grabs this info from your iTunes and sends it to their server. (See this article as to why the appsfire developer pulled his app because apple wouldn't approve an update anymore).
Sorry I couldn't be of more help but that's apple!

iOS (Apple): Is there any way for the application to ask the OS to block the device in that application?

I would find useful, in some cases, and under the user's permission, to block the device so only the running application can be accessed unless the usrer's password (pattern or whatever is used to unlock the session) is introduced.
I guess the mecanism should be something like: The application asks the os to do this, the OS asks the user for permission and then the application asks the device to block the application on "exit" or standby (or both).
This would be useful for using an iPhone or iPad as a device for public use. One example could be a Library where visitors can see the book list and some previews in the device. In this case, you don't want the user to access any other resource/application in the system.
Does it make sense?
What your asking is there any type of kiosk mode for iOS devices.
The short answer in no. The longer answer is if you're using a Jail broken device you might be able to relaunch the app on exit, but it would take significant R&D.
I hade a client ask about this last week, after some investigation and thinking I told her,
It's best to look for a case that blocks the home button. Or some kind of security bracket. It'll be cheaper and easier.
Also any App you create with this functionality would be rejected form the App store.
If your looking for advice on programming Jail broken devices there is a Stack Exchange proposal you can follow.
Supposedly there's a way to have a "kiosk" mode with a .mobileconfig file. Both of these articles talk about it, basically covering the same territory:
http://joris.kluivers.nl/blog/2012/03/02/kiosk-mode-for-ios/
http://rick-hawkins.blogspot.ca/2012/01/turning-ipad-into-kiosk-device.html
I was looking into this again and found out that iOS already supports the feature. It is called Guided Access, it was incorporated on iOS 6, it does not require jailbreak and can be used for any app installed on the device.
It makes sense, but I don't think you can do that without jailbreaking the phone. In iOS, the home button cannot be overridden by applications. Besides there is cheaper hardware out there for kiosk-style applications.

How can I install our iPhone project without connect the device but only using device ID?

I want to build my iPhone app only using device ID without connecting the device to my apple PC. Can I do this?
You can use the simulator, and never develop on the device. Is that what you mean? I wouldn't like to be one of your customers when I bought that app from the appstore in that case though - there would be so many defects.
If you don't mean that, how would you get the app on your device? I'm confused.
Are you suggesting that you do not want to test your app on a real device before releasing it? Please don't do that. There are a lot of differences when testing the app on a device or on simulator.
If you want to create a build for adhoc testing without connecting a device to your mac, you can do that by simply creating a mobileprovision file for adhoc testing where you can specify upto 100 device ids. For this you need to be a member of the Apple Developer Program though.
If I read your question right, you want to put your app on your phone without actually connecting your phone?
If so, it is not possible. You must connect your phone to load applications you develop.
if you are registered iPhone developer, u can create Ad Hoc distribution via defining device ids that you want the app to be used (steps are listed at 'Program Portal User Guide' at apple's developer site). then u can install the app on your device via iTunes.
Well, you can't install just based on the device number or something else.
There are two solutions:
1/But what you can do without plugging the phone is to Post your App on some testing platform like TestFlight, or Answers. And you enter users' email address and they can get the email.
2/You can set up a config file that declare your OS X Server address. And add the iPhone into your Server Open Directory. Then you can send and deploy the app to iPhone devices.
If you have future questions, comment.

Can an iPhone App Be Run as Root?

I am thinking about the design of an iPhone app I'd like to create. One possible problem is that this application will have to run as root (to access certain network ports). In a typical UNIX app, I'd just get the app to run with setuid, but I'm wondering if that is possible with an iPhone app.
I've read this question in Apple's forum, which is discouraging:
http://discussions.apple.com/thread.jspa?threadID=1664575
I understand that Apple wants to limit what a program can do, but there are plenty of good, legitimate reasons for a user to run a program with elevated privileges. I'm not trying to create a hacker tool here.
I'm sure I could get around this on a jail-broken iPhone, but that's not what I'm after. Is there any way to run an app with elevated privileges on an unbroken iPhone?
(BTW, there is no need to warn me about the NDA.)
Section 3.3.4 of the iPhone SDK Agreement suggests that you mustn't work outside your sandbox.
Given that Apple has been somewhat arbitrary on which applications they permit, you should definitely double-check with them before you start developing.
Compared to 2.0.x, the sandbox restrictions have actually increased in 2.1; you can no longer even read from another application's sandbox. So, even if it currently is possible to elevate your app's privileges, it very likely won't be in a future release.
The only options you have is
Run the application as root on the iphone
Set the applications setuid bit and owner root.
I can't see any of them being blessed by Apple.
I guess it depends on what you want to do with the privileges, if you're lucky there might be more fine grained privileges available, but afaik you have to choose a port above 1024.
Doesn't matter one bit if you can do this on your normal desktop computer. The iPhone is not a normal desktop computer.
Unlike a desktop computer, the only way to get an application on the iPhone without a jailbreak is to get it from the App Store. The only way to get on the App Store is to follow Apple's rules, and Apple's rules clearly include "no privilege escalation", "no escaping the sandbox", and "no accessing network ports outside the existing, provided APIs".
What you want to do is not possible.