mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 19:53:25 +01:00
[AltServer] Fixes “SDK does not contain libarclite” error when archiving
This commit is contained in:
1
Podfile
1
Podfile
@@ -36,6 +36,7 @@ post_install do |installer|
|
|||||||
installer.pods_project.targets.each do |target|
|
installer.pods_project.targets.each do |target|
|
||||||
target.build_configurations.each do |config|
|
target.build_configurations.each do |config|
|
||||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
|
||||||
|
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '11.0'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -10,7 +10,7 @@ PODS:
|
|||||||
- KeychainAccess (4.2.2)
|
- KeychainAccess (4.2.2)
|
||||||
- Nuke (10.7.1)
|
- Nuke (10.7.1)
|
||||||
- Sparkle (2.3.2)
|
- Sparkle (2.3.2)
|
||||||
- STPrivilegedTask (1.0.7)
|
- STPrivilegedTask (1.0.8)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- AppCenter (~> 5.0)
|
- AppCenter (~> 5.0)
|
||||||
@@ -32,7 +32,7 @@ EXTERNAL SOURCES:
|
|||||||
|
|
||||||
CHECKOUT OPTIONS:
|
CHECKOUT OPTIONS:
|
||||||
STPrivilegedTask:
|
STPrivilegedTask:
|
||||||
:commit: 6ca513d0dcb2aefb0e5a95915b77bbbbd8a6d942
|
:commit: 02ab5081c4f1d7f6a70f5413c88d32dbbea66f4c
|
||||||
:git: https://github.com/rileytestut/STPrivilegedTask.git
|
:git: https://github.com/rileytestut/STPrivilegedTask.git
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
@@ -40,8 +40,8 @@ SPEC CHECKSUMS:
|
|||||||
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
|
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
|
||||||
Nuke: 279f17a599fd1c83cf51de5e0e1f2db143a287b0
|
Nuke: 279f17a599fd1c83cf51de5e0e1f2db143a287b0
|
||||||
Sparkle: b36a51855e81585a1c38e32e53101d36c00f4304
|
Sparkle: b36a51855e81585a1c38e32e53101d36c00f4304
|
||||||
STPrivilegedTask: 56c3397238a1ec07720fb877a044898373cd2c68
|
STPrivilegedTask: 3a3f6add7c567b1be8c326328eb3dd6dc5daed91
|
||||||
|
|
||||||
PODFILE CHECKSUM: ca0ab842e91a672a9020d57cc032e765532a5163
|
PODFILE CHECKSUM: 3ca028c93d6c7f9f71be0028419da64855dba982
|
||||||
|
|
||||||
COCOAPODS: 1.12.1
|
COCOAPODS: 1.12.1
|
||||||
|
|||||||
10
Pods/Local Podspecs/STPrivilegedTask.podspec.json
generated
10
Pods/Local Podspecs/STPrivilegedTask.podspec.json
generated
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "STPrivilegedTask",
|
"name": "STPrivilegedTask",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"summary": "An NSTask-like wrapper around Mac OS X Security Framework's AuthorizationExecuteWithPrivileges()",
|
"summary": "An NSTask-like wrapper around the macOS Security Framework's AuthorizationExecuteWithPrivileges()",
|
||||||
"description": "An NSTask-like wrapper around AuthorizationExecuteWithPrivileges() in the Security API to run shell commands with root privileges in Mac OS X.",
|
"description": "An NSTask-like wrapper around AuthorizationExecuteWithPrivileges() in the Security API to run shell commands with root privileges on macOS.",
|
||||||
"homepage": "http://github.com/sveinbjornt/STPrivilegedTask",
|
"homepage": "http://github.com/sveinbjornt/STPrivilegedTask",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "BSD"
|
"type": "BSD"
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"git": "https://github.com/sveinbjornt/STPrivilegedTask.git",
|
"git": "https://github.com/sveinbjornt/STPrivilegedTask.git",
|
||||||
"tag": "1.0.7"
|
"tag": "1.0.8"
|
||||||
},
|
},
|
||||||
"source_files": "STPrivilegedTask.{h,m}",
|
"source_files": "STPrivilegedTask.{h,m}",
|
||||||
"exclude_files": "PrivilegedTaskExample",
|
"exclude_files": "PrivilegedTaskExample",
|
||||||
"public_header_files": "STPrivilegedTask.h",
|
"public_header_files": "STPrivilegedTask.h",
|
||||||
"frameworks": "Security",
|
"frameworks": "Security",
|
||||||
"requires_arc": false
|
"requires_arc": true
|
||||||
}
|
}
|
||||||
|
|||||||
8
Pods/Manifest.lock
generated
8
Pods/Manifest.lock
generated
@@ -10,7 +10,7 @@ PODS:
|
|||||||
- KeychainAccess (4.2.2)
|
- KeychainAccess (4.2.2)
|
||||||
- Nuke (10.7.1)
|
- Nuke (10.7.1)
|
||||||
- Sparkle (2.3.2)
|
- Sparkle (2.3.2)
|
||||||
- STPrivilegedTask (1.0.7)
|
- STPrivilegedTask (1.0.8)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- AppCenter (~> 5.0)
|
- AppCenter (~> 5.0)
|
||||||
@@ -32,7 +32,7 @@ EXTERNAL SOURCES:
|
|||||||
|
|
||||||
CHECKOUT OPTIONS:
|
CHECKOUT OPTIONS:
|
||||||
STPrivilegedTask:
|
STPrivilegedTask:
|
||||||
:commit: 6ca513d0dcb2aefb0e5a95915b77bbbbd8a6d942
|
:commit: 02ab5081c4f1d7f6a70f5413c88d32dbbea66f4c
|
||||||
:git: https://github.com/rileytestut/STPrivilegedTask.git
|
:git: https://github.com/rileytestut/STPrivilegedTask.git
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
@@ -40,8 +40,8 @@ SPEC CHECKSUMS:
|
|||||||
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
|
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
|
||||||
Nuke: 279f17a599fd1c83cf51de5e0e1f2db143a287b0
|
Nuke: 279f17a599fd1c83cf51de5e0e1f2db143a287b0
|
||||||
Sparkle: b36a51855e81585a1c38e32e53101d36c00f4304
|
Sparkle: b36a51855e81585a1c38e32e53101d36c00f4304
|
||||||
STPrivilegedTask: 56c3397238a1ec07720fb877a044898373cd2c68
|
STPrivilegedTask: 3a3f6add7c567b1be8c326328eb3dd6dc5daed91
|
||||||
|
|
||||||
PODFILE CHECKSUM: ca0ab842e91a672a9020d57cc032e765532a5163
|
PODFILE CHECKSUM: 3ca028c93d6c7f9f71be0028419da64855dba982
|
||||||
|
|
||||||
COCOAPODS: 1.12.1
|
COCOAPODS: 1.12.1
|
||||||
|
|||||||
30
Pods/Pods.xcodeproj/project.pbxproj
generated
30
Pods/Pods.xcodeproj/project.pbxproj
generated
@@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 52;
|
objectVersion = 55;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXAggregateTarget section */
|
/* Begin PBXAggregateTarget section */
|
||||||
@@ -46,7 +46,6 @@
|
|||||||
2C9022F02292EA5FB21AB5FFC27D05F8 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3828E0FAA00B3172C56A17C8D30131 /* Keychain.swift */; };
|
2C9022F02292EA5FB21AB5FFC27D05F8 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3828E0FAA00B3172C56A17C8D30131 /* Keychain.swift */; };
|
||||||
2D157E01ABC2D8D185B85AEA13390D1D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8774E27EFE7069D7F643A5C6E26F774D /* Extensions.swift */; };
|
2D157E01ABC2D8D185B85AEA13390D1D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8774E27EFE7069D7F643A5C6E26F774D /* Extensions.swift */; };
|
||||||
2DDEB2192477E63CC8BAADACDD0B28F4 /* Pods-AltServer-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 47FD0729E1AE07F5807D70E4ABEA48F0 /* Pods-AltServer-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
2DDEB2192477E63CC8BAADACDD0B28F4 /* Pods-AltServer-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 47FD0729E1AE07F5807D70E4ABEA48F0 /* Pods-AltServer-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
3826A30459DE5A0E96693170CED95052 /* STPrivilegedTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 426F3D0BE037C85C934A1C2F5C761853 /* STPrivilegedTask.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; };
|
|
||||||
38FB2C5A8088681A4531FE4A67F76E87 /* ImagePipelineCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AEAFE2C57F39913794E1136F5477254 /* ImagePipelineCache.swift */; };
|
38FB2C5A8088681A4531FE4A67F76E87 /* ImagePipelineCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AEAFE2C57F39913794E1136F5477254 /* ImagePipelineCache.swift */; };
|
||||||
3BEDE9E249B3FA25D930C7413A84F2AC /* ImagePipelineTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 224B5231D5B87FDAB7ACBBB2F6FA6B80 /* ImagePipelineTask.swift */; };
|
3BEDE9E249B3FA25D930C7413A84F2AC /* ImagePipelineTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 224B5231D5B87FDAB7ACBBB2F6FA6B80 /* ImagePipelineTask.swift */; };
|
||||||
3CA5E256B6A8942E31110F3AE1E53E48 /* Pods-AltStore-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F5287A98793EB9C5CEC3668161876AF /* Pods-AltStore-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
3CA5E256B6A8942E31110F3AE1E53E48 /* Pods-AltStore-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F5287A98793EB9C5CEC3668161876AF /* Pods-AltStore-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
@@ -99,6 +98,7 @@
|
|||||||
D735290FA0F470CD7967B60BCE2D3325 /* Pods-AltStoreCore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0DF2C09C7EAB8B5361EC909896A58A1A /* Pods-AltStoreCore-dummy.m */; };
|
D735290FA0F470CD7967B60BCE2D3325 /* Pods-AltStoreCore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0DF2C09C7EAB8B5361EC909896A58A1A /* Pods-AltStoreCore-dummy.m */; };
|
||||||
DBBEBCE04C91414572AE60714A876047 /* ImagePublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C14AD68CA78C990AA5EF08C771AE5D /* ImagePublisher.swift */; };
|
DBBEBCE04C91414572AE60714A876047 /* ImagePublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1C14AD68CA78C990AA5EF08C771AE5D /* ImagePublisher.swift */; };
|
||||||
E295B872DAEC1B42A73D1D2F5EBEFBAF /* FetchImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B18D44B306CF8504490ACC527E88FC /* FetchImage.swift */; };
|
E295B872DAEC1B42A73D1D2F5EBEFBAF /* FetchImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B18D44B306CF8504490ACC527E88FC /* FetchImage.swift */; };
|
||||||
|
E735E8EBF63B95AFB6CF67266C698E69 /* STPrivilegedTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 426F3D0BE037C85C934A1C2F5C761853 /* STPrivilegedTask.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; };
|
||||||
E74667B2CC4461D370AD6C7F5AD56FF2 /* ImageEncoders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FD3D710BE1D107B507CB6586BA0029D /* ImageEncoders.swift */; };
|
E74667B2CC4461D370AD6C7F5AD56FF2 /* ImageEncoders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FD3D710BE1D107B507CB6586BA0029D /* ImageEncoders.swift */; };
|
||||||
EB562D3E5AD9C37B353B90760AC22D61 /* TaskLoadData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 879D6E4D767C0CD5C4D03FBC5BC38661 /* TaskLoadData.swift */; };
|
EB562D3E5AD9C37B353B90760AC22D61 /* TaskLoadData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 879D6E4D767C0CD5C4D03FBC5BC38661 /* TaskLoadData.swift */; };
|
||||||
EBA57896E0DD5F79340572DF549563C8 /* ImageDecoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF660618380BE182BE67EC08F00618BC /* ImageDecoding.swift */; };
|
EBA57896E0DD5F79340572DF549563C8 /* ImageDecoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF660618380BE182BE67EC08F00618BC /* ImageDecoding.swift */; };
|
||||||
@@ -916,7 +916,7 @@
|
|||||||
LastUpgradeCheck = 1300;
|
LastUpgradeCheck = 1300;
|
||||||
};
|
};
|
||||||
buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */;
|
buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */;
|
||||||
compatibilityVersion = "Xcode 11.0";
|
compatibilityVersion = "Xcode 13.0";
|
||||||
developmentRegion = en;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
@@ -1093,7 +1093,7 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
3826A30459DE5A0E96693170CED95052 /* STPrivilegedTask.m in Sources */,
|
E735E8EBF63B95AFB6CF67266C698E69 /* STPrivilegedTask.m in Sources */,
|
||||||
1BF697A8040A30EFCE68604CC0852E0D /* STPrivilegedTask-dummy.m in Sources */,
|
1BF697A8040A30EFCE68604CC0852E0D /* STPrivilegedTask-dummy.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@@ -1177,6 +1177,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/KeychainAccess/KeychainAccess.modulemap";
|
MODULEMAP_FILE = "Target Support Files/KeychainAccess/KeychainAccess.modulemap";
|
||||||
PRODUCT_MODULE_NAME = KeychainAccess;
|
PRODUCT_MODULE_NAME = KeychainAccess;
|
||||||
PRODUCT_NAME = KeychainAccess;
|
PRODUCT_NAME = KeychainAccess;
|
||||||
@@ -1214,7 +1215,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/STPrivilegedTask/STPrivilegedTask.modulemap";
|
MODULEMAP_FILE = "Target Support Files/STPrivilegedTask/STPrivilegedTask.modulemap";
|
||||||
PRODUCT_MODULE_NAME = STPrivilegedTask;
|
PRODUCT_MODULE_NAME = STPrivilegedTask;
|
||||||
PRODUCT_NAME = STPrivilegedTask;
|
PRODUCT_NAME = STPrivilegedTask;
|
||||||
@@ -1239,6 +1240,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
};
|
};
|
||||||
@@ -1334,6 +1336,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACH_O_TYPE = staticlib;
|
MACH_O_TYPE = staticlib;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Pods-AltStore/Pods-AltStore.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Pods-AltStore/Pods-AltStore.modulemap";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_LIBTOOLFLAGS = "";
|
OTHER_LIBTOOLFLAGS = "";
|
||||||
@@ -1371,6 +1374,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACH_O_TYPE = staticlib;
|
MACH_O_TYPE = staticlib;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Pods-AltStoreCore/Pods-AltStoreCore.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Pods-AltStoreCore/Pods-AltStoreCore.modulemap";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_LIBTOOLFLAGS = "";
|
OTHER_LIBTOOLFLAGS = "";
|
||||||
@@ -1408,6 +1412,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Nuke/Nuke.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Nuke/Nuke.modulemap";
|
||||||
PRODUCT_MODULE_NAME = Nuke;
|
PRODUCT_MODULE_NAME = Nuke;
|
||||||
PRODUCT_NAME = Nuke;
|
PRODUCT_NAME = Nuke;
|
||||||
@@ -1445,6 +1450,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACH_O_TYPE = staticlib;
|
MACH_O_TYPE = staticlib;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Pods-AltStore/Pods-AltStore.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Pods-AltStore/Pods-AltStore.modulemap";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_LIBTOOLFLAGS = "";
|
OTHER_LIBTOOLFLAGS = "";
|
||||||
@@ -1474,7 +1480,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -1500,6 +1506,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/KeychainAccess/KeychainAccess.modulemap";
|
MODULEMAP_FILE = "Target Support Files/KeychainAccess/KeychainAccess.modulemap";
|
||||||
PRODUCT_MODULE_NAME = KeychainAccess;
|
PRODUCT_MODULE_NAME = KeychainAccess;
|
||||||
PRODUCT_NAME = KeychainAccess;
|
PRODUCT_NAME = KeychainAccess;
|
||||||
@@ -1537,7 +1544,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACH_O_TYPE = staticlib;
|
MACH_O_TYPE = staticlib;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Pods-AltServer/Pods-AltServer.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Pods-AltServer/Pods-AltServer.modulemap";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_LIBTOOLFLAGS = "";
|
OTHER_LIBTOOLFLAGS = "";
|
||||||
@@ -1575,7 +1582,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACH_O_TYPE = staticlib;
|
MACH_O_TYPE = staticlib;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Pods-AltServer/Pods-AltServer.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Pods-AltServer/Pods-AltServer.modulemap";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_LIBTOOLFLAGS = "";
|
OTHER_LIBTOOLFLAGS = "";
|
||||||
@@ -1611,6 +1618,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Nuke/Nuke.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Nuke/Nuke.modulemap";
|
||||||
PRODUCT_MODULE_NAME = Nuke;
|
PRODUCT_MODULE_NAME = Nuke;
|
||||||
PRODUCT_NAME = Nuke;
|
PRODUCT_NAME = Nuke;
|
||||||
@@ -1638,7 +1646,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -1729,7 +1737,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/STPrivilegedTask/STPrivilegedTask.modulemap";
|
MODULEMAP_FILE = "Target Support Files/STPrivilegedTask/STPrivilegedTask.modulemap";
|
||||||
PRODUCT_MODULE_NAME = STPrivilegedTask;
|
PRODUCT_MODULE_NAME = STPrivilegedTask;
|
||||||
PRODUCT_NAME = STPrivilegedTask;
|
PRODUCT_NAME = STPrivilegedTask;
|
||||||
@@ -1754,6 +1762,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
@@ -1783,6 +1792,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACH_O_TYPE = staticlib;
|
MACH_O_TYPE = staticlib;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MODULEMAP_FILE = "Target Support Files/Pods-AltStoreCore/Pods-AltStoreCore.modulemap";
|
MODULEMAP_FILE = "Target Support Files/Pods-AltStoreCore/Pods-AltStoreCore.modulemap";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
OTHER_LIBTOOLFLAGS = "";
|
OTHER_LIBTOOLFLAGS = "";
|
||||||
|
|||||||
2
Pods/STPrivilegedTask/LICENSE
generated
2
Pods/STPrivilegedTask/LICENSE
generated
@@ -1,6 +1,6 @@
|
|||||||
BSD 3-Clause License
|
BSD 3-Clause License
|
||||||
|
|
||||||
Copyright (c) 2009, Sveinbjorn Thordarson
|
Copyright (c) 2008-2021, Sveinbjorn Thordarson
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
63
Pods/STPrivilegedTask/README.md
generated
63
Pods/STPrivilegedTask/README.md
generated
@@ -1,8 +1,10 @@
|
|||||||
# STPrivilegedTask - Objective C class
|
# STPrivilegedTask - Objective-C class
|
||||||
|
|
||||||
An NSTask-like wrapper around [AuthorizationExecuteWithPrivileges()](https://developer.apple.com/library/mac/documentation/Security/Reference/authorization_ref/#//apple_ref/c/func/AuthorizationExecuteWithPrivileges) in the Security API to run shell commands with root privileges in Mac OS X.
|
An NSTask-like wrapper class around [AuthorizationExecuteWithPrivileges()](https://developer.apple.com/library/mac/documentation/Security/Reference/authorization_ref/#//apple_ref/c/func/AuthorizationExecuteWithPrivileges)
|
||||||
|
in the macOS Security API to run shell commands with root privileges.
|
||||||
|
|
||||||
STPrivilegedTask was created a long time ago. It has now been updated to support ARC and is available via <a href="https://cocoapods.org">CocoaPods</a>.
|
STPrivilegedTask was created a long time ago. It has been updated over the years to work with the latest
|
||||||
|
versions of macOS and is available via [CocoaPods](https://cocoapods.org).
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@@ -10,7 +12,7 @@ STPrivilegedTask was created a long time ago. It has now been updated to support
|
|||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
// Create task
|
// Create task
|
||||||
STPrivilegedTask *privilegedTask = [[STPrivilegedTask alloc] init];
|
STPrivilegedTask *privilegedTask = [STPrivilegedTask new];
|
||||||
[privilegedTask setLaunchPath:@"/usr/bin/touch"];
|
[privilegedTask setLaunchPath:@"/usr/bin/touch"];
|
||||||
[privilegedTask setArguments:@[@"/etc/my_test_file"]];
|
[privilegedTask setArguments:@[@"/etc/my_test_file"]];
|
||||||
|
|
||||||
@@ -18,7 +20,7 @@ STPrivilegedTask *privilegedTask = [[STPrivilegedTask alloc] init];
|
|||||||
// NSString *path = [[NSBundle mainBundle] resourcePath];
|
// NSString *path = [[NSBundle mainBundle] resourcePath];
|
||||||
// [privilegedTask setCurrentDirectoryPath:path];
|
// [privilegedTask setCurrentDirectoryPath:path];
|
||||||
|
|
||||||
// Launch it, user is prompted for password
|
// Launch it, user is prompted for password (blocking)
|
||||||
OSStatus err = [privilegedTask launch];
|
OSStatus err = [privilegedTask launch];
|
||||||
if (err == errAuthorizationSuccess) {
|
if (err == errAuthorizationSuccess) {
|
||||||
NSLog(@"Task successfully launched");
|
NSLog(@"Task successfully launched");
|
||||||
@@ -30,7 +32,8 @@ else {
|
|||||||
NSLog(@"Something went wrong");
|
NSLog(@"Something went wrong");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
See [Authorization.h](http://www.opensource.apple.com/source/libsecurity_authorization/libsecurity_authorization-36329/lib/Authorization.h) for a list of possible error codes.
|
See [Authorization.h](http://www.opensource.apple.com/source/libsecurity_authorization/libsecurity_authorization-36329/lib/Authorization.h)
|
||||||
|
for a list of possible error codes.
|
||||||
|
|
||||||
### Launch task one-liner
|
### Launch task one-liner
|
||||||
|
|
||||||
@@ -45,9 +48,9 @@ OSStatus err = [STPrivilegedTask launchedPrivilegedTaskWithLaunchPath:@"/bin/sh"
|
|||||||
### Getting task output
|
### Getting task output
|
||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
// ... launch task
|
// ... Launch task
|
||||||
|
|
||||||
[privilegedTask waitUntilExit];
|
[privilegedTask waitUntilExit]; // This is blocking
|
||||||
|
|
||||||
// Read output file handle for data
|
// Read output file handle for data
|
||||||
NSData *outputData = [[privilegedTask outputFileHandle] readDataToEndOfFile];
|
NSData *outputData = [[privilegedTask outputFileHandle] readDataToEndOfFile];
|
||||||
@@ -59,28 +62,31 @@ NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUT
|
|||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
|
|
||||||
// ... launch task
|
// ... Launch task
|
||||||
|
|
||||||
NSFileHandle *readHandle = [privilegedTask outputFileHandle];
|
NSFileHandle *readHandle = [privilegedTask outputFileHandle];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getOutputData:) name:NSFileHandleReadCompletionNotification object:readHandle];
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(getOutputData:)
|
||||||
|
name:NSFileHandleReadCompletionNotification
|
||||||
|
object:readHandle];
|
||||||
[readHandle readInBackgroundAndNotify];
|
[readHandle readInBackgroundAndNotify];
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
- (void)getOutputData:(NSNotification *)aNotification {
|
- (void)getOutputData:(NSNotification *)aNotification {
|
||||||
//get data from notification
|
// Get data from notification
|
||||||
NSData *data = [[aNotification userInfo] objectForKey:NSFileHandleNotificationDataItem];
|
NSData *data = [[aNotification userInfo] objectForKey:NSFileHandleNotificationDataItem];
|
||||||
|
|
||||||
//make sure there's actual data
|
// Make sure there's actual data
|
||||||
if ([data length]) {
|
if ([data length]) {
|
||||||
// do something with the data
|
// Do something with the data
|
||||||
NSString *outputString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
NSString *outputString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||||
NSLog(outputString);
|
NSLog(@"%@", outputString);
|
||||||
|
|
||||||
// go read more data in the background
|
// Go read more data in the background
|
||||||
[[aNotification object] readInBackgroundAndNotify];
|
[[aNotification object] readInBackgroundAndNotify];
|
||||||
} else {
|
} else {
|
||||||
// do something else
|
// Do something else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -90,14 +96,17 @@ NSFileHandle *readHandle = [privilegedTask outputFileHandle];
|
|||||||
You can observe STPrivilegedTaskDidTerminateNotification:
|
You can observe STPrivilegedTaskDidTerminateNotification:
|
||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(privilegedTaskFinished:) name:STPrivilegedTaskDidTerminateNotification object:nil];
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(privilegedTaskFinished:)
|
||||||
|
name:STPrivilegedTaskDidTerminateNotification
|
||||||
|
object:nil];
|
||||||
|
|
||||||
- (void)privilegedTaskFinished:(NSNotification *)aNotification {
|
- (void)privilegedTaskFinished:(NSNotification *)aNotification {
|
||||||
// do something
|
// Do something
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Or alternately, set a termination handler:
|
Or alternatively, set a termination handler:
|
||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
privilegedTask.terminationHandler = ^(STPrivilegedTask *privilegedTask) {
|
privilegedTask.terminationHandler = ^(STPrivilegedTask *privilegedTask) {
|
||||||
@@ -110,17 +119,17 @@ privilegedTask.terminationHandler = ^(STPrivilegedTask *privilegedTask) {
|
|||||||
```objective-c
|
```objective-c
|
||||||
// ... Create your own AuthorizationRef
|
// ... Create your own AuthorizationRef
|
||||||
|
|
||||||
[STPriviledTask launchedPrivilegedTaskWithLaunchPath:@"/bin/sh"
|
[STPrivilegedTask launchedPrivilegedTaskWithLaunchPath:@"/bin/sh"
|
||||||
arguments:@"/path/to/script"
|
arguments:@"/path/to/script"
|
||||||
currentDirectory:@"/"
|
currentDirectory:@"/"
|
||||||
authorization:authRef]
|
authorization:authRef]
|
||||||
```
|
```
|
||||||
|
|
||||||
### AuthorizationExecuteWithPrivileges() is deprecated
|
### AuthorizationExecuteWithPrivileges() is deprecated
|
||||||
|
|
||||||
[AuthorizationExecuteWithPrivileges()](https://developer.apple.com/library/mac/documentation/Security/Reference/authorization_ref/#//apple_ref/c/func/AuthorizationExecuteWithPrivileges) is deprecated as of macOS 10.7 but remains available
|
[AuthorizationExecuteWithPrivileges()](https://developer.apple.com/library/mac/documentation/Security/Reference/authorization_ref/#//apple_ref/c/func/AuthorizationExecuteWithPrivileges)
|
||||||
in 10.14 Mojave. If you want to be future-proof, here's how you check if STPrivilegedTask
|
is deprecated as of macOS 10.7 but still remains available in macOS 12 "Monterey". If you want to be future-proof,
|
||||||
works in the running version of macOS:
|
here's how you check if STPrivilegedTask works in the running version of macOS:
|
||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
OSStatus err = [privilegedTask launch];
|
OSStatus err = [privilegedTask launch];
|
||||||
@@ -164,7 +173,7 @@ It then presents the output of the script in a window, along with the exit code.
|
|||||||
|
|
||||||
## BSD License
|
## BSD License
|
||||||
|
|
||||||
Copyright (c) Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
|
Copyright (c) 2008-2021 Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
50
Pods/STPrivilegedTask/STPrivilegedTask.h
generated
50
Pods/STPrivilegedTask/STPrivilegedTask.h
generated
@@ -1,29 +1,29 @@
|
|||||||
/*
|
/*
|
||||||
# STPrivilegedTask - NSTask-like wrapper around AuthorizationExecuteWithPrivileges
|
STPrivilegedTask - NSTask-like wrapper around AuthorizationExecuteWithPrivileges
|
||||||
# Copyright (C) 2009-2017 Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
|
Copyright (C) 2008-2021 Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
|
||||||
#
|
|
||||||
# BSD License
|
BSD License
|
||||||
# Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
# * Redistributions of source code must retain the above copyright
|
* Redistributions of source code must retain the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
# * Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
# documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
# * Neither the name of the copyright holder nor that of any other
|
* Neither the name of the copyright holder nor that of any other
|
||||||
# contributors may be used to endorse or promote products
|
contributors may be used to endorse or promote products
|
||||||
# derived from this software without specific prior written permission.
|
derived from this software without specific prior written permission.
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
162
Pods/STPrivilegedTask/STPrivilegedTask.m
generated
162
Pods/STPrivilegedTask/STPrivilegedTask.m
generated
@@ -1,30 +1,30 @@
|
|||||||
/*
|
/*
|
||||||
# STPrivilegedTask - NSTask-like wrapper around AuthorizationExecuteWithPrivileges
|
STPrivilegedTask - NSTask-like wrapper around AuthorizationExecuteWithPrivileges
|
||||||
# Copyright (C) 2009-2017 Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
|
Copyright (C) 2008-2021 Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
|
||||||
#
|
|
||||||
# BSD License
|
BSD License
|
||||||
# Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
# * Redistributions of source code must retain the above copyright
|
* Redistributions of source code must retain the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
# * Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
# documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
# * Neither the name of the copyright holder nor that of any other
|
* Neither the name of the copyright holder nor that of any other
|
||||||
# contributors may be used to endorse or promote products
|
contributors may be used to endorse or promote products
|
||||||
# derived from this software without specific prior written permission.
|
derived from this software without specific prior written permission.
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "STPrivilegedTask.h"
|
#import "STPrivilegedTask.h"
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
// New error code denoting that AuthorizationExecuteWithPrivileges no longer exists
|
// New error code denoting that AuthorizationExecuteWithPrivileges no longer exists
|
||||||
OSStatus const errAuthorizationFnNoLongerExists = -70001;
|
OSStatus const errAuthorizationFnNoLongerExists = -70001;
|
||||||
|
|
||||||
// Create fn pointer to AuthorizationExecuteWithPrivileges in case
|
// Create fn pointer to AuthorizationExecuteWithPrivileges
|
||||||
// it doesn't exist in this version of MacOS
|
// in case it doesn't exist in this version of macOS
|
||||||
static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const char *pathToTool, AuthorizationFlags options,
|
static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const char *pathToTool, AuthorizationFlags options,
|
||||||
char * const *arguments, FILE **communicationsPipe) = NULL;
|
char * const *arguments, FILE **communicationsPipe) = NULL;
|
||||||
|
|
||||||
@@ -48,8 +48,7 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
NSTimer *_checkStatusTimer;
|
NSTimer *_checkStatusTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)initialize;
|
+ (void)initialize {
|
||||||
{
|
|
||||||
// On 10.7, AuthorizationExecuteWithPrivileges is deprecated. We want
|
// On 10.7, AuthorizationExecuteWithPrivileges is deprecated. We want
|
||||||
// to still use it since there's no good alternative (without requiring
|
// to still use it since there's no good alternative (without requiring
|
||||||
// code signing). We'll look up the function through dyld and fail if
|
// code signing). We'll look up the function through dyld and fail if
|
||||||
@@ -64,8 +63,7 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)init
|
- (instancetype)init {
|
||||||
{
|
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
_launchPath = nil;
|
_launchPath = nil;
|
||||||
@@ -80,8 +78,7 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithLaunchPath:(NSString *)path
|
- (instancetype)initWithLaunchPath:(NSString *)path {
|
||||||
{
|
|
||||||
self = [self init];
|
self = [self init];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.launchPath = path;
|
self.launchPath = path;
|
||||||
@@ -89,8 +86,8 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithLaunchPath:(NSString *)path arguments:(NSArray *)args
|
- (instancetype)initWithLaunchPath:(NSString *)path
|
||||||
{
|
arguments:(NSArray *)args {
|
||||||
self = [self initWithLaunchPath:path];
|
self = [self initWithLaunchPath:path];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.arguments = args;
|
self.arguments = args;
|
||||||
@@ -98,8 +95,9 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithLaunchPath:(NSString *)path arguments:(NSArray *)args currentDirectory:(NSString *)cwd
|
- (instancetype)initWithLaunchPath:(NSString *)path
|
||||||
{
|
arguments:(NSArray *)args
|
||||||
|
currentDirectory:(NSString *)cwd {
|
||||||
self = [self initWithLaunchPath:path arguments:args];
|
self = [self initWithLaunchPath:path arguments:args];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.currentDirectoryPath = cwd;
|
self.currentDirectoryPath = cwd;
|
||||||
@@ -117,32 +115,33 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path
|
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path {
|
||||||
{
|
|
||||||
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path];
|
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path];
|
||||||
[task launch];
|
[task launch];
|
||||||
[task waitUntilExit];
|
[task waitUntilExit];
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)args
|
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)args {
|
||||||
{
|
|
||||||
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args];
|
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args];
|
||||||
[task launch];
|
[task launch];
|
||||||
[task waitUntilExit];
|
[task waitUntilExit];
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)args currentDirectory:(NSString *)cwd
|
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path
|
||||||
{
|
arguments:(NSArray *)args
|
||||||
|
currentDirectory:(NSString *)cwd {
|
||||||
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args currentDirectory:cwd];
|
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args currentDirectory:cwd];
|
||||||
[task launch];
|
[task launch];
|
||||||
[task waitUntilExit];
|
[task waitUntilExit];
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)args currentDirectory:(NSString *)cwd authorization:(AuthorizationRef)authorization
|
+ (STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path
|
||||||
{
|
arguments:(NSArray *)args
|
||||||
|
currentDirectory:(NSString *)cwd
|
||||||
|
authorization:(AuthorizationRef)authorization {
|
||||||
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args currentDirectory:cwd];
|
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args currentDirectory:cwd];
|
||||||
[task launchWithAuthorization:authorization];
|
[task launchWithAuthorization:authorization];
|
||||||
[task waitUntilExit];
|
[task waitUntilExit];
|
||||||
@@ -152,8 +151,7 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
# pragma mark -
|
# pragma mark -
|
||||||
|
|
||||||
// return 0 for success
|
// return 0 for success
|
||||||
- (OSStatus)launch
|
- (OSStatus)launch {
|
||||||
{
|
|
||||||
if (_isRunning) {
|
if (_isRunning) {
|
||||||
NSLog(@"Task already running: %@", [self description]);
|
NSLog(@"Task already running: %@", [self description]);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -172,22 +170,19 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
AuthorizationRights myRights = { 1, &myItems };
|
AuthorizationRights myRights = { 1, &myItems };
|
||||||
AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights;
|
AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights;
|
||||||
|
|
||||||
// Use Apple's Authentication Manager APIs to get an Authorization Reference
|
// Use Apple's Authentication Manager API to create an Authorization Reference
|
||||||
// These Apple APIs are quite possibly the most horrible of the Mac OS X APIs
|
|
||||||
|
|
||||||
// create authorization reference
|
|
||||||
err = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef);
|
err = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef);
|
||||||
if (err != errAuthorizationSuccess) {
|
if (err != errAuthorizationSuccess) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pre-authorize the privileged operation
|
// Pre-authorize the privileged operation
|
||||||
err = AuthorizationCopyRights(authorizationRef, &myRights, kAuthorizationEmptyEnvironment, flags, NULL);
|
err = AuthorizationCopyRights(authorizationRef, &myRights, kAuthorizationEmptyEnvironment, flags, NULL);
|
||||||
if (err != errAuthorizationSuccess) {
|
if (err != errAuthorizationSuccess) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OK, at this point we have received authorization for the task.
|
// OK, at this point we have received authorization for the task so we launch it.
|
||||||
err = [self launchWithAuthorization:authorizationRef];
|
err = [self launchWithAuthorization:authorizationRef];
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
@@ -208,59 +203,60 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Assuming the authorization is valid for the task.
|
// Assuming the authorization is valid for the task.
|
||||||
// Let's prepare to launch it
|
// Let's prepare to launch it.
|
||||||
NSArray *arguments = self.arguments;
|
NSArray *arguments = self.arguments;
|
||||||
NSUInteger numberOfArguments = [arguments count];
|
NSUInteger numArgs = [arguments count];
|
||||||
char *args[numberOfArguments + 1];
|
char *args[numArgs + 1];
|
||||||
FILE *outputFile;
|
FILE *outputFile;
|
||||||
|
|
||||||
const char *toolPath = [self.launchPath fileSystemRepresentation];
|
const char *toolPath = [self.launchPath fileSystemRepresentation];
|
||||||
|
|
||||||
// first, construct an array of c strings from NSArray w. arguments
|
// First, construct an array of C strings w. all the arguments from NSArray
|
||||||
for (int i = 0; i < numberOfArguments; i++) {
|
// This is the format required by AuthorizationExecuteWithPrivileges function
|
||||||
|
for (int i = 0; i < numArgs; i++) {
|
||||||
NSString *argString = arguments[i];
|
NSString *argString = arguments[i];
|
||||||
const char *fsrep = [argString fileSystemRepresentation];
|
const char *fsrep = [argString fileSystemRepresentation];
|
||||||
NSUInteger stringLength = strlen(fsrep);
|
NSUInteger stringLength = strlen(fsrep);
|
||||||
|
args[i] = calloc((stringLength + 1), sizeof(char));
|
||||||
args[i] = malloc((stringLength + 1) * sizeof(char));
|
|
||||||
snprintf(args[i], stringLength + 1, "%s", fsrep);
|
snprintf(args[i], stringLength + 1, "%s", fsrep);
|
||||||
}
|
}
|
||||||
args[numberOfArguments] = NULL;
|
args[numArgs] = NULL;
|
||||||
|
|
||||||
// change to the current dir specified
|
// Change to the specified current working directory
|
||||||
|
// NB: This is process-wide and could interfere with the behaviour of concurrent tasks
|
||||||
char *prevCwd = (char *)getcwd(nil, 0);
|
char *prevCwd = (char *)getcwd(nil, 0);
|
||||||
chdir([self.currentDirectoryPath fileSystemRepresentation]);
|
chdir([self.currentDirectoryPath fileSystemRepresentation]);
|
||||||
|
|
||||||
//use Authorization Reference to execute script with privileges
|
// Use Authorization Reference to execute script with privileges.
|
||||||
|
// This is where the magic happens.
|
||||||
OSStatus err = _AuthExecuteWithPrivsFn(authorization, toolPath, kAuthorizationFlagDefaults, args, &outputFile);
|
OSStatus err = _AuthExecuteWithPrivsFn(authorization, toolPath, kAuthorizationFlagDefaults, args, &outputFile);
|
||||||
|
|
||||||
// OK, now we're done executing, let's change back to old dir
|
// OK, now we're done executing, let's change back to old dir
|
||||||
chdir(prevCwd);
|
chdir(prevCwd);
|
||||||
|
|
||||||
// free the malloc'd argument strings
|
// Free the alloc'd argument strings
|
||||||
for (int i = 0; i < numberOfArguments; i++) {
|
for (int i = 0; i < numArgs; i++) {
|
||||||
free(args[i]);
|
free(args[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we return err if execution failed
|
// We return err if execution failed
|
||||||
if (err != errAuthorizationSuccess) {
|
if (err != errAuthorizationSuccess) {
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
_isRunning = YES;
|
_isRunning = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get file handle for the command output
|
// Get file handle for the command output
|
||||||
_outputFileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(outputFile) closeOnDealloc:YES];
|
_outputFileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(outputFile) closeOnDealloc:YES];
|
||||||
_processIdentifier = fcntl(fileno(outputFile), F_GETOWN, 0);
|
_processIdentifier = fcntl(fileno(outputFile), F_GETOWN, 0);
|
||||||
|
|
||||||
// start monitoring task
|
// Start monitoring task
|
||||||
_checkStatusTimer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(checkTaskStatus) userInfo:nil repeats:YES];
|
_checkStatusTimer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(checkTaskStatus) userInfo:nil repeats:YES];
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)terminate
|
- (void)terminate {
|
||||||
{
|
|
||||||
// This doesn't work without a PID, and we can't get one. Stupid Security API.
|
// This doesn't work without a PID, and we can't get one. Stupid Security API.
|
||||||
// int ret = kill(pid, SIGKILL);
|
// int ret = kill(pid, SIGKILL);
|
||||||
//
|
//
|
||||||
@@ -269,9 +265,8 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// hang until task is done
|
// Hang until task is done
|
||||||
- (void)waitUntilExit
|
- (void)waitUntilExit {
|
||||||
{
|
|
||||||
if (!_isRunning) {
|
if (!_isRunning) {
|
||||||
NSLog(@"Task %@ is not running", [super description]);
|
NSLog(@"Task %@ is not running", [super description]);
|
||||||
return;
|
return;
|
||||||
@@ -282,15 +277,14 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
int status;
|
int status;
|
||||||
pid_t pid = 0;
|
pid_t pid = 0;
|
||||||
while ((pid = waitpid(_processIdentifier, &status, WNOHANG)) == 0) {
|
while ((pid = waitpid(_processIdentifier, &status, WNOHANG)) == 0) {
|
||||||
// do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
_terminationStatus = WEXITSTATUS(status);
|
|
||||||
_isRunning = NO;
|
_isRunning = NO;
|
||||||
|
_terminationStatus = WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if task has terminated
|
// Check if task has terminated
|
||||||
- (void)checkTaskStatus
|
- (void)checkTaskStatus {
|
||||||
{
|
|
||||||
int status;
|
int status;
|
||||||
pid_t pid = waitpid(_processIdentifier, &status, WNOHANG);
|
pid_t pid = waitpid(_processIdentifier, &status, WNOHANG);
|
||||||
if (pid != 0) {
|
if (pid != 0) {
|
||||||
@@ -306,10 +300,9 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
+ (BOOL)authorizationFunctionAvailable
|
+ (BOOL)authorizationFunctionAvailable {
|
||||||
{
|
|
||||||
if (!_AuthExecuteWithPrivsFn) {
|
if (!_AuthExecuteWithPrivsFn) {
|
||||||
// This version of OS X has finally removed this function. Return with an error.
|
// This version of macOS has finally removed this function.
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
@@ -317,9 +310,8 @@ static OSStatus (*_AuthExecuteWithPrivsFn)(AuthorizationRef authorization, const
|
|||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
// Nice description for debugging
|
// Nice description for debugging purposes
|
||||||
- (NSString *)description
|
- (NSString *)description {
|
||||||
{
|
|
||||||
NSString *commandDescription = [NSString stringWithString:self.launchPath];
|
NSString *commandDescription = [NSString stringWithString:self.launchPath];
|
||||||
|
|
||||||
for (NSString *arg in self.arguments) {
|
for (NSString *arg in self.arguments) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ This application makes use of the following third party libraries:
|
|||||||
|
|
||||||
BSD 3-Clause License
|
BSD 3-Clause License
|
||||||
|
|
||||||
Copyright (c) 2009, Sveinbjorn Thordarson
|
Copyright (c) 2008-2021, Sveinbjorn Thordarson
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>BSD 3-Clause License
|
<string>BSD 3-Clause License
|
||||||
|
|
||||||
Copyright (c) 2009, Sveinbjorn Thordarson
|
Copyright (c) 2008-2021, Sveinbjorn Thordarson
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.7</string>
|
<string>1.0.8</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user