iOS Changing App icon at runtime - ios

I want to change my app icon at runtime. I read other similar threads on SO, and they say that it is not possible using Apple sanctioned APIs. One of the responses mentioned that its possible using restricted APIs, but did not elaborate.
I understand that if I use restricted APIs, my application scope will be reduced to jail-broken devices only. I'm ok with that, but how do I implement this feature.
Sorry, I cannot indicate any research effort for this question because I have no idea how to go about it or even how to get started on this.
Thanks in advance :)

Although this is an old question, I recently discovered this is now possible, as of iOS 10.3:
https://developer.apple.com/documentation/uikit/uiapplication/2806818-setalternateiconname
...using the UIApplication.setAlternateIconName(_:completionHandler:) API.
Note however you are limited to using icons which are already shipped as part of the app bundle.

Related

Does Apple accept iOS apps with statically linked OpenSSL in the app store?

This question is not really technical in nature but it is clearly answerable with yes/no and so I hope its fine if I ask it here on StackOverflow.
My scenario is as follows: In order to share code between iOS and Android I'm using C++ for much of the app's logic. I'm about to start writing network code for both platforms and I plan to utilize OpenSSL or one of its derivates (LibreSSL / BoringSSL) to be able to do HTTPS calls.
OpenSSL/LibreSSL/BoringSSL would be statically linked into my app and periodically be updated by releasing a new app version.
However, I'm unsure about whether Apple would accept such an app in its app store or not. As far as I know they take a closer look at what is inside the app and I want to prevent a situation where all code is written but eventually rejected when attempting to publish the app to the app store.
I'm looking for a clear yes/no answer whether Apple accepts such apps nowadays (2019). Preferably this answer is coming from someone who actually knows the answer i.e. from someone having done the same recently (2018/2019).
Did anyone recently succeed in publishing such an app into Apple's app store?
Not only does Apple allow this, that's exactly how one is supposed to use OpenSSL in an iOS app. The operating system doesn't provide OpenSSL for the apps, so the apps need to bring their own one.
You'll probably need to declare the use of encryption to comply with encryption export regulations. It is, however, required even when using the system encryption like TLS.

How to push Swift code to client through server in iOS?

I want my app to make urgent security updates without going through Apple's review process. I am not trying to do this for all my updates, or circumvent Apple's reasonable review requirements. All it would have to do is push a .swift file to the client, which would be accessed somewhere in the app.
I definitely know there is a way to do it in JavaScript, as I already made a mechanism of the same type in a React Native. I used this approach, but I don't think there is an equivalent for iOS from what I've heard.
There definitely is a solution, as I've heard many devs doing this (for less, um... valid reasons) but I can't find it.
You cannot do this, for both technical and policy reasons. Apple expressly forbids you from delivering new code to your apps's outside of the app store process.
The other part of it is that your apps run compiled object code, not source code. Aside from the iPad Swift playgrounds app, there is no Swift compiler on the user's devices.
Javascript is a horse of a different color. That's an interpreted language, and is designed to be delivered and run dynamically.

Detect which app is in foreground on iOS9 without jailbreak

I'm trying to log users individual app usage on iOS9.
I'd rather prefer that it wouldn't use jailbreak limited solutions, self explanatory. Doing the variation of this app on a jailbroken phone shouldn't be hard.
This will certainly not be released on the App Store as Apple wouldn't allow it.
I'm looking for any private API that can do this, any hidden iOS API's that can be used to do this. ANYTHING.
What I've already looked through:
how to determine which apps are background and which app is foreground on iOS by application id
How to know about app launched and details jailbreak iOS 7
Is there a private API to be able to detect what is current foreground app on iOS?
How to monitoring App running in the foreground in iOS8?use the PrivateFrameworks SpringBoardServices
which proved to be relatively helpful - we now can assume that there is some sort of additional access requirement, probably an entitlement, but we don't really know how it should look like
Can you find individual app usage duration using SpringBoard services framework or other private framework?
Find out active application or if on Springboard
Programmatically detect which iOS application is visible to user
However all of these proved to be unhelpful because Apple fixed this security flaw with iOS8 and the method to copy/access the currently front most app bundle identifier no longer works.
Question is: Is there someone who knows a workaround using different tools/exploits that do not require jailbreak?
Ideas:
inspecting the processes running on the device and devising an algorithm that would be able to recognize spikes that mean an app has been launched, which potentially could work, but it probably would be a major pain in the ass. Questions mentioning this solution:
Detect which app is currently running on iOS using sysctl,
Return a list of running background apps/processes in iOS
How to get Names of Background Running Apps
Find Background running apps in iphone
inspecting the phones traffic somehow?
not sure if there is some kernel stuff that I could do
Here is my Reddit version of this question if anyone wants to check it out. Also if it's of any value, here are the runtime headers for iOS9 and list of Apple's private API's.
Unfortunately, I was looking for a similar solution and have come to the conclusion that, at least at this point in time, there are no known methods that will allow you to determine app usage on iOS. Even the MDM providers such as Good, Airwatch, MobileIron, etc. don't seem to be able to do this. If anyone is able to come up with a solution, I'd love to see it.
For now, however, I think we would have seen a solution if someone had one that worked on the latest iOS.
sysctl is still open but they block certain combinations of selectors. I did this on iOS 7 and gave Apple Product Security the code. They won't patch iOS 7 but rely on App Review. iPhone 4 is wide open.

Access private APIs on NON-jailbroken devices for Business use ONLY

This question follows the answer provided by Nate on this link:
How do I change my iOS applications' entitlements?
It seems the described procedure is to be applied on Jailbroken devices.
I'm interested in being able to turn off the screen via my iOS application.
Previous answers point to doing this:
void (*BKSDisplayServicesSetScreenBlanked)(BOOL blanked) = (void (*)(BOOL blanked))dlsym(RTLD_DEFAULT, "BKSDisplayServicesSetScreenBlanked");
Then
BKSDisplayServicesSetScreenBlanked(1); // 1 to dim, 0 to undim
I read that the app also needs com.apple.backboard.client entitlement.
This is where my knowledge stops.
How can I use this in my app if the app is ONLY to be used in a business context controlled via Apple's MDM platform ?
I do not want to jailbreak the device.
First of all, very interesting question. Unfortunately, I don't have the answer, but have some info to share:
I am not aware of any method to add entitlements to 3rd party apps on NON jailbroken phone. You can check my question here: Does anybody know a way to add entitlement to iOS application for non jailbroken device? A lot of upvotes, no anwer thought :(
Generally speaking, entitlement area was reverse engineered to death and there is quite small chance of finding some holes around it. So, I would say, you will have to dump BKSDisplayServices method and search for something else to turn off screen.
I tried to find a way to turn off display on non-jailbroken device too, even posted a bounty on it: Turn off display in iPhone OS (iOS)
There were several answers, but none of them worked well enough.

Run app "as a service" on iOS / Cydia

I'm currently trying to create a little app that should run in background. It should start with the system or springboard and run until the device shut's down. I searched for tutorials out there but doesn't found anything really useful. It would be great if someone would help me out.
Best regards
EDIT: I'm sure that it isn't possible in an app designed for the appstore, but i'm looking for a variant that work's on jailbroken devices.
ColinE's answer is wrong. SuperDev's is correct. You certainly can create services on iOS, just as on OS X.
As another reference, the best tutorial I've found on the subject is Chris Alvares' blog post on creating an iOS Launch Daemon. (Launch Daemon is the proper iOS terminology for what you're describing)
You may find additional useful information within the Apple Docs for Launch Daemons, or searching for OS X information, instead of just for iOS, where it requires jailbreaking (and therefore is less widely used).
Cydia has lots of apps that are launch daemons, or contain launch daemons (possibly in addition to a UI application).
Have you read about launch daemons? You could use one of those. An example is untrackerd by rpetrich, an awesome cydia developer.
This is not possible, you cannot create 'service' type apps:
iOS: Keep an app running like a service
This is by design. Apple limits the the capabilities of your apps in order to ensure a good user experience. If everyone could create background services, it would soon slow down the user's phones - like a Windows PC!
Have you tried reading about Mobile Substrate? It let's you build extensions for the springboard. That way you could run the app in the background.

Resources