mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[diagnostics]: Added exporting of the coredata sqlite for debugging
This commit is contained in:
@@ -60,6 +60,8 @@
|
||||
A859ED5D2D1EE827003DCC58 /* OpenSSL.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A859ED5B2D1EE80D003DCC58 /* OpenSSL.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
A8945AA62D059B6100D86CBE /* Roxas.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8945AA52D059B6100D86CBE /* Roxas.framework */; };
|
||||
A8A543302D04F14400D72399 /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A5432F2D04F0C100D72399 /* libfragmentzip.a */; };
|
||||
A8B516E32D2666CA0047047C /* CoreDataHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8B516E22D2666CA0047047C /* CoreDataHelper.swift */; };
|
||||
A8B516E62D2668170047047C /* DateTimeUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8B516E52D2668020047047C /* DateTimeUtil.swift */; };
|
||||
A8BB34E52D04EC8E000A8B4D /* minimuxer-helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A809F6A52D04DA1900F0F0F3 /* minimuxer-helpers.swift */; };
|
||||
A8C38C242D206A3A00E83DBD /* ConsoleLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8C38C1D2D206A3A00E83DBD /* ConsoleLogger.swift */; };
|
||||
A8C38C262D206A3A00E83DBD /* ConsoleLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8C38C1E2D206A3A00E83DBD /* ConsoleLog.swift */; };
|
||||
@@ -630,6 +632,8 @@
|
||||
A86202322D1F35640091187B /* AltStore.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AltStore.xcconfig; sourceTree = "<group>"; };
|
||||
A86202332D1F35640091187B /* AltStoreCore.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AltStoreCore.xcconfig; sourceTree = "<group>"; };
|
||||
A8945AA52D059B6100D86CBE /* Roxas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Roxas.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A8B516E22D2666CA0047047C /* CoreDataHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataHelper.swift; sourceTree = "<group>"; };
|
||||
A8B516E52D2668020047047C /* DateTimeUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTimeUtil.swift; sourceTree = "<group>"; };
|
||||
A8C38C1D2D206A3A00E83DBD /* ConsoleLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleLogger.swift; sourceTree = "<group>"; };
|
||||
A8C38C1E2D206A3A00E83DBD /* ConsoleLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleLog.swift; sourceTree = "<group>"; };
|
||||
A8C38C282D206AC100E83DBD /* OutputStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutputStream.swift; sourceTree = "<group>"; };
|
||||
@@ -1173,9 +1177,26 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A8B516DE2D2666900047047C /* debug */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A8B516DF2D2666A00047047C /* database */,
|
||||
);
|
||||
path = debug;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A8B516DF2D2666A00047047C /* database */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A8B516E22D2666CA0047047C /* CoreDataHelper.swift */,
|
||||
);
|
||||
path = database;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A8C38C1C2D2068D100E83DBD /* Utils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A8B516DE2D2666900047047C /* debug */,
|
||||
A8C38C272D206AA500E83DBD /* common */,
|
||||
A8C38C202D206A3A00E83DBD /* iostreams */,
|
||||
);
|
||||
@@ -1194,6 +1215,7 @@
|
||||
A8C38C272D206AA500E83DBD /* common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A8B516E52D2668020047047C /* DateTimeUtil.swift */,
|
||||
A8C38C282D206AC100E83DBD /* OutputStream.swift */,
|
||||
A8C38C312D206B2500E83DBD /* FileOutputStream.swift */,
|
||||
A8C38C2B2D206AD900E83DBD /* AbstractClassError.swift */,
|
||||
@@ -2912,6 +2934,7 @@
|
||||
A8C38C262D206A3A00E83DBD /* ConsoleLog.swift in Sources */,
|
||||
D5935AED29C39DE300C157EF /* SourceComponents.swift in Sources */,
|
||||
D5935AED29C39DE300C157EF /* SourceComponents.swift in Sources */,
|
||||
A8B516E62D2668170047047C /* DateTimeUtil.swift in Sources */,
|
||||
A8FD917C2D0478D200322782 /* VerificationError.swift in Sources */,
|
||||
D5A0537329B91DB400997551 /* SourceDetailContentViewController.swift in Sources */,
|
||||
BF770E5422BC044E002A40FE /* OperationContexts.swift in Sources */,
|
||||
@@ -2986,6 +3009,7 @@
|
||||
BFF0B6942321CB85007A79E1 /* AuthenticationViewController.swift in Sources */,
|
||||
0EE7FDCD2BE9124400D1E390 /* ErrorDetailsViewController.swift in Sources */,
|
||||
D561AF822B21669400BF59C6 /* VerifyAppPledgeOperation.swift in Sources */,
|
||||
A8B516E32D2666CA0047047C /* CoreDataHelper.swift in Sources */,
|
||||
BF3432FB246B894F0052F4A1 /* BackupAppOperation.swift in Sources */,
|
||||
BF9ABA4922DD0742008935CF /* ScreenshotCollectionViewCell.swift in Sources */,
|
||||
BF9ABA4D22DD16DE008935CF /* PillButton.swift in Sources */,
|
||||
|
||||
@@ -1763,7 +1763,7 @@ private extension AppManager
|
||||
private func exportResginedAppsToDocsDir(_ resignedApp: ALTApplication)
|
||||
{
|
||||
// Check if the user has enabled exporting resigned apps to the Documents directory and continue
|
||||
guard UserDefaults.standard.isResignedAppExportEnabled else {
|
||||
guard UserDefaults.standard.isExportResignedAppEnabled else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<color key="separatorColor" white="1" alpha="0.25" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<stackView key="tableFooterView" opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalCentering" alignment="center" spacing="15" id="48g-cT-stR">
|
||||
<rect key="frame" x="0.0" y="1618.0000038146973" width="402" height="125"/>
|
||||
<rect key="frame" x="0.0" y="1559.3333358764648" width="402" height="125"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="900" text="Follow SideStore for updates" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XFa-MY-7cV">
|
||||
@@ -500,13 +500,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="View Error Log" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vH6-7i-tCE">
|
||||
<rect key="frame" x="30" y="15.5" width="119" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="119" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="AeT-qF-bwB">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -536,7 +536,7 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Clear Cache…" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j4e-Mz-DlL">
|
||||
<rect key="frame" x="30" y="15.5" width="114.5" height="20.5"/>
|
||||
<rect key="frame" x="29.999999999999993" y="15.333333333333334" width="114.33333333333331" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -568,22 +568,22 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Developers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hRA-OK-Vjw">
|
||||
<rect key="frame" x="30" y="15.5" width="86" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="86" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="lx9-35-OSk">
|
||||
<rect key="frame" x="187.5" y="15.5" width="157.5" height="20.5"/>
|
||||
<rect key="frame" x="214.66666666666663" y="15.333333333333336" width="157.33333333333337" height="20.333333333333329"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="SideStore Team" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JAA-iZ-VGb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="125.5" height="20.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="125.33333333333333" height="20.333333333333332"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="Mmj-3V-fTb">
|
||||
<rect key="frame" x="139.5" y="0.0" width="18" height="20.5"/>
|
||||
<rect key="frame" x="139.33333333333334" y="0.0" width="18" height="20.333333333333332"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
</stackView>
|
||||
@@ -612,22 +612,22 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="UI Designer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oqY-wY-1Vf">
|
||||
<rect key="frame" x="30" y="15.5" width="89" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="89" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="gUq-6Q-t5X">
|
||||
<rect key="frame" x="198" y="15.5" width="147" height="20.5"/>
|
||||
<rect key="frame" x="225" y="15.333333333333336" width="147" height="20.333333333333329"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Fabian (thdev)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ylE-VL-7Fq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="115" height="20.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="115" height="20.333333333333332"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="e3L-vR-Jae">
|
||||
<rect key="frame" x="129" y="0.0" width="18" height="20.5"/>
|
||||
<rect key="frame" x="129" y="0.0" width="18" height="20.333333333333332"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
</stackView>
|
||||
@@ -656,22 +656,22 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Asset Designer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGU-Fp-XgM">
|
||||
<rect key="frame" x="30" y="15.5" width="115.5" height="20.5"/>
|
||||
<rect key="frame" x="29.999999999999993" y="15.333333333333334" width="115.33333333333331" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="R8B-DW-7mY">
|
||||
<rect key="frame" x="206" y="15.5" width="139" height="20.5"/>
|
||||
<rect key="frame" x="233" y="15.333333333333336" width="139" height="20.333333333333329"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Chris (LitRitt)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hId-3P-41T">
|
||||
<rect key="frame" x="0.0" y="0.0" width="107" height="20.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="107" height="20.333333333333332"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="baq-cE-fMY">
|
||||
<rect key="frame" x="121" y="0.0" width="18" height="20.5"/>
|
||||
<rect key="frame" x="121" y="0.0" width="18" height="20.333333333333332"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
</stackView>
|
||||
@@ -700,13 +700,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Licenses" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D6b-cd-pVK">
|
||||
<rect key="frame" x="30" y="15.5" width="67.5" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="67.333333333333329" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="s79-GQ-khr">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -740,13 +740,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Send Feedback" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pMI-Aj-nQF">
|
||||
<rect key="frame" x="30" y="15.5" width="125.5" height="20.5"/>
|
||||
<rect key="frame" x="29.999999999999993" y="15.333333333333334" width="125.33333333333331" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="Jyy-x0-Owj">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -773,13 +773,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="View Refresh Attempts" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sni-07-q0M">
|
||||
<rect key="frame" x="30" y="15.5" width="187.5" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="187.66666666666666" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="4d3-me-Hqc">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -809,13 +809,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="SideJITServer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="46q-DB-5nc">
|
||||
<rect key="frame" x="30" y="15.5" width="115.5" height="20.5"/>
|
||||
<rect key="frame" x="29.999999999999993" y="15.333333333333334" width="115.33333333333331" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="wvD-eZ-nQI">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -842,13 +842,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Reset Pairing File" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ysS-9s-dXm">
|
||||
<rect key="frame" x="30" y="15.5" width="140" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="140" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="r09-mH-pOD">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -875,13 +875,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Anisette Servers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eds-Dj-36y">
|
||||
<rect key="frame" x="30" y="15.5" width="135.5" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="135.66666666666666" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="0dh-yd-7i9">
|
||||
<rect key="frame" x="327" y="16.5" width="18" height="18"/>
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -908,13 +908,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Disable Response Caching" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2ox-HD-0UT">
|
||||
<rect key="frame" x="30" y="15.5" width="215.5" height="20.5"/>
|
||||
<rect key="frame" x="30.000000000000014" y="15.333333333333334" width="215.33333333333337" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e30-w4-5fk">
|
||||
<rect key="frame" x="296" y="10" width="51" height="31"/>
|
||||
<rect key="frame" x="323" y="10" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="toggleDisableResponseCaching:" destination="aMk-Xp-UL8" eventType="valueChanged" id="uuG-Gf-7GK"/>
|
||||
</connections>
|
||||
@@ -944,13 +944,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Enable Beta Updates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2px-HD-0UT">
|
||||
<rect key="frame" x="30" y="15.5" width="215.5" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="169" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e32-w4-5fk">
|
||||
<rect key="frame" x="296" y="10" width="51" height="31"/>
|
||||
<rect key="frame" x="323" y="10" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="toggleEnableBetaUpdates:" destination="aMk-Xp-UL8" eventType="valueChanged" id="uxG-df-7GK"/>
|
||||
</connections>
|
||||
@@ -980,13 +980,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Export Resigned Apps" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2px-HX-0UT">
|
||||
<rect key="frame" x="30" y="15.5" width="215.5" height="20.5"/>
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="180" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e32-w4-3fk">
|
||||
<rect key="frame" x="296" y="10" width="51" height="31"/>
|
||||
<rect key="frame" x="323" y="10" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="toggleResignedAppExport:" destination="aMk-Xp-UL8" eventType="valueChanged" id="uxG-af-7GK"/>
|
||||
</connections>
|
||||
@@ -1003,11 +1003,44 @@
|
||||
<edgeInsets key="layoutMargins" top="8" left="30" bottom="8" right="30"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="style">
|
||||
<integer key="value" value="3"/>
|
||||
<integer key="value" value="2"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="isSelectable" value="NO"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="d8q-Ca-Ha7" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="1607.0000038146973" width="402" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="d8q-Ca-Ha7" id="1IT-AV-BCa">
|
||||
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Export SqLite DB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JH4-WM-swi">
|
||||
<rect key="frame" x="30" y="15.333333333333334" width="137.66666666666666" height="20.333333333333329"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="Next" translatesAutoresizingMaskIntoConstraints="NO" id="1V4-St-wzf">
|
||||
<rect key="frame" x="354" y="16.666666666666668" width="18" height="18.000000000000004"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="1V4-St-wzf" secondAttribute="trailing" id="1GV-yg-5WV"/>
|
||||
<constraint firstItem="JH4-WM-swi" firstAttribute="centerY" secondItem="1IT-AV-BCa" secondAttribute="centerY" id="6ma-VE-kAK"/>
|
||||
<constraint firstItem="1V4-St-wzf" firstAttribute="centerY" secondItem="1IT-AV-BCa" secondAttribute="centerY" id="KdN-cj-cVJ"/>
|
||||
<constraint firstItem="JH4-WM-swi" firstAttribute="leading" secondItem="1IT-AV-BCa" secondAttribute="leadingMargin" id="x9U-Bi-vvJ"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="1" alpha="0.14999999999999999" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<edgeInsets key="layoutMargins" top="8" left="30" bottom="8" right="30"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="style">
|
||||
<integer key="value" value="3"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="isSelectable" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
</sections>
|
||||
|
||||
@@ -73,7 +73,8 @@ extension SettingsViewController
|
||||
case anisetteServers
|
||||
case responseCaching
|
||||
case betaUpdates
|
||||
case resignedAppExport
|
||||
case exportResignedApp
|
||||
case exportSqliteDB
|
||||
// case advancedSettings
|
||||
}
|
||||
}
|
||||
@@ -111,6 +112,8 @@ final class SettingsViewController: UITableViewController
|
||||
return .lightContent
|
||||
}
|
||||
|
||||
private var exportDBInProgress = false
|
||||
|
||||
required init?(coder aDecoder: NSCoder)
|
||||
{
|
||||
super.init(coder: aDecoder)
|
||||
@@ -253,7 +256,7 @@ private extension SettingsViewController
|
||||
self.disableAppLimitSwitch.isOn = UserDefaults.standard.isAppLimitDisabled
|
||||
self.disableResponseCachingSwitch.isOn = UserDefaults.standard.responseCachingDisabled
|
||||
self.isBetaUpdatesEnabled.isOn = UserDefaults.standard.isBetaUpdatesEnabled
|
||||
self.isResignedAppExportEnabled.isOn = UserDefaults.standard.isResignedAppExportEnabled
|
||||
self.isResignedAppExportEnabled.isOn = UserDefaults.standard.isExportResignedAppEnabled
|
||||
|
||||
if self.isViewLoaded
|
||||
{
|
||||
@@ -434,7 +437,7 @@ private extension SettingsViewController
|
||||
|
||||
@IBAction func toggleResignedAppExport(_ sender: UISwitch) {
|
||||
// update it in database
|
||||
UserDefaults.standard.isResignedAppExportEnabled = sender.isOn
|
||||
UserDefaults.standard.isExportResignedAppEnabled = sender.isOn
|
||||
}
|
||||
|
||||
@IBAction func toggleEnableBetaUpdates(_ sender: UISwitch) {
|
||||
@@ -995,6 +998,32 @@ extension SettingsViewController
|
||||
|
||||
self.prepare(for: UIStoryboardSegue(identifier: "anisetteServers", source: self, destination: anisetteServersController), sender: nil)
|
||||
|
||||
case .exportSqliteDB:
|
||||
// do not accept simulatenous export requests
|
||||
if !exportDBInProgress {
|
||||
exportDBInProgress = true
|
||||
Task{
|
||||
var toastView: ToastView?
|
||||
do{
|
||||
let exportedURL = try await CoreDataHelper.exportCoreDataStore()
|
||||
print("exportSqliteDB: ExportedURL: \(exportedURL)")
|
||||
toastView = ToastView(text: "Export Successful", detailText: nil)
|
||||
}catch{
|
||||
print("exportSqliteDB: \(error)")
|
||||
toastView = ToastView(error: error)
|
||||
}
|
||||
|
||||
// show toast to user about the result
|
||||
DispatchQueue.main.async {
|
||||
toastView?.show(in: self)
|
||||
}
|
||||
|
||||
// update that work has finished
|
||||
exportDBInProgress = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// case .advancedSettings:
|
||||
// // Create the URL that deep links to your app's custom settings.
|
||||
// if let url = URL(string: UIApplication.openSettingsURLString) {
|
||||
@@ -1003,7 +1032,7 @@ extension SettingsViewController
|
||||
// } else {
|
||||
// ELOG("UIApplication.openSettingsURLString invalid")
|
||||
// }
|
||||
case .refreshAttempts, .responseCaching, .betaUpdates, .resignedAppExport : break
|
||||
case .refreshAttempts, .responseCaching, .betaUpdates, .exportResignedApp : break
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public extension UserDefaults
|
||||
@NSManaged var isIdleTimeoutDisableEnabled: Bool
|
||||
@NSManaged var isAppLimitDisabled: Bool
|
||||
@NSManaged var isBetaUpdatesEnabled: Bool
|
||||
@NSManaged var isResignedAppExportEnabled: Bool
|
||||
@NSManaged var isExportResignedAppEnabled: Bool
|
||||
@NSManaged var isPairingReset: Bool
|
||||
@NSManaged var isDebugModeEnabled: Bool
|
||||
@NSManaged var presentedLaunchReminderNotification: Bool
|
||||
@@ -119,7 +119,7 @@ public extension UserDefaults
|
||||
let defaults = [
|
||||
#keyPath(UserDefaults.isAppLimitDisabled): false,
|
||||
#keyPath(UserDefaults.isBetaUpdatesEnabled): false,
|
||||
#keyPath(UserDefaults.isResignedAppExportEnabled): false,
|
||||
#keyPath(UserDefaults.isExportResignedAppEnabled): false,
|
||||
#keyPath(UserDefaults.isBackgroundRefreshEnabled): true,
|
||||
#keyPath(UserDefaults.isIdleTimeoutDisableEnabled): true,
|
||||
#keyPath(UserDefaults.isPairingReset): true,
|
||||
|
||||
25
SideStore/Utils/common/DateTimeUtil.swift
Normal file
25
SideStore/Utils/common/DateTimeUtil.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// DateTimeUtil.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Magesh K on 02/01/25.
|
||||
// Copyright © 2025 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class DateTimeUtil {
|
||||
public static func getDateInTimeStamp(date: Date) -> String {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = "yyyyMMdd_HHmmss" // Format: 20241228_142345
|
||||
// Ensures 24-hour clock format coz the locale value overrides it if it is of AM/PM format?! (why apple!)
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
return formatter.string(from: date)
|
||||
}
|
||||
|
||||
public static func getTimeStampSuffixedFileName(fileName: String, timestamp: String, extn: String) -> String {
|
||||
// create a log file with the current timestamp
|
||||
let fnameWithTimestamp = "\(fileName)-\(timestamp)\(extn)"
|
||||
return fnameWithTimestamp
|
||||
}
|
||||
}
|
||||
130
SideStore/Utils/debug/database/CoreDataHelper.swift
Normal file
130
SideStore/Utils/debug/database/CoreDataHelper.swift
Normal file
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// CoreDataHelper.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Magesh K on 02/01/25.
|
||||
// Copyright © 2025 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
class CoreDataHelper{
|
||||
|
||||
private static let STORE_XCMODELD_NAME = "AltStore"
|
||||
private static let COREDATA_BUNDLE_ID = "com.SideStore.SideStore.AltStoreCore"
|
||||
|
||||
// Create a serial dispatch queue to lock access to the Core Data store
|
||||
private static let datastoreQueue = DispatchQueue(label: "com.SideStore.AltStore.datastoreQueue")
|
||||
|
||||
public static func exportCoreDataStore() async throws -> URL {
|
||||
|
||||
// Locate the bundle containing the Core Data model
|
||||
guard let bundle = Bundle(identifier: COREDATA_BUNDLE_ID) else {
|
||||
let errorDescription = "AltStoreCore bundle not found"
|
||||
throw getCoreDataError(code: 1, localizedDescription: errorDescription)
|
||||
}
|
||||
|
||||
// Load the model from the bundle
|
||||
guard let modelURL = bundle.url(forResource: STORE_XCMODELD_NAME, withExtension: "momd"),
|
||||
let model = NSManagedObjectModel(contentsOf: modelURL) else {
|
||||
|
||||
let errorDescription = "Failed to load model \(STORE_XCMODELD_NAME) from AltStoreCore bundle"
|
||||
throw getCoreDataError(code: 2, localizedDescription: errorDescription)
|
||||
}
|
||||
|
||||
// let container = NSPersistentContainer(name: STORE_XCMODELD_NAME)
|
||||
let container = NSPersistentContainer(name: STORE_XCMODELD_NAME, managedObjectModel: model)
|
||||
|
||||
|
||||
// bridge callback into async-await pattern
|
||||
return try await withCheckedThrowingContinuation{ (continuation: CheckedContinuation<URL, Error>) in
|
||||
|
||||
// async callback processing
|
||||
container.loadPersistentStores { description, error in
|
||||
// perform actual backup in sync manner
|
||||
do{
|
||||
let exportedURL = try backupCoreDataStore(container: container, loadError: error)
|
||||
continuation.resume(returning: exportedURL)
|
||||
}catch{
|
||||
continuation.resume(throwing: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static func getCoreDataError(code: Int, localizedDescription: String) -> Error {
|
||||
return NSError(domain: "CoreDataExport", code: code, userInfo: [NSLocalizedDescriptionKey: localizedDescription])
|
||||
}
|
||||
|
||||
|
||||
private static func backupCoreDataStore(container: NSPersistentContainer, loadError: Error?) throws -> URL {
|
||||
|
||||
// Check for load errors
|
||||
if let error = loadError {
|
||||
let errorDescription = "Failed to load persistent store: \(error.localizedDescription)"
|
||||
throw getCoreDataError(code: 3, localizedDescription: errorDescription)
|
||||
}
|
||||
|
||||
guard let storeURL = container.persistentStoreCoordinator.persistentStores.first?.url else {
|
||||
let errorDescription = "Persistent store URL not found"
|
||||
throw getCoreDataError(code: 4, localizedDescription: errorDescription)
|
||||
}
|
||||
|
||||
let fileManager = FileManager.default
|
||||
let documentsURL = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first!
|
||||
let exportedDir = documentsURL.appendingPathComponent("ExportedCoreDataStores", isDirectory: true)
|
||||
|
||||
let currentDateTime = Date()
|
||||
let currentTimeStamp = DateTimeUtil.getDateInTimeStamp(date: currentDateTime)
|
||||
|
||||
let fileNamePrefix = storeURL.deletingPathExtension().lastPathComponent
|
||||
let fileExtension = storeURL.pathExtension
|
||||
let fileName = DateTimeUtil.getTimeStampSuffixedFileName(
|
||||
fileName: fileNamePrefix,
|
||||
timestamp: currentTimeStamp,
|
||||
extn: "." + fileExtension
|
||||
)
|
||||
|
||||
let destinationURL = exportedDir.appendingPathComponent(fileName)
|
||||
|
||||
let directoryURL = storeURL.deletingLastPathComponent()
|
||||
if let files = try? FileManager.default.contentsOfDirectory(atPath: directoryURL.path) {
|
||||
print("Files in Application Support: \(files)")
|
||||
} else {
|
||||
print("Failed to list directory contents.")
|
||||
}
|
||||
|
||||
let parentDirectory = destinationURL.deletingLastPathComponent()
|
||||
|
||||
|
||||
do {
|
||||
// create intermediate dirs as required
|
||||
try FileManager.default.createDirectory(at: parentDirectory,
|
||||
withIntermediateDirectories: true,
|
||||
attributes: nil)
|
||||
|
||||
// Copy main SQLite file
|
||||
try fileManager.copyItem(at: storeURL, to: destinationURL)
|
||||
|
||||
// Copy -shm and -wal files if they exist
|
||||
let additionalFiles = ["-shm", "-wal"].compactMap {
|
||||
destinationURL.deletingPathExtension().appendingPathExtension(destinationURL.pathExtension + $0)
|
||||
}
|
||||
|
||||
for file in additionalFiles where fileManager.fileExists(atPath: file.path) {
|
||||
let destination = documentsURL.appendingPathComponent(file.lastPathComponent)
|
||||
try fileManager.copyItem(at: file, to: destination)
|
||||
}
|
||||
|
||||
print("Core Data store exported to: \(destinationURL.path)")
|
||||
return destinationURL
|
||||
|
||||
} catch {
|
||||
let errorDescription = "Failed to copy Core Data files: \(error.localizedDescription)"
|
||||
throw getCoreDataError(code: 5, localizedDescription: errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,14 @@ class ConsoleLog {
|
||||
public lazy var logFileURL: URL = {
|
||||
// get current timestamp
|
||||
let currentTime = Date()
|
||||
let dateTimeStamp = ConsoleLog.getDateInTimeStamp(date: currentTime)
|
||||
let dateTimeStamp = DateTimeUtil.getDateInTimeStamp(date: currentTime)
|
||||
|
||||
// create a log file with the current timestamp
|
||||
let logName = "\(ConsoleLog.CONSOLE_LOG_NAME_PREFIX)-\(dateTimeStamp)\(ConsoleLog.CONSOLE_LOG_EXTN)"
|
||||
let logName = DateTimeUtil.getTimeStampSuffixedFileName(
|
||||
fileName: ConsoleLog.CONSOLE_LOG_NAME_PREFIX,
|
||||
timestamp: dateTimeStamp,
|
||||
extn: ConsoleLog.CONSOLE_LOG_EXTN
|
||||
)
|
||||
let logFileURL = consoleLogsDir.appendingPathComponent(logName)
|
||||
return logFileURL
|
||||
}()
|
||||
@@ -56,12 +60,6 @@ class ConsoleLog {
|
||||
return try! FileHandle(forWritingTo: logFileURL)
|
||||
}
|
||||
|
||||
private static func getDateInTimeStamp(date: Date) -> String {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = "yyyyMMdd_HHmmss" // Format: 20241228_142345
|
||||
return formatter.string(from: date)
|
||||
}
|
||||
|
||||
func startCapturing() {
|
||||
consoleLogger.startCapturing()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user