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