// // 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 // } }