iOS; block access to certain applications programmatically - ios

Is there any way to block access to certain application programmatically on iOS? Using private APIs or workarounds is not a problem in my case.
Thanks in advance!

This tutorial does basically what you want to do, assuming your second sentence means you're working with jailbroken iOS.
Basically you write a hook for the SBApplicationIcon class that looks something like this (code not mine):
%hook SBApplicationIcon
-(void)launch
{
NSString *appName = [self displayName];
if ([appName isEqualToString:#"blah"]) {
// react accordingly
}
%orig; // Call this if you want to proceed with launching the app in question.
}
%end
You'll need to link against UIKit, I believe.
EDIT: to clarify, the above code is using Logos. I'm sure it's also possible using the Objective-C runtime directly, but I'm not familiar with that.

There are certain apps that block access out there that force you to input a password. For example, you can take a look here https://apple.stackexchange.com/questions/31154/how-do-i-password-protect-access-to-specific-apps-in-ios to find some ideas. Hope this helped!

Related

Call ObjC function from nodejs-mobile script

I am running a Websocket client using nodejs-mobile in my iOS app. The other part of my app is done in Objective C. I want to pass text messages received from the Websocket (nodejs-mobile layer) to the ObjC layer. I could not find a solution for it. Is it even possible and can someone provide a way to do this?
For example on JavaScript side something like:
callObjCfunction(myObjCfunction, textmessage);
On ObjC side something like:
- (void) myObjCfunction:(NSString*)textmessage {
[textfield setStringValue: textmessage];
}
Note: this is only an example. If there are other ways to communicate between these two layers I am interested in it.
EDIT: Found a solution which is surely not "best practice" and very limited but it works for me since I only want to pass text messages. I'm calling console.log() in JavaScript and redirect the stdout in native ObjC.

Old app headers into newer app version? [Jailbreak Tweak]

Sorry, for the confusing title. I am developing an iOS Tweak (for jailbreaks)
What I am trying to accomplish is something I haven't seen people do before but I am sure it is possible!
as an example lets say I am trying to change my username.
in app version 1.0 in the User.h there is a method called
- (void)setChangeUsername:(id)arg1;
which allows the change of usernames within the app, now on app version 1.2
the method is rendered useless / isnt there.
how could I reactivate this method so it allows the change of usernames?
would I have to edit the app binary, or import some old headers, not even sure what the first step of this process is, or if its even possible.
Sorry for the vague example but I hope it is enough information to get what I need answered!
If you would like more information I would be happy to write some more and be more detailed :)
Thank you!
You can't call or hook a function that no longer exists. If you want to change the username you will have to find an alternative method to do so.

How _CTServerConnectionStartCellTracking works?

I'm trying to use a private API to retrieve radio cell information.
Since iOS 8.3, the old API doesn't work anymore. So, I'm trying to find another one. I found this method:
_CTServerConnectionStartCellTracking
Apparently, there are CFStringRef keys for
_kCTCellTrackedCI, _kCTCellTrackedLAC, _kCTCellTrackedMCC and _kCTCellTrackedMNC
But I don't know how to use them. I think that the first parameter should be a CTServerConnectionRef, but I have no idea for the others.
Do you have any further information?
Thank you :)

Using Telprompt:// to make a call (editing message)

I have a pretty simple question with perhaps a difficult answer.
Is it possible to edit the message that is thrown when you use "telprompt".
My priority is that i want to make a call and that after that call i want to return to the app itself instead of the Apple phone app.
But when i use a webView or the telprompt method it throws a message. I guess this is for safety reasons which is fine.. But the message only displays a phonenumber and two buttons. I want to add a name or something here.
Is this possible? How?
Thanks in advance.
No, you cannot. Period.
(chit chat chit chat to reach characters limit)

iOS - when a button is pressed, how do I get the system to make a remote call to my server?

I have been using a storyboard, and I have not gotten into the code much, and now it seems that it is time.
I have a form and when the submit button is pressed, do I need to put code to handle that into the .h or the .m file? Also, are there examples of handling a button and making a remote call that I can reference somewhere?
Thanks!!
You might find Apple's Your First iOS App document helpful; it covers connecting buttons to actions in code.
As for making a remote call; there are many ways. I would suggest you look into NSURLConnection and friends as a stating place, but there are many, many libraries to help with this, such as RESTKit.

Resources