How to set up a sftp server on iOS - ios

In my project, I would like to set up an sftp server on my iOS device which may use the app sandbox directory as root. Not a client which can connect to a sftp server.
Is it allowed to do so? What I've found on the internet are sftp clients , nothing for a server on iOS.
If we are allowed, is there any library we can use?
If not, how may I build the server myself?

I would go for an SFTP server written in C or C++.
There are lots of examples for these languages. e.g. sftp-server.c
You add the .c and .h file to the iOS project, you change the name of the main function to something else, you run the function formerly known as main in a separate thread (to liberate the main thread), and Bob's your uncle...

Related

Windows Defender SmartScreen and electron app

I have developed a very simple electron app, which I then packaged using "electron-packager".
I zipped up the application and sent it to my client. When this client runs the application, he gets the "Windows protected your PC" window/warning with "Windows Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.
App: AppName.exe
Publisher: Unknown publisher
Along with the "Run anyway" and "Don't run" buttons.
The app runs fine when the user clicks on "Run anyway", but understandably he would like to get rid of this warning (and at the very least show the actual Publisher).
I know about the code-signing certs, so there is no need to go there...
(IMPORTANT NOTE: I haven't asked him to look at the properties of the file to see if Security indicates "This file came from another computer and might be blocked to help protect this computer.". I am going to check that tomorrow and hopefully it just needs to be "Unblocked".)
What I am wondering is, why don't I get this same warning when I run the application on my PC? (We are both running Windows 10.) I have cranked my UAC all the way up to "Always Notify" and I have tried setting "Check apps and files" and "SmartScreen for Microsoft Edge" to "Warn" and even "Block". Still, the application always starts with NO errors or warnings. If I could at least reproduce what he is seeing, I would at least know if/when the code-signing works.
(To be clear, I'm not using an "installer". The client doesn't want one. And, as I said, this is a very SIMPLE application/utility. They want to be able to copy the zip file, unzip the contents and run the app..)
Any help is much appreciated!
Yes. The issue is, that when files are received from the internet, there is a download flag set. This is depending on certain conditions.
I've experienced, that files from local network addresses don't get this flag.
You can find the flag in the File Properties dialog.
When this flag is set, the SmartScreen scans the file and checks, if it can be trusted or not. This is depending on the reputation of the signature used to sign the executable.
Reputation for a certificate is established automatically. If you cannot wait, then you need to use an EV cert.
hope this works for you.
I use "electron-builder" to build my application and it exports a .exe file then I archive this file by WinRAR app and set it for download.
when the user downloads this file and extracts this file it automatically removes the downloaded flag from the .exe file and the user will not see the warning anymore this solution worked for me.
The solution to this is for the client to "unblock" the zip file before extracting. (Or, I suppose extract it, then unblock the exe....) To reproduce the problem, I just emailed it to myself. :)

Can I build a localhost resided on an IOS(ipad ,iphone) or Android tablets with Node.js(JXcore) ?

Background: we have an existing web application written in JAVA with tomcat, JVM environment etc.
And now, the client want to have the partial application running on their tablet devices in an offline environment which breaks the rule of Client-Server (no internet access !)
In order to do less coding/development, our team decided to use nodejs and to write a light weight platform independent server side code, (localhost +browser access, it seems awkward, but it is impossible to rewrite the whole application in Swift and SDK etc).
Can this be achieved though JXcore or other frameworks?
(it is just a CRUD type application)
Or what other solution you can think of in this situation. (no internet connection environment)
No. You can't create a native iOS app using Node.js
And also there isn't any bridging between Swift and Node.js
Though there is something called NodObjC which exposes the Objective-C runtime to Node.js in a high-level.

Can I use FindFirstChangeNotification to notify on files created on a network drive?

I need to detect a file being created on a NAS drive. The system that needs to be notified is running Windows. I first tried Watch 4 Folder 2.5 but it did not work. The author reports it does not support network drives.
So I looked for ways to develop my own utility. I found the ATFileNotification Component for Delphi.
It can detect changes if the Windows machine that is running the notify utility creates or deletes the file on the network share. However, if the file is created by any other machine on the network, the utility does not notify.
The ATFileNotification component encapsulates the Win32 FindFirstChangeNotification function. Is the inability to detect changes on a remote drive not caused by the system where it is running a fundamental shortcoming of FindFirstChangeNotification, or is there some type of parameter I need to set or other workaround?
If FindFirstChangeNotification is unable to perform this task, is there any method to detect remote files other than polling the remote directory on a timer?

iOS - SimpleFTP How to use SFTP (ssh)?

I am trying to use Apple's code from their SimpleFTPSample project to upload/list directory in my app. I am able to get it working on a server using just FTP, but I need it to now work on a server that requires SFTP logins.
Is there a way to set the NSStream to use 'SFTP' when connecting?
Here is Apple's project example: https://developer.apple.com/library/ios/samplecode/simpleftpsample/introduction/intro.html
FTP and SFTP are very different protocols. Have a look at https://github.com/karelia/ConnectionKit - this is a library that supports ftp, sftp and webdav transfers
Ooops! I missed where the iOS bit wasn't ready yet! Perhaps the libraries in this answer will help

Connecting to sFTP from within an iOS App

I'm new to Objective C and Xcode, but was wondering how to connect to a SFTP within my application. I've successfully connected to FTPs before, but was hoping to keep more secure in the future. When connecting with a regular computer you need a special SFTP client, so I wasn't sure what steps I'd have to take to connect within an iOS App.
Also, what are your opinions of SSH FTPs Vs. SFTPs?
There are plenty of open source libraries like NMSSH or DLSFTPClient. Please, don't use proprietary components, support open source.
Your best bet is to download a library and put that into your app. I would recommend Chilkat. He has wrote a lot of stuff for sftp.
Good luck.
look at some of these (http://www.example-code.com/ios/sftp.asp)

Resources