
, «» , - . OpenWrt GPIO ( ). , .
«» , . . LuMini. , , «» , , .
, LuMini . iOS, , . , reverse-engineering Android-. - , Java-, . apk .
apk Google Play,
. . , ,
Node.js, «» . , . , — .


.
1. . .
2. .
3. (, ). .
4. , , .
. . OS X Swift’e, . ,
.
OS X Swift, , -, . , «» : . ( ).
.

— Swift Objective-C.
— , AppleScript.
— , ?
— , .
— , , , Safari.
— (
). .
— , .
.
tell application "System Events" to set frontApp to name of first process whose frontmost is true
if (frontApp = "Safari") then
using terms from application "Safari"
tell application frontApp to set currentTabUrl to URL of front document
tell application frontApp to set currentTabTitle to name of front document
end using terms from
else if (frontApp = "Google Chrome") then
using terms from application "Google Chrome"
tell application frontApp to set currentTabUrl to URL of active tab of front window
tell application frontApp to set currentTabTitle to title of active tab of front window
end using terms from
else if (frontApp = "Lumen Taba") then
return 1
else
return
end if
return currentTabUrl
background’e .
let qualityOfServiceClass = QOS_CLASS_BACKGROUND
let backgroundQueue = dispatch_get_global_queue(qualityOfServiceClass, 0)
dispatch_async(backgroundQueue, {
while !self.needStop {
self.isRunning = true
var error: NSDictionary?
if let scriptObject = NSAppleScript(source: self.scriptText!) {
if let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(
&error) {
if output.stringValue != nil {
if (output.int32Value == 1) {
continue
}
if self.urlValidator.isUrlStringBanned(output.stringValue!) {
if self.lastBadUrl == output.stringValue {
continue
}
self.lastBadUrl = output.stringValue
NSNotificationCenter.defaultCenter().postNotificationName("BadUrlIsOpened",
object: self.lastBadUrl)
continue
}
}
if self.lastBadUrl != nil {
self.lastBadUrl = nil
NSNotificationCenter.defaultCenter().postNotificationName("BadUrlIsClosed", object: nil)
}
} else if (error != nil) {
print("error")
}
}
sleep(self.CHECK_INTERVAL)
}
self.isRunning = false
})

Swift.
url . - regex . . , , - ( vk.com Google). , :
private func checkUrl(url: NSURL) -> Bool {
let domain = url.host
if (domain == nil) {
return false
}
let badRegexes = getBadRegexes()
for br in badRegexes {
if matchesForRegexInText(br, text: url.absoluteString) {
return true
}
}
return false
}
private func matchesForRegexInText(regex: String!, text: String!) -> Bool {
do {
let regex = try NSRegularExpression(pattern: regex, options: [])
let nsString = text as NSString
let results = regex.matchesInString(text,
options: [],
range: NSMakeRange(0, nsString.length))
return results.count > 0 ? true : false
} catch let error as NSError {
print("invalid regex: \(error.localizedDescription)")
return false
}
}
, .


, .
, , :
goo.gl/ppnr6z.
14 , ,
« Lumen» 10%- , GEEKT-UL.