Debugging through apple profile manager code base - ios

I am total ios/ruby noob trying to build a custom mdm server for ipad devices and from what Ive seen on Stackoverflow here and here , there is a mdm server available with OSX lion server . But since I want to try to run it on a mac, I have bought the app from the app store from here and I am trying to understand how it has been built by looking at the ruby scripts. But I am having difficulty understanding the code and was wondering if there is a way to debug through it to understand what does what. Is there a way to do this ? I think the frontend is built using sproutcore and the backend is all built in Ruby. I am trying to understand it so I can build a custom server on my own.
Thanks

I believe in this case, your best bet is MDM documentation. It's much easier to read the documentation to understand whole protocol, instead of trying to figure out from the source why they are doing one thing or another.
Here is reverse engineered documentation:
http://media.blackhat.com/bh-us-11/Schuetz/BH_US_11_Schuetz_InsideAppleMDM_WP.pdf
And Apple has full documentation. It was accessible on Apple developer downloads. However, I can't find a link right now.

Related

Blocking all connections to a specific domain only

I've been struggling to find how I could potentially implement a simple (iOS) app that would be able to block all connections to a specific domain (to prevent the user from accessing a specific social media platform for example, even from another app).
The information that I have found so far is that I should probably create a Packet Tunnel Provider within a Network Extension and ask the user to add VPN configurations, but I haven't found any example code that would show exactly how to implement this.
Do you have any idea how I could do that in a simple way (block all connections to a specific domain)? Is there a framework/library that I could use to do it easily?
Thank you!
Well, it would not be easy, but you can do it.
Sample code from Apple could be found here and here. This project is for iOS, but it may be on deprecated Swift version, so you will need to do some work to launch it now.
The part you are interested in the SimpleTunnel sample is FilterDataProvider and FilterControlProvider, other things you can omit, because the purpose of this sample is to demonstrate a lot of abilities.
There is also a sample for macOS that is more focused on your needs, and macOS SDK is alike to iOS, but less powerful.
You may want to see this video to sort things up in mind.
There are a lot of firewalls solutions for ios and mac, and some of them are opensource
The part you are interested in the SimpleTunnel sample is FilterDataProvider and FilterControlProvider, other things you can omit, because the purpose of this sample is to demonstrate a lot of abilities.
You will need a developer account, a network extension capability assigned to an application identity, and proper network extension entitlement file a to run things up.
There is a way to sign it manually for development without account&capability, but to distribute you will need it anyway.
For some restrictions you may be needed to install MDM profile on the device.

Rest Server on iOS device using Swift

I need a way to have an iOS application that can accept a message on a device connected via USB, query a bunch of data about the device and return a response with this data.
I am brand new to iOS and swift development so I need something that is;
Simple
Uses CocoaPods (due to lack of ios support in Swift Package Manager)
NOT require distribution via the App Store (which I believe rules out using APN)
I have tried the following:
BlueSocket: https://github.com/IBM-Swift/BlueSocket
This can probably do the job but is very low level and require lots of work around handling buffer sizes, etc. So a REST solution might be a better
Kitura: https://www.kitura.io/
This seems ideal. However, it only appears to support Swift Package Manager which makes it a big PITA to implement currently (reminder; swift/ios newb here)
CoacoaHttpServer: https://github.com/robbiehanson/CocoaHTTPServer
This looks ok, however I can only find Objective-C examples. Would prefer to have something that includes solid Swift examples (also, the repo doesn't look like it's been updated since 2015)
Are there any other approaches I should consider that I haven't listed here?
You may want to check https://github.com/IBM-Swift/Kitura-HelloWorld-iOS.
I wrote a couple of blog posts about it https://developer.ibm.com/swift/2017/03/13/kitura-ios/, https://developer.ibm.com/swift/2017/12/08/kitura-ios-part2/.
Note that it is a demo repository, I do not know if IBM will support Kitura on iOS (it is supported on Linux).

Using sockets to build real time chat for iOS?

If I wanted to build a real time chat app for iOS using Objective-C, what would be the best way of going about it?
Assuming you've got your server side things setup, you can use Square's Socket Rocket to implement the client side https://github.com/square/SocketRocket
If you're using socket.io at the backend, there are plenty of iOS libraries available for those as well. SIOSocket is one such library.
Maybe I am just lazy, but I do not see a point in building it all from scratch.
There are a plenty of backend providers who will be happy to provide you with ready backend and a library for building your app.
So, you'll just need to connect the solution to your project and make UI according to your needs.
Here are some backend providers you might consider:
ConnectyCube
Firebase
Sendbird
Layer
etc.
They provide different set of features, so I'd recommend checking those they provide first.
This article might be of some help as well.
Some of them like ConnectyCube can provide you also with development services, so you can order UI development according to your mockup design from them too.

Can I distribute my BlackBerry 10 WebWorks app via web server (OTA)?

I have a multi-platform mobile app that I am releasing on iOS, Android, Windows Phone 8, and Blackberry 10 (WebWorks). For the other three non-BB platforms, I have a way to distribute the enterprise app via a web server (user installs by clicking a link on a web page inside of a mobile browser). However, for BB10 Webworks, I can't seem to find a documented way to distribute a .bar file in this same manner.
Options:
1) I have seen docs that discuss placing Java-based apps (.jad and .cod files) on a web server for OTA distro, but can't find any documentation on being able to do the same with BB10 .bar files.
2) Blackberry App World - but this is public, which is not what I want for this enterprise app
3) Blackberry App World for Work and BlackBerry Enterprise Service 10 - both of these seem to be overkill for my modest purpose. I only have a single app and simply need a download link, not full app/device management, app catalogs, etc.
Is it possible to do #1 with .bars? Or is there another option I have not considered?
Thanks
I was not aware that sandboxed users could see apps other users couldn't, as mentioned in the one of the answer - something for me to try!
The only other option I am aware of is to "side load" the bar file, you can side load with various tools which you can find if you search, such as:
http://forums.crackberry.com/blackberry-10-os-f269/how-get-bb10-hardware-id-sideload-app-bar-file-into-blackberry-10-a-780773/
http://forums.crackberry.com/android-app-sideloading-f279/how-sideload-apps-bb10-device-easy-way-windows-825656/
I haven't tried out these tools, sorry.
I actually do it using the tools you get with the Android Command line toolset - available from BB web site here:
http://developer.blackberry.com/android/tools/
but this approach are not 'user friendly'. I use it because I have converted a few Android apps to run on BB10 and so got to know the tools.
I can't say that these tools are safe, since I don't actually know them, but what I can say is that I am not aware of any way that a PC based tool sending something over the internet (or USB) to your BB10 could break it, nor am I aware of any way that a side loaded app could break your BB10. The days of bricking your BB devise with a dubious bit of software do seem (thankfully) to be over.
Edit: Just thought I would update this given the options that Nate has found, which I also didn't know about!
Both the sites Nate has found seem to work in the same way as the tools I mentioned above. My understanding of all these tools is that they run a deploy utility, that connects to the BB10 device via a TCP/IP connection (which could be routed over WiFi or USB), and sends the bar file over this connection. The connection is initiated by the deploy utility, which is why it has to be in the same network.
There is likely some BBRY proprietary protocol involved, which includes an exchange of the password, as the password supplied to the deploy utility must match the development password on the device.
Now I strongly suspect that BBRY have not published the specification for this communication. I also strongly suspect that the password is never seen in the clear, so you could not use some tool like Wireshark to reverse engineer this. My suspicions therefore is that the tools, including the two I have pointed you at, all run something like the Android Command line tool under the covers - and they got this from BBRY. So perhaps you can build something like the web sites yourself - assuming you have the time and inclination of course.
Just a thought and just my opinion.
There is probably a better way, but I don't know about it. Anyway: you can deploy an app to the BB World, but not put it up for sale, then add users accounts to your sandbox. They, and only them, will be able to download your application, which will not be shown on the BB World to anyone else.
This isn't natively supported on BlackBerry 10, but it looks like there are a few hacks that people have already figured out to make this work.
Depending on your needs, these may or may not work for you (see especially the security caveats on the FAQ pages).
https://sideswype.me/
https://barinstall.com
These appear to take advantage of a VPN security hole. BlackBerry has previously patched this hole, but according to the BarInstall site, the owner just added support for 10.2, to work around the patch.
Both of these services do charge a modest fee, but it may be easier for you than maintaining a BES server.
Peter Strange's answer is quite comprehensive for the time it was written. I will just add that with the release of BB 10.2 you have the option to distribute your application OTA as an APK. Since you are using HTML5 for development I suspect there will be little performance difference between running the APK and running the BAR. But that is something you can check out if you have, or know someone with a BB10 device. Performance should improve with the release of 10.3.

Using packagemaker to build iOS app installer

I'm developing a sophisticated engineering calculation iPad app for a specific customer (much like the poster of this question). I'm getting ready to release a first version to them, and trying to get this distribution issue sorted out. There are pretty much 5 methods covered throughout that post (general App Store, B2B, Enterprise, Ad Hoc, and stuff requiring Jail Breaking), and most of the searching I've done has shown those same 5 options. I've been looking into TestFlight to manage the Ad Hoc distribution for beta testing right now, but down the road I'm going to need to allow my customer to mass install my app onto as many devices as desired (hopefully without needing to involve me at all by that point). So in the end, none of these 5 options are really attractive as a final solution.
A colleague found this App Doc that mentions something call packagemaker, which sounds like it's a Terminal tool, but I can't really find much on it (the Apple Doc simply says "create the package as you normally do", which is pretty much meaningless since I normally don't - and everything else I can find is from around 2009, and I've learned that anything described in those old posts is almost certainly wrong by this point when it comes to the Apple world). From what I can tell, packagemaker should let me build an installer executable that I can send to my customer, and they could just run that installer and it would put the app on their device. This is how we currently distribute similar software for Windows environment devices, and it would be ideal for what I'm trying to do.
Does anyone know if packagemaker can be used as I've described to install iOS apps? If so, can anyone point me toward a beginner-orientated tutorial on how to use it?
Packagemaker sounds like overkill. The old tuts should still work though, it hasn't changed much (or at all) since 10.5. It's a separate download from Apple Developer center.
You could use testflight, though I presume you want to install B2B apps, and not ad-hoc apps for testing.
In that case just create a bash script that builds and/or deploys your app to a connected device with xcodebuild and related tools. If you're concerned that your end user will find Terminal use appalling, write a tiny Cocoa app to support & run the script, and put the script and your iPad app into the bundle.
For example the app's User Interface could query the user for paths, the device, and whatever is necessary to deploy your app and pass it to the bash script which you can run easily with NSTask.
This is certainly going to be many times faster than getting into PackageMaker, and figuring out how it works - cause it really doesn't work in a straightforward way, unfortunately.

Resources