mirror of
https://github.com/h3pdesign/Neon-Vision-Editor
synced 2026-04-21 13:27:16 +00:00
fix(release): disable updater for app store distribution
This commit is contained in:
parent
6f00a27504
commit
23a9114cfc
3 changed files with 38 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 90;
|
objectVersion = 100;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
minimizedProjectReferenceProxies = 1;
|
minimizedProjectReferenceProxies = 1;
|
||||||
packageReferences = (
|
packageReferences = (
|
||||||
);
|
);
|
||||||
preferredProjectObjectVersion = 90;
|
preferredProjectObjectVersion = 100;
|
||||||
productRefGroup = 98EAE6342E5F15E80050E579 /* Products */;
|
productRefGroup = 98EAE6342E5F15E80050E579 /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
|
|
@ -362,7 +362,7 @@
|
||||||
CODE_SIGNING_ALLOWED = YES;
|
CODE_SIGNING_ALLOWED = YES;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 598;
|
CURRENT_PROJECT_VERSION = 599;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_TEAM = CS727NF72U;
|
DEVELOPMENT_TEAM = CS727NF72U;
|
||||||
ENABLE_APP_SANDBOX = YES;
|
ENABLE_APP_SANDBOX = YES;
|
||||||
|
|
@ -445,7 +445,7 @@
|
||||||
CODE_SIGNING_ALLOWED = YES;
|
CODE_SIGNING_ALLOWED = YES;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 598;
|
CURRENT_PROJECT_VERSION = 599;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_TEAM = CS727NF72U;
|
DEVELOPMENT_TEAM = CS727NF72U;
|
||||||
ENABLE_APP_SANDBOX = YES;
|
ENABLE_APP_SANDBOX = YES;
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,13 @@
|
||||||
ReferencedContainer = "container:Neon Vision Editor.xcodeproj">
|
ReferencedContainer = "container:Neon Vision Editor.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
<AdditionalOption
|
||||||
|
key = "APP_DISTRIBUTOR_ID_OVERRIDE"
|
||||||
|
value = "com.apple.AppStore"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</AdditionalOption>
|
||||||
|
</AdditionalOptions>
|
||||||
<StoreKitConfigurationFileReference
|
<StoreKitConfigurationFileReference
|
||||||
identifier = "../../Neon Vision Editor/SupportOptional.storekit">
|
identifier = "../../Neon Vision Editor/SupportOptional.storekit">
|
||||||
</StoreKitConfigurationFileReference>
|
</StoreKitConfigurationFileReference>
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,37 @@ enum ReleaseRuntimePolicy {
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
static var isMacAppStoreDistribution: Bool {
|
static var isMacAppStoreDistribution: Bool {
|
||||||
// Treat both production and sandbox App Store receipts as App Store distribution.
|
#if APP_STORE_BUILD
|
||||||
if let appStoreReceiptURL = Bundle.main.appStoreReceiptURL,
|
return true
|
||||||
FileManager.default.fileExists(atPath: appStoreReceiptURL.path) {
|
#else
|
||||||
|
if isForcedAppStoreDistributionForCurrentProcess {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
let receiptDirectoryURL = Bundle.main.bundleURL
|
||||||
let legacyReceiptURL = Bundle.main.bundleURL
|
|
||||||
.appendingPathComponent("Contents", isDirectory: true)
|
.appendingPathComponent("Contents", isDirectory: true)
|
||||||
.appendingPathComponent("_MASReceipt", isDirectory: true)
|
.appendingPathComponent("_MASReceipt", isDirectory: true)
|
||||||
.appendingPathComponent("receipt", isDirectory: false)
|
let fileManager = FileManager.default
|
||||||
return FileManager.default.fileExists(atPath: legacyReceiptURL.path)
|
let receiptURL = receiptDirectoryURL.appendingPathComponent("receipt", isDirectory: false)
|
||||||
|
if fileManager.fileExists(atPath: receiptURL.path) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
let sandboxReceiptURL = receiptDirectoryURL.appendingPathComponent("sandboxReceipt", isDirectory: false)
|
||||||
|
return fileManager.fileExists(atPath: sandboxReceiptURL.path)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
private static var isForcedAppStoreDistributionForCurrentProcess: Bool {
|
||||||
|
let processInfo = ProcessInfo.processInfo
|
||||||
|
let environmentValue = processInfo.environment["APP_DISTRIBUTOR_ID_OVERRIDE"]
|
||||||
|
let argumentValue = processInfo.arguments
|
||||||
|
.first(where: { $0.hasPrefix("APP_DISTRIBUTOR_ID_OVERRIDE=") })?
|
||||||
|
.split(separator: "=", maxSplits: 1)
|
||||||
|
.last
|
||||||
|
.map(String.init)
|
||||||
|
let distributor = (environmentValue ?? argumentValue ?? "")
|
||||||
|
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
|
.lowercased()
|
||||||
|
return distributor == "com.apple.appstore"
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue