This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
clang++ -Wall -o testshunt testshunt.c /usr/lib/libgattlib.so | |
*/ | |
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include "gattlib.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var localUser: ZDCLocalUser? = nil | |
ZDCManager.uiDatabaseConnection() .read { (transaction) in | |
localUser = transaction.object(forKey: localUserID!, | |
inCollection: kZDCCollection_Users) as? ZDCLocalUser | |
} | |
if let localUser = localUser { | |
if(!localUser.hasBackedUpAccessCode){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let setupVC = ZDCManager.uiTools().accountResumeSetup(forLocalUserID: localUserID) | |
{ ( localUserID:String?, completedActivation:Bool, shouldBackupAccessKey:Bool) in | |
// .. do something with new localUserID | |
} | |
// push the setupVC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBOutlet public var userAvatar : UIImageView! | |
// assume user is ZDCLocalUser or ZDCUser object. | |
// fallback to default if no image found. | |
let defaultImage = { | |
return ZDCManager.imageManager().defaultUserAvatar() | |
} | |
// handle image found in cache | |
let preFetch = {(image: UIImage?, willFetch: Bool) in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var localUser: ZDCLocalUser? = nil | |
ZDCManager.uiDatabaseConnection() .read { (transaction) in | |
localUser = transaction.object(forKey: localUserID!, | |
inCollection: kZDCCollection_Users) as? ZDCLocalUser | |
} | |
if let localUser = localUser { | |
print(user.displayName) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let setupVC = | |
ZDCManager.uiTools().accountSetupViewController(withInitialViewController:nil, | |
canDismissWithoutNewAccount:true) | |
{ ( localUserID:String?, completedActivation:Bool, shouldBackupAccessKey:Bool) in | |
// .. do something with new localUserID | |
} | |
// push the setupVC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": "... encrypted outbox object here ...", | |
"keys": { | |
"UID:z55tqmfr9kix1p1gntotqpwkacpuoyno": { | |
"perms": "rws", | |
"key": "... wrapped key here ..." | |
}, | |
"UID:jag15iacxneuco7owmegke63msbgyuyx": { | |
"perms": "r", | |
"key": "... wrapped key here ..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": "... encrypted conversation object here ...", | |
"keys": { | |
"UID:z55tqmfr9kix1p1gntotqpwkacpuoyno": { | |
"perms": "rws", | |
"key": "... wrapped key here ..." | |
}, | |
}, | |
"dirPrefix": "F8622C33B26C43C7B7DB3A6B26C60057", | |
"version": 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setting a tag | |
cloudTransaction.setTag(fileURL, forNodeID: node.uuid, withIdentifier: "url") | |
// Getting a tag | |
let fileURL = cloudTransaction.tag(forNodeID: node.uuid, withIdentifier: "url") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let comps: ZDCNodeMetaComponents = [.metadata] | |
zdc.downloadManager!.downloadNodeMeta( node, | |
components: comps, | |
options: options, | |
completionQueue: DispatchQueue.global()) | |
{(cloudDataInfo: ZDCCloudDataInfo?, metadata: Data?, thumbnail: Data?, error: Error?) in | |
// data downloaded & decrypted for you | |
} |
NewerOlder