Skip to content

Commit

Permalink
v1.4.0(47)
Browse files Browse the repository at this point in the history
fix for maccatalyst reject
Fix #17
add auto selection for cast converter
  • Loading branch information
lithium0003 committed Nov 17, 2019
1 parent 96feff7 commit d0837e6
Show file tree
Hide file tree
Showing 15 changed files with 381 additions and 54 deletions.
19 changes: 13 additions & 6 deletions RemoteCloud/RemoteCloud/Storages/CryptRclone.swift
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,18 @@ class ViewControllerPasswordRclone: UIViewController, UITextFieldDelegate, UIDoc
0xd3, 0x90, 0x19, 0x8e, 0xb8, 0x12, 0x8a, 0xfb,
0xf4, 0xde, 0x16, 0x2b, 0x8b, 0x95, 0xf6, 0x38,]
var ciphertext_stdbase64 = ciphertext.replacingOccurrences(of: "-", with: "+").replacingOccurrences(of: "_", with: "/")
ciphertext_stdbase64.append(contentsOf: String(repeating: "=", count: 4 - ciphertext_stdbase64.count % 4))
switch ciphertext_stdbase64.count % 4 {
case 0:
break
case 1:
return nil
case 2:
ciphertext_stdbase64.append(contentsOf: String(repeating: "=", count: 2))
case 3:
ciphertext_stdbase64.append(contentsOf: String(repeating: "=", count: 1))
default:
break
}
//print(ciphertext_stdbase64)
guard let cipher = Data(base64Encoded: ciphertext_stdbase64) else {
return nil
Expand Down Expand Up @@ -689,18 +700,14 @@ public class CryptRclone: ChildStorage {
{
case 1:
c = 4
break
case 3:
c = 3
break
case 4:
c = 2
break
case 6:
c = 1
break
default:
break;
break
}
}

Expand Down
8 changes: 8 additions & 0 deletions RemoteCloud/RemoteCloud/Storages/LocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,15 @@ public class LocalStorage: RemoteStorageBase {
}

do {
let attr = try FileManager.default.attributesOfItem(atPath: target.path)
let fileSize = attr[.size] as! UInt64

UploadManeger.shared.UploadFixSize(identifier: sessionId, size: Int(fileSize))

try FileManager.default.moveItem(at: target, to: newURL)

UploadManeger.shared.UploadProgress(identifier: sessionId, possition: Int(fileSize))

let group2 = DispatchGroup()
group1.notify(queue: .global()) {
self.storeItem(item: newURL, parentFileId: parentId, parentPath: parentPath, group: group2)
Expand Down
2 changes: 1 addition & 1 deletion ccViewer.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
3F48A079237AFDFF008B6690 /* GoogleCast.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3F48A076237AFD99008B6690 /* GoogleCast.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3F92E7032336B1F700D1FF9B /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F92E7022336B1F700D1FF9B /* Media.xcassets */; };
3FA954D62322EC22005B086A /* ViewControllerConvert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FA954D52322EC22005B086A /* ViewControllerConvert.swift */; };
3FC2F2392381355800EB747C /* ccViewer.help in Resources */ = {isa = PBXBuildFile; fileRef = 3FC2F2382381355800EB747C /* ccViewer.help */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -131,15 +132,15 @@
3CEF9AC8223EE865008F90B5 /* ViewControllerPDF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerPDF.swift; sourceTree = "<group>"; };
3CF15E7822370B9300328A90 /* ViewControllerText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerText.swift; sourceTree = "<group>"; };
3CF89CEF22333C14002FF0B5 /* TableViewControllerSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewControllerSetting.swift; sourceTree = "<group>"; };
3CFCF695222F347A00843054 /* ccViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ccViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
3CFCF695222F347A00843054 /* CryptCloudViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CryptCloudViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
3CFCF698222F347A00843054 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3CFCF69D222F347A00843054 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3CFCF6A2222F347B00843054 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3CFCF6A5222F347B00843054 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3CFCF6AC222F347B00843054 /* ccViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ccViewerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3CFCF6AC222F347B00843054 /* CryptCloudViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CryptCloudViewerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3CFCF6B0222F347B00843054 /* ccViewerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ccViewerTests.swift; sourceTree = "<group>"; };
3CFCF6B2222F347B00843054 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3CFCF6B7222F347B00843054 /* ccViewerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ccViewerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3CFCF6B7222F347B00843054 /* CryptCloudViewerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CryptCloudViewerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3CFCF6BB222F347B00843054 /* ccViewerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ccViewerUITests.swift; sourceTree = "<group>"; };
3CFCF6BD222F347B00843054 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3CFCF6C9222F351900843054 /* TableViewControllerRoot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewControllerRoot.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -183,6 +184,7 @@
3F9151D5236C191600E5EF65 /* GoogleCast.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleCast.framework; path = "../GoogleCastSDK-ios-4.4.5_dynamic/GoogleCast.framework"; sourceTree = "<group>"; };
3F92E7022336B1F700D1FF9B /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
3FA954D52322EC22005B086A /* ViewControllerConvert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerConvert.swift; sourceTree = "<group>"; };
3FC2F2382381355800EB747C /* ccViewer.help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ccViewer.help; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -281,16 +283,17 @@
3CFCF696222F347A00843054 /* Products */ = {
isa = PBXGroup;
children = (
3CFCF695222F347A00843054 /* ccViewer.app */,
3CFCF6AC222F347B00843054 /* ccViewerTests.xctest */,
3CFCF6B7222F347B00843054 /* ccViewerUITests.xctest */,
3CFCF695222F347A00843054 /* CryptCloudViewer.app */,
3CFCF6AC222F347B00843054 /* CryptCloudViewerTests.xctest */,
3CFCF6B7222F347B00843054 /* CryptCloudViewerUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
3CFCF697222F347A00843054 /* ccViewer */ = {
isa = PBXGroup;
children = (
3FC2F2382381355800EB747C /* ccViewer.help */,
3CFCF698222F347A00843054 /* AppDelegate.swift */,
3CFCF6A2222F347B00843054 /* Assets.xcassets */,
3CA2C96122355E9B00481DB5 /* ccViewer.entitlements */,
Expand Down Expand Up @@ -384,9 +387,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
3CFCF694222F347A00843054 /* ccViewer */ = {
3CFCF694222F347A00843054 /* CryptCloudViewer */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewer" */;
buildConfigurationList = 3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewer" */;
buildPhases = (
3CFCF691222F347A00843054 /* Sources */,
3CFCF692222F347A00843054 /* Frameworks */,
Expand All @@ -399,14 +402,14 @@
);
dependencies = (
);
name = ccViewer;
name = CryptCloudViewer;
productName = ccViewer;
productReference = 3CFCF695222F347A00843054 /* ccViewer.app */;
productReference = 3CFCF695222F347A00843054 /* CryptCloudViewer.app */;
productType = "com.apple.product-type.application";
};
3CFCF6AB222F347B00843054 /* ccViewerTests */ = {
3CFCF6AB222F347B00843054 /* CryptCloudViewerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerTests" */;
buildConfigurationList = 3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerTests" */;
buildPhases = (
3CFCF6A8222F347B00843054 /* Sources */,
3CFCF6A9222F347B00843054 /* Frameworks */,
Expand All @@ -417,14 +420,14 @@
dependencies = (
3CFCF6AE222F347B00843054 /* PBXTargetDependency */,
);
name = ccViewerTests;
name = CryptCloudViewerTests;
productName = ccViewerTests;
productReference = 3CFCF6AC222F347B00843054 /* ccViewerTests.xctest */;
productReference = 3CFCF6AC222F347B00843054 /* CryptCloudViewerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
3CFCF6B6222F347B00843054 /* ccViewerUITests */ = {
3CFCF6B6222F347B00843054 /* CryptCloudViewerUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerUITests" */;
buildConfigurationList = 3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerUITests" */;
buildPhases = (
3CFCF6B3222F347B00843054 /* Sources */,
3CFCF6B4222F347B00843054 /* Frameworks */,
Expand All @@ -435,9 +438,9 @@
dependencies = (
3CFCF6B9222F347B00843054 /* PBXTargetDependency */,
);
name = ccViewerUITests;
name = CryptCloudViewerUITests;
productName = ccViewerUITests;
productReference = 3CFCF6B7222F347B00843054 /* ccViewerUITests.xctest */;
productReference = 3CFCF6B7222F347B00843054 /* CryptCloudViewerUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -495,7 +498,7 @@
};
};
};
buildConfigurationList = 3CFCF690222F347900843054 /* Build configuration list for PBXProject "ccViewer" */;
buildConfigurationList = 3CFCF690222F347900843054 /* Build configuration list for PBXProject "CryptCloudViewer" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -509,9 +512,9 @@
projectDirPath = "";
projectRoot = "";
targets = (
3CFCF694222F347A00843054 /* ccViewer */,
3CFCF6AB222F347B00843054 /* ccViewerTests */,
3CFCF6B6222F347B00843054 /* ccViewerUITests */,
3CFCF694222F347A00843054 /* CryptCloudViewer */,
3CFCF6AB222F347B00843054 /* CryptCloudViewerTests */,
3CFCF6B6222F347B00843054 /* CryptCloudViewerUITests */,
);
};
/* End PBXProject section */
Expand All @@ -525,6 +528,7 @@
3C4009192240653C0028A45A /* Localizable.strings in Resources */,
3F92E7032336B1F700D1FF9B /* Media.xcassets in Resources */,
3CFCF6A3222F347B00843054 /* Assets.xcassets in Resources */,
3FC2F2392381355800EB747C /* ccViewer.help in Resources */,
3CFCF69E222F347A00843054 /* Main.storyboard in Resources */,
3CC4851D2258945B0003C44A /* Settings.bundle in Resources */,
3C0693432253D1EC0040DC0B /* InfoPlist.strings in Resources */,
Expand Down Expand Up @@ -635,12 +639,12 @@
/* Begin PBXTargetDependency section */
3CFCF6AE222F347B00843054 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 3CFCF694222F347A00843054 /* ccViewer */;
target = 3CFCF694222F347A00843054 /* CryptCloudViewer */;
targetProxy = 3CFCF6AD222F347B00843054 /* PBXContainerItemProxy */;
};
3CFCF6B9222F347B00843054 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 3CFCF694222F347A00843054 /* ccViewer */;
target = 3CFCF694222F347A00843054 /* CryptCloudViewer */;
targetProxy = 3CFCF6B8222F347B00843054 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
Expand Down Expand Up @@ -809,9 +813,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 47;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = 7A9X38B4YU;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand Down Expand Up @@ -842,9 +847,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 47;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = 7A9X38B4YU;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand Down Expand Up @@ -886,7 +892,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ccViewer.app/ccViewer";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CryptCloudViewer.app/CryptCloudViewer";
};
name = Debug;
};
Expand All @@ -907,7 +913,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ccViewer.app/ccViewer";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CryptCloudViewer.app/CryptCloudViewer";
};
name = Release;
};
Expand Down Expand Up @@ -954,7 +960,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
3CFCF690222F347900843054 /* Build configuration list for PBXProject "ccViewer" */ = {
3CFCF690222F347900843054 /* Build configuration list for PBXProject "CryptCloudViewer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3CFCF6BE222F347B00843054 /* Debug */,
Expand All @@ -963,7 +969,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewer" */ = {
3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3CFCF6C1222F347B00843054 /* Debug */,
Expand All @@ -972,7 +978,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerTests" */ = {
3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3CFCF6C4222F347B00843054 /* Debug */,
Expand All @@ -981,7 +987,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerUITests" */ = {
3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3CFCF6C7222F347B00843054 /* Debug */,
Expand Down
4 changes: 4 additions & 0 deletions ccViewer/ccViewer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<string></string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleHelpBookFolder</key>
<string>ccViewer.help</string>
<key>CFBundleHelpBookName</key>
<string>maccatalyst.info.lithium03.ccViewer.help</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
2 changes: 2 additions & 0 deletions ccViewer/ccViewer/TableViewControllerItems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ class TableViewControllerItems: UITableViewController, UISearchResultsUpdating,

})
alert.addAction(cancelAction)
#if !targetEnvironment(macCatalyst)
alert.addAction(defaultAction)
#endif
alert.addAction(defaultAction2)
alert.addAction(defaultAction4)
alert.addAction(defaultAction5)
Expand Down
25 changes: 23 additions & 2 deletions ccViewer/ccViewer/TableViewControllerSetting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
NSLocalizedString("PlayList", comment: ""), //5
NSLocalizedString("Partial Play", comment: ""), //6
NSLocalizedString("Player control", comment: ""), //7
NSLocalizedString("Help", comment: "") //8
NSLocalizedString("Cast converter", comment: ""), //8
NSLocalizedString("Help", comment: "") //9
]
let settings = [["Password"],
[NSLocalizedString("Run one more", comment: "")],
Expand All @@ -95,6 +96,8 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
NSLocalizedString("Stop after specified duration", comment: "")],
[NSLocalizedString("Skip foward (sec)", comment: ""),
NSLocalizedString("Skip backward (sec)", comment: "")],
[NSLocalizedString("Ignore overlay subtiles", comment: ""),
NSLocalizedString("Auto select streams", comment: "")],
[NSLocalizedString("View online help", comment: ""),
NSLocalizedString("View privacy policy", comment: ""),
NSLocalizedString("Version", comment: "")]
Expand Down Expand Up @@ -251,6 +254,20 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
break
}
case 8:
let aSwitch = UISwitch()
aSwitch.addTarget(self, action: #selector(switchChanged), for: .valueChanged)
switch indexPath.row {
case 0:
aSwitch.isOn = UserDefaults.standard.bool(forKey: "noOverlaySubtitles")
aSwitch.tag = 12
case 1:
aSwitch.isOn = UserDefaults.standard.bool(forKey: "autoSelectStreams")
aSwitch.tag = 13
default:
break
}
cell.accessoryView = aSwitch
case 9:
switch indexPath.row {
case 0...1:
cell.accessoryType = .detailButton
Expand Down Expand Up @@ -301,6 +318,10 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
present(v, animated: false) {
v.dismiss(animated: false, completion: nil)
}
case 12:
UserDefaults.standard.set(value, forKey: "noOverlaySubtitles")
case 13:
UserDefaults.standard.set(value, forKey: "autoSelectStreams")
default:
break
}
Expand All @@ -322,7 +343,7 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
default:
break
}
case 8:
case 9:
switch indexPath.row {
case 0:
let url = URL(string: NSLocalizedString("Online help URL", comment: ""))!
Expand Down
Loading

0 comments on commit d0837e6

Please sign in to comment.