ref: rename template values
This commit is contained in:
@@ -9,35 +9,35 @@
|
||||
<h1>__AppInfoTitle__</h1>
|
||||
<div class="floatLeft icon"><img alt="App icon" src="data:image/png;base64,__AppIcon__"/></div>
|
||||
<div class="floatLeft info">
|
||||
Name: <strong>__CFBundleName__</strong><br />
|
||||
Version: __CFBundleShortVersionString__ (__CFBundleVersion__)<br />
|
||||
BundleId: __CFBundleIdentifier__<br />
|
||||
<div class="__ExtensionTypeHidden__">
|
||||
Extension type: __ExtensionType__<br />
|
||||
Name: <strong>__AppName__</strong><br />
|
||||
Version: __AppVersion__ (__AppBuildVer__)<br />
|
||||
BundleId: __AppId__<br />
|
||||
<div class="__AppExtensionTypeHidden__">
|
||||
Extension type: __AppExtensionType__<br />
|
||||
</div>
|
||||
DeviceFamily: __UIDeviceFamily__<br />
|
||||
SDK: __DTSDKName__<br />
|
||||
Minimum OS Version: __MinimumOSVersion__<br />
|
||||
DeviceFamily: __AppDeviceFamily__<br />
|
||||
SDK: __AppSDK__<br />
|
||||
Minimum OS Version: __AppMinOS__<br />
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<h2>App Transport Security</h2>
|
||||
__AppTransportSecurityFormatted__
|
||||
__AppTransportSecurity__
|
||||
</div>
|
||||
|
||||
<div class="__ProvisionHidden__">
|
||||
<div class="__AppInfoHidden__">
|
||||
<h2>Provisioning</h2>
|
||||
Profile name: <strong>__ProfileName__</strong><br />
|
||||
Profile name: <strong>__ProvisionProfileName__</strong><br />
|
||||
</div>
|
||||
<div class="__ProvisionTitleHidden__">
|
||||
<h1><span class="__ExpStatus__">__ProfileName__</span></h1>
|
||||
<h1><span class="__ProvisionExpireStatus__">__ProvisionProfileName__</span></h1>
|
||||
</div>
|
||||
|
||||
Profile UUID: __ProfileUUID__<br />
|
||||
Profile Type: __ProfilePlatform__ __ProfileType__<br />
|
||||
Team: __TeamName__ (__TeamIds__)<br />
|
||||
Creation date: __CreationDateFormatted__<br />
|
||||
Expiration Date: <strong><span class="__ExpStatus__">__ExpirationDateFormatted__</span></strong><br />
|
||||
Profile UUID: __ProvisionProfileId__<br />
|
||||
Profile Type: __ProvisionProfilePlatform__ __ProvisionProfileType__<br />
|
||||
Team: __ProvisionTeamName__ (__ProvisionTeamIds__)<br />
|
||||
Creation date: __ProvisionCreateDate__<br />
|
||||
Expiration Date: <strong><span class="__ProvisionExpireStatus__">__ProvisionExpireDate__</span></strong><br />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -45,17 +45,17 @@
|
||||
<div class="__EntitlementsWarningHidden__ warning">
|
||||
<strong>Entitlements extraction failed.</strong>
|
||||
</div>
|
||||
__EntitlementsFormatted__
|
||||
__EntitlementsDict__
|
||||
</div>
|
||||
|
||||
<div class="__ProvisionHidden__">
|
||||
<h2>Developer Certificates</h2>
|
||||
__DeveloperCertificatesFormatted__
|
||||
__ProvisionDevelopCertificates__
|
||||
</div>
|
||||
|
||||
<div class="__ProvisionHidden__">
|
||||
<h2>Devices (__ProvisionedDevicesCount__)</h2>
|
||||
__ProvisionedDevicesFormatted__
|
||||
<h2>Devices (__ProvisionDeviceCount__)</h2>
|
||||
__ProvisionDeviceIds__
|
||||
</div>
|
||||
|
||||
<div class="__iTunesHidden__">
|
||||
@@ -73,11 +73,11 @@
|
||||
<div>
|
||||
<h2>File info</h2>
|
||||
__FileName__<br />
|
||||
__FileInfo__<br />
|
||||
__FileSize__, Modified __FileModified__<br />
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p>__SrcAppName__ v__BundleShortVersionString__ (__BundleVersion__) (Github: <a href="__SrcLinkUrl__">__SrcLinkName__</a>)</p>
|
||||
<p>__SrcAppName__ v__SrcVersion__ (__SrcBuildVer__) (Github: <a href="__SrcLinkUrl__">__SrcLinkName__</a>)</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -60,7 +60,7 @@ extension PreviewGenerator {
|
||||
mutating func procAppInfo(_ appPlist: PlistDict?) {
|
||||
guard let appPlist else {
|
||||
self.apply([
|
||||
"AppInfoHidden": "hiddenDiv",
|
||||
"AppInfoHidden": CLASS_HIDDEN,
|
||||
"ProvisionTitleHidden": "",
|
||||
])
|
||||
return
|
||||
@@ -84,20 +84,20 @@ extension PreviewGenerator {
|
||||
let extensionType = (appPlist["NSExtension"] as? PlistDict)?["NSExtensionPointIdentifier"] as? String
|
||||
self.apply([
|
||||
"AppInfoHidden": "",
|
||||
"ProvisionTitleHidden": "hiddenDiv",
|
||||
"ProvisionTitleHidden": CLASS_HIDDEN,
|
||||
|
||||
"CFBundleName": appPlist["CFBundleDisplayName"] as? String ?? appPlist["CFBundleName"] as? String ?? "",
|
||||
"CFBundleShortVersionString": appPlist["CFBundleShortVersionString"] as? String ?? "",
|
||||
"CFBundleVersion": appPlist["CFBundleVersion"] as? String ?? "",
|
||||
"CFBundleIdentifier": appPlist["CFBundleIdentifier"] as? String ?? "",
|
||||
"AppName": appPlist["CFBundleDisplayName"] as? String ?? appPlist["CFBundleName"] as? String ?? "",
|
||||
"AppVersion": appPlist["CFBundleShortVersionString"] as? String ?? "",
|
||||
"AppBuildVer": appPlist["CFBundleVersion"] as? String ?? "",
|
||||
"AppId": appPlist["CFBundleIdentifier"] as? String ?? "",
|
||||
|
||||
"ExtensionTypeHidden": extensionType != nil ? "" : "hiddenDiv",
|
||||
"ExtensionType": extensionType ?? "",
|
||||
"AppExtensionTypeHidden": extensionType != nil ? "" : CLASS_HIDDEN,
|
||||
"AppExtensionType": extensionType ?? "",
|
||||
|
||||
"UIDeviceFamily": platforms ?? "",
|
||||
"DTSDKName": appPlist["DTSDKName"] as? String ?? "",
|
||||
"MinimumOSVersion": minVersion,
|
||||
"AppTransportSecurityFormatted": formattedAppTransportSecurity(appPlist),
|
||||
"AppDeviceFamily": platforms ?? "",
|
||||
"AppSDK": appPlist["DTSDKName"] as? String ?? "",
|
||||
"AppMinOS": minVersion,
|
||||
"AppTransportSecurity": formattedAppTransportSecurity(appPlist),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ extension PreviewGenerator {
|
||||
entitlements.applyFallbackIfNeeded(provisionPlist?["Entitlements"] as? PlistDict)
|
||||
|
||||
self.apply([
|
||||
"EntitlementsWarningHidden": entitlements.hasError ? "" : "hiddenDiv",
|
||||
"EntitlementsFormatted": entitlements.html ?? "No Entitlements",
|
||||
"EntitlementsWarningHidden": entitlements.hasError ? "" : CLASS_HIDDEN,
|
||||
"EntitlementsDict": entitlements.html ?? "No Entitlements",
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,11 @@ extension PreviewGenerator {
|
||||
|
||||
/// Process meta information about the file itself. Like file size and last modification.
|
||||
mutating func procFileInfo(_ url: URL) {
|
||||
let formattedValue : String
|
||||
if let attrs = try? FileManager.default.attributesOfItem(atPath: url.path) {
|
||||
let size = ByteCountFormatter.string(fromByteCount: getFileSize(url.path), countStyle: .file)
|
||||
formattedValue = "\(size), Modified \((attrs[.modificationDate] as! Date).mediumFormat())"
|
||||
} else {
|
||||
formattedValue = ""
|
||||
}
|
||||
let attrs = try? FileManager.default.attributesOfItem(atPath: url.path)
|
||||
self.apply([
|
||||
"FileName": escapeXML(url.lastPathComponent),
|
||||
"FileInfo": formattedValue,
|
||||
"FileSize": ByteCountFormatter.string(fromByteCount: getFileSize(url.path), countStyle: .file),
|
||||
"FileModified": (attrs?[.modificationDate] as? Date)?.mediumFormat() ?? "",
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ extension PreviewGenerator {
|
||||
"SrcAppName": "QLAppBundle",
|
||||
"SrcLinkUrl": "https://github.com/relikd/QLAppBundle",
|
||||
"SrcLinkName": "relikd/QLAppBundle",
|
||||
"BundleShortVersionString": Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "",
|
||||
"BundleVersion": Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "",
|
||||
"SrcVersion": Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "",
|
||||
"SrcBuildVer": Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "",
|
||||
])
|
||||
#if DEBUG
|
||||
self.data["SrcAppName"]! += " (debug)"
|
||||
|
||||
@@ -114,7 +114,7 @@ extension PreviewGenerator {
|
||||
/// Process info stored in `embedded.mobileprovision`
|
||||
mutating func procProvision(_ provisionPlist: PlistDict?, isOSX: Bool) {
|
||||
guard let provisionPlist else {
|
||||
self.apply(["ProvisionHidden": "hiddenDiv"])
|
||||
self.apply(["ProvisionHidden": CLASS_HIDDEN])
|
||||
return
|
||||
}
|
||||
|
||||
@@ -125,21 +125,21 @@ extension PreviewGenerator {
|
||||
|
||||
self.apply([
|
||||
"ProvisionHidden": "",
|
||||
"ProfileName": provisionPlist["Name"] as? String ?? "",
|
||||
"ProfileUUID": provisionPlist["UUID"] as? String ?? "",
|
||||
"TeamName": provisionPlist["TeamName"] as? String ?? "<em>Team name not available</em>",
|
||||
"TeamIds": (provisionPlist["TeamIdentifier"] as? [String])?.joined(separator: ", ") ?? "<em>Team ID not available</em>",
|
||||
"CreationDateFormatted": creationDate?.formattedCreationDate() ?? "",
|
||||
"ExpirationDateFormatted": expireDate?.formattedExpirationDate() ?? "",
|
||||
"ExpStatus": ExpirationStatus(expireDate).cssClass(),
|
||||
"ProvisionProfileName": provisionPlist["Name"] as? String ?? "",
|
||||
"ProvisionProfileId": provisionPlist["UUID"] as? String ?? "",
|
||||
"ProvisionTeamName": provisionPlist["TeamName"] as? String ?? "<em>Team name not available</em>",
|
||||
"ProvisionTeamIds": (provisionPlist["TeamIdentifier"] as? [String])?.joined(separator: ", ") ?? "<em>Team ID not available</em>",
|
||||
"ProvisionCreateDate": creationDate?.formattedCreationDate() ?? "",
|
||||
"ProvisionExpireDate": expireDate?.formattedExpirationDate() ?? "",
|
||||
"ProvisionExpireStatus": ExpirationStatus(expireDate).cssClass(),
|
||||
|
||||
"ProfilePlatform": isOSX ? "Mac" : "iOS",
|
||||
"ProfileType": stringForProfileType(provisionPlist, isOSX: isOSX),
|
||||
"ProvisionProfilePlatform": isOSX ? "Mac" : "iOS",
|
||||
"ProvisionProfileType": stringForProfileType(provisionPlist, isOSX: isOSX),
|
||||
|
||||
"ProvisionedDevicesCount": devices.isEmpty ? "No Devices" : "\(devices.count) Device\(devices.count == 1 ? "" : "s")",
|
||||
"ProvisionedDevicesFormatted": devices.isEmpty ? "Distribution Profile" : formatAsTable(devices, header: ["", "UDID"]),
|
||||
"ProvisionDeviceCount": devices.isEmpty ? "No Devices" : "\(devices.count) Device\(devices.count == 1 ? "" : "s")",
|
||||
"ProvisionDeviceIds": devices.isEmpty ? "Distribution Profile" : formatAsTable(devices, header: ["", "UDID"]),
|
||||
|
||||
"DeveloperCertificatesFormatted": certs.isEmpty ? "No Developer Certificates" : formatAsTable(certs),
|
||||
"ProvisionDevelopCertificates": certs.isEmpty ? "No Developer Certificates" : formatAsTable(certs),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ extension PreviewGenerator {
|
||||
/// Process info stored in `iTunesMetadata.plist`
|
||||
mutating func procItunesMeta(_ itunesPlist: PlistDict?) {
|
||||
guard let itunesPlist else {
|
||||
self.apply(["iTunesHidden": "hiddenDiv"])
|
||||
self.apply(["iTunesHidden": CLASS_HIDDEN])
|
||||
return
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ extension PreviewGenerator {
|
||||
}
|
||||
self.apply([
|
||||
"iTunesHidden": "",
|
||||
"iTunesId": (itunesPlist["itemId"] as? Int)?.description ?? "", // description]
|
||||
"iTunesId": (itunesPlist["itemId"] as? Int)?.description ?? "",
|
||||
"iTunesName": itunesPlist["itemName"] as? String ?? "",
|
||||
"iTunesGenres": formattedGenres(itunesPlist),
|
||||
"iTunesReleaseDate": releaseDate?.mediumFormat() ?? "",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
let CLASS_HIDDEN = "hiddenDiv"
|
||||
|
||||
struct PreviewGenerator {
|
||||
var data: [String: String] = [:] // used for TAG replacements
|
||||
let meta: MetaInfo
|
||||
|
||||
Reference in New Issue
Block a user