Skip to content

Commit 3d68e5e

Browse files
committed
feat(ios-security): add typings
1 parent c88fd80 commit 3d68e5e

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

packages/ios-security/index.ios.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
declare var SecurityFacade;
2-
31
export class IOSSecurity {
42
static amIJailbroken(): boolean {
53
return SecurityFacade.amIJailbroken();
@@ -31,7 +29,7 @@ export class IOSSecurity {
3129
}
3230

3331
// @ts-ignore
34-
static amITampered(checks: NSArray<any> | any[]): NSArray<any> {
32+
static amITampered(checks: NSArray<FileIntegrityCheckFacade> | FileIntegrityCheckFacade[]): NSArray<any> {
3533
return SecurityFacade.amITampered(checks);
3634
}
3735

packages/ios-security/references.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/// <reference path="../../references.d.ts" />
2+
/// <reference path="./typings/objc!NativeScriptIOSSecurity.d.ts" />
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
declare class FileIntegrityCheckFacade extends NSObject {
3+
4+
static alloc(): FileIntegrityCheckFacade; // inherited from NSObject
5+
6+
static new(): FileIntegrityCheckFacade; // inherited from NSObject
7+
8+
constructor(o: { bundleID: string; });
9+
10+
constructor(o: { machO: string; machO1: string; });
11+
12+
constructor(o: { mobileProvision: string; });
13+
14+
initWithBundleID(bundleID: string): this;
15+
16+
initWithMachOMachO1(machO: string, machO1: string): this;
17+
18+
initWithMobileProvision(mobileProvision: string): this;
19+
}
20+
21+
declare var NativeScriptIOSSecurityVersionNumber: number;
22+
23+
declare var NativeScriptIOSSecurityVersionString: interop.Reference<number>;
24+
25+
declare class SecurityFacade extends NSObject {
26+
27+
static alloc(): SecurityFacade; // inherited from NSObject
28+
29+
static amIDebugged(): boolean;
30+
31+
static amIJailbroken(): boolean;
32+
33+
static amIProxied(): boolean;
34+
35+
static amIReverseEngineered(): boolean;
36+
37+
static amIRunInEmulator(): boolean;
38+
39+
static amIRuntimeHookedWithDyldWhiteListDetectionClassSelectorIsClassMethod(dyldWhiteList: NSArray<string> | string[], detectionClass: typeof NSObject, selector: string, isClassMethod: boolean): boolean;
40+
41+
static amITampered(checks: NSArray<FileIntegrityCheckFacade> | FileIntegrityCheckFacade[]): NSArray<any>;
42+
43+
static denyDebugger(): void;
44+
45+
static new(): SecurityFacade; // inherited from NSObject
46+
}

0 commit comments

Comments
 (0)