import { UIDevice, UIApplication, UIInterfaceOrientation, UIScreen } from 'UIKit'; import { NSLocale, URL, FileManager } from 'Foundation'; import { DispatchSemaphore, DispatchQueue } from 'Dispatch'; export class DeviceUtil { public static isPad(): boolean { return UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad } public static getOSVersion(): string { return UIDevice.current.systemVersion; } public static getLan(): string { let currentLanguage = NSLocale.preferredLanguages[0]; return currentLanguage == null ? "" : currentLanguage } public static getOrientation(): string { let orientation = "portrait"; const orient = UIApplication.shared.statusBarOrientation; if (orient == UIInterfaceOrientation.landscapeLeft || orient == UIInterfaceOrientation.landscapeRight) { orientation = "landscape"; } return orientation; } public static getScreenScale(): string { return UIScreen.main.scale.description; } public static getIdfa(): string { return UTSiOS.getGgbs() } public static hasRootPrivilege(): boolean { return UTSiOS.isRoot() } }