-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from hwdavr/enum-support
Add obfuscation on Enum type and Enum elements
- Loading branch information
Showing
13 changed files
with
165 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
16 changes: 16 additions & 0 deletions
16
SwiftShieldExample/SwiftShieldSDK/SwiftShieldSDK/NameEnum.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// NameEnum.swift | ||
// SwiftShieldSDK | ||
// | ||
// Created by Weidian on 28/12/19. | ||
// Copyright 漏 2019 rockbruno. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
enum NameEnum: Int { | ||
case | ||
FIRST_NAME = 0, | ||
MIDDLE_NAME, | ||
LAST_NAME | ||
} |
This file contains 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
This file contains 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
30 changes: 30 additions & 0 deletions
30
SwiftShieldExample/SwiftShieldSDK/SwiftShieldSDK/ShieldSerializer.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Serializer.swift | ||
// SwiftShieldSDK | ||
// | ||
// Created by Weidian on 5/1/20. | ||
// Copyright 漏 2020 rockbruno. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
open class ShieldSerializer { | ||
|
||
public init() {} | ||
|
||
open func jsonContactsList() -> String? { | ||
let list = ContactsList() | ||
let encoder = JSONEncoder() | ||
encoder.outputFormatting = .prettyPrinted | ||
let data = try! encoder.encode(list) | ||
let jsonList = String(data: data, encoding: .utf8) | ||
print(jsonList ?? "encoding error") | ||
return jsonList | ||
} | ||
|
||
open func parseContactsList(json: String) -> ContactsList? { | ||
let data = json.data(using: .utf8)! | ||
let list = try! JSONDecoder().decode(ContactsList.self, from: data) | ||
return list | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,7 @@ extension SourceKit { | |
case `protocol` | ||
case property | ||
case method | ||
case `enum` | ||
case enumelement | ||
} | ||
} |