123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- //
- // McareCrackCheck.swift
- // MCareSwift
- //
- // Created by heesungkim on 2017. 2. 14..
- // Copyright © 2017년 idatabank. All rights reserved.
- //
- import Foundation
- import MCareFramework
- class TGfgWLPFSsedkMjVFwzECGIJlWLmXNHA {
-
- private let bundlePath:String = Bundle.main.bundlePath
- private var mcareLog:MCareLogger?
-
- public init(){
- mcareLog = MCareLogger.sharedInstance()
- }
-
- func RrSysWIEJNXJSjLdLYdkUhuSZCTsCzYc() -> String {
-
- var isCrack = false
- var result:String = ""
-
- if self.xFpMfiaKAJMDOeAxjLRgTogsUThgmSuV() {
- isCrack = true
- result = result.appending(", ").appending(McareConstants.CRACK_CODE_1002)
- }
-
- if self.emnbnWQtsROzpyBctpbxmXnFWVnYxWjK() {
- isCrack = true
- result = result.appending(", ").appending(McareConstants.CRACK_CODE_1003)
- }
-
- if self.oeylBwEWeIBxFIgKTodTecITfvuGKssm() {
- isCrack = true
- result = result.appending(", ").appending(McareConstants.CRACK_CODE_1004)
- }
-
- if self.EzfgObvemSSLKMuULiAFTLaLdNXhXTGf() {
- isCrack = true
- result = result.appending(", ").appending(McareConstants.CRACK_CODE_1005)
- }
-
- // if self.checkInfoFileDate() {
- // isCrack = true
- // result = result.appending(", ").appending(McareConstants.CRACK_CODE_1006)
- // }
- //
- // if self.checkAppNameDate() {
- // isCrack = true
- // result = result.appending(", ").appending(McareConstants.CRACK_CODE_1007)
- // }
-
- if isCrack {
- result = result.substring(from: result.index(result.startIndex, offsetBy: 2))
- }
- else {
- result = result.appending(McareConstants.CRACK_CODE_1001)
- }
-
- return result
- }
-
- func xFpMfiaKAJMDOeAxjLRgTogsUThgmSuV() -> Bool {
- let path:String = self.bundlePath.appending("/Info.plist")
-
- let fileInfo:NSDictionary = Bundle.main.infoDictionary! as NSDictionary
- let fileManager:FileManager = FileManager.default
- var fileAttr:NSDictionary!
-
- do {
- fileAttr = try fileManager.attributesOfItem(atPath: path) as NSDictionary
- } catch {
- mcareLog?.error(output:"")
- }
-
- if fileAttr != nil {
- let cSIDArr = ["Si", "gne", "rIde", "ntity"]
- let cSID:String = cSIDArr.joined()
-
- if fileInfo.value(forKey: cSID) != nil {
- return true
- }
- }
-
- return false
- }
-
- func emnbnWQtsROzpyBctpbxmXnFWVnYxWjK() -> Bool {
-
- let root:Int = Int(getpid())
-
- if root <= 10 {
- return true
- }
-
- return false
- }
-
- func oeylBwEWeIBxFIgKTodTecITfvuGKssm() -> Bool {
-
- let fileExists:Bool = FileManager.default.fileExists(atPath: bundlePath.appending("/_CodeSignature"))
-
- if !fileExists {
- return true
- }
-
- return false
- }
-
- func EzfgObvemSSLKMuULiAFTLaLdNXhXTGf() -> Bool {
-
- let fileExists:Bool = FileManager.default.fileExists(atPath: bundlePath.appending("/_CodeSignature/CodeResources"))
-
- if !fileExists {
- return true
- }
-
- return false
- }
-
- // func checkInfoFileDate() -> Bool {
- //
- // let infoPath:String = self.bundlePath.appending("/Info.plist")
- // var infoModifiedDate:Date? = nil
- // var pkgModifiedDate:Date? = nil
- // do {
- // infoModifiedDate = try FileManager.default.attributesOfItem(atPath: infoPath)[FileAttributeKey.modificationDate] as? Date
- // } catch {
- // mcareLog?.error(output: "infoModifiedDate Error")
- // }
- //
- // do {
- // pkgModifiedDate = try FileManager.default.attributesOfItem(atPath: (Bundle.main.resourcePath?.appending("/PkgInfo"))!)[FileAttributeKey.modificationDate] as? Date
- // } catch {
- // mcareLog?.error(output: "pkgModifiedDate Error")
- // }
- //
- // if fabs(infoModifiedDate!.timeIntervalSinceReferenceDate - pkgModifiedDate!.timeIntervalSinceReferenceDate) > 600 {
- // return true
- // }
- //
- // return true
- // }
- //
- // func checkAppNameDate() -> Bool {
- // let infoPath:String = self.bundlePath.appending("/mcare-pnuh")
- // mcareLog?.error(output: infoPath)
- // var infoModifiedDate:Date? = nil
- // var pkgModifiedDate:Date? = nil
- //
- // do {
- // infoModifiedDate = try FileManager.default.attributesOfItem(atPath: infoPath)[FileAttributeKey.modificationDate] as? Date
- // } catch {
- // mcareLog?.error(output: "infoModifiedDate Error")
- // return false
- // }
- //
- // do {
- // pkgModifiedDate = try FileManager.default.attributesOfItem(atPath: (Bundle.main.resourcePath?.appending("/PkgInfo"))!)[FileAttributeKey.modificationDate] as? Date
- // } catch {
- // mcareLog?.error(output: "pkgModifiedDate Error")
- // return false
- // }
- //
- // if fabs(infoModifiedDate!.timeIntervalSinceReferenceDate - pkgModifiedDate!.timeIntervalSinceReferenceDate) > 600 {
- // return true
- // }
- //
- // return true
- // }
-
- }
|