Skip to content

Commit

Permalink
Port blinksh#1215 to raw
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored and yury committed Apr 1, 2021
1 parent 23a9aa9 commit ed56fa5
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: ./get_frameworks.sh

- name: copy xcconfig
run: cp template_setup.xcconfig developer_setup.xcconfig

- name: actual build
run: set -o pipefail && xcodebuild archive -project Blink.xcodeproj -scheme Blink -sdk iphoneos -configuration Debug clean build IPHONEOS_DEPLOYMENT_TARGET='14.2' CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO ONLY_ACTIVE_ARCH=NO | tee build.log | xcpretty

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Frameworks/openssl.framework
## Other
*.moved-aside
*.xcuserstate
developer_setup.xcconfig

## Obj-C/Swift specific
*.hmap
Expand Down
42 changes: 24 additions & 18 deletions Blink.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
D27AD9BC222FDD3D00379872 /* xcall.m in Sources */ = {isa = PBXBuildFile; fileRef = D27AD9BB222FDD3D00379872 /* xcall.m */; };
D27BBA1C20529FFF00AEA303 /* TermStream.m in Sources */ = {isa = PBXBuildFile; fileRef = D27BBA1B20529FFF00AEA303 /* TermStream.m */; };
D27D0118261202A400128C23 /* KeyUIError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D27D0117261202A400128C23 /* KeyUIError.swift */; };
D27D01272615F1BD00128C23 /* developer_setup.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = D27D01232615F1BD00128C23 /* developer_setup.xcconfig */; };
D2887A5622DC676F00701BD5 /* SpaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2887A5522DC676F00701BD5 /* SpaceController.swift */; };
D2887A5E22DCA6D500701BD5 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2887A5D22DCA6D500701BD5 /* SceneDelegate.swift */; };
D28B0337243EF5F2008F38F6 /* Set+UIScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = D28B0336243EF5F2008F38F6 /* Set+UIScene.swift */; };
Expand Down Expand Up @@ -685,6 +686,7 @@
D27BBA1A20529FFF00AEA303 /* TermStream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TermStream.h; sourceTree = "<group>"; };
D27BBA1B20529FFF00AEA303 /* TermStream.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TermStream.m; sourceTree = "<group>"; };
D27D0117261202A400128C23 /* KeyUIError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyUIError.swift; sourceTree = "<group>"; };
D27D01232615F1BD00128C23 /* developer_setup.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = developer_setup.xcconfig; sourceTree = "<group>"; };
D2887A5522DC676F00701BD5 /* SpaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpaceController.swift; sourceTree = "<group>"; };
D2887A5D22DCA6D500701BD5 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
D28B0336243EF5F2008F38F6 /* Set+UIScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Set+UIScene.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1497,6 +1499,7 @@
EA0BA1821C0CC57B00719C1A = {
isa = PBXGroup;
children = (
D27D01232615F1BD00128C23 /* developer_setup.xcconfig */,
D2C243F7238E44960082C69C /* KB */,
C9B2E0031D6B612300B89F69 /* Settings */,
D265FBBB2317DD3C0017EAC4 /* BlinkTests */,
Expand Down Expand Up @@ -1719,13 +1722,13 @@
};
D265FBB92317DD3C0017EAC4 = {
CreatedOnToolsVersion = 11.0;
DevelopmentTeam = HV2S48975V;
DevelopmentTeam = "$(TEAM_ID)";
ProvisioningStyle = Automatic;
TestTargetID = EA0BA18A1C0CC57B00719C1A;
};
EA0BA18A1C0CC57B00719C1A = {
CreatedOnToolsVersion = 7.1.1;
DevelopmentTeam = HV2S48975V;
DevelopmentTeam = "$(TEAM_ID)";
LastSwiftMigration = 0830;
ProvisioningStyle = Automatic;
SystemCapabilities = {
Expand Down Expand Up @@ -1876,6 +1879,7 @@
buildActionMask = 2147483647;
files = (
D21A3FE321943BE200269705 /* [email protected] in Resources */,
D27D01272615F1BD00128C23 /* developer_setup.xcconfig in Resources */,
07E3AED31D919272007BC086 /* css in Resources */,
D21A3FDD21943BE200269705 /* [email protected] in Resources */,
D21A3FDF21943BE200269705 /* [email protected] in Resources */,
Expand Down Expand Up @@ -2261,7 +2265,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -2310,7 +2314,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -2348,7 +2352,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -2386,7 +2390,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = SSHTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
Expand Down Expand Up @@ -2421,7 +2425,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -2470,7 +2474,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -2508,7 +2512,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -2546,7 +2550,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = BlinkFilesTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
Expand Down Expand Up @@ -2577,7 +2581,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -2610,7 +2614,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = AppKitBridge/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
Expand All @@ -2637,7 +2641,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -2673,7 +2677,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = BlinkTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2691,6 +2695,7 @@
};
EA0BA1AB1C0CC57C00719C1A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D27D01232615F1BD00128C23 /* developer_setup.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -2743,6 +2748,7 @@
};
EA0BA1AC1C0CC57C00719C1A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D27D01232615F1BD00128C23 /* developer_setup.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -2806,7 +2812,7 @@
DEAD_CODE_STRIPPING = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -2820,7 +2826,7 @@
);
MARKETING_VERSION = 13.90.3;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = Com.CarlosCabanero.BlinkShell;
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID)";
PRODUCT_NAME = Blink;
PROVISIONING_PROFILE_SPECIFIER = "";
RUN_CLANG_STATIC_ANALYZER = YES;
Expand All @@ -2844,7 +2850,7 @@
CURRENT_PROJECT_VERSION = 273;
DEAD_CODE_STRIPPING = NO;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = HV2S48975V;
DEVELOPMENT_TEAM = "$(TEAM_ID)";
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = "";
INFOPLIST_FILE = Blink/Info.plist;
Expand All @@ -2854,7 +2860,7 @@
);
MARKETING_VERSION = 13.90.3;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = Com.CarlosCabanero.BlinkShell;
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID)";
PRODUCT_NAME = Blink;
PROVISIONING_PROFILE_SPECIFIER = "";
STRIP_STYLE = "non-global";
Expand Down
8 changes: 4 additions & 4 deletions Blink/Blink.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string>NSFileProtectionComplete</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.carloscabanero.blinkshell</string>
<string>iCloud.$(CLOUD_ID)</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
Expand All @@ -17,7 +17,7 @@
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.carloscabanero.blinkshell</string>
<string>iCloud.$(CLOUD_ID)</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
Expand All @@ -35,8 +35,8 @@
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)Com.CarlosCabanero.Blink</string>
<string>$(AppIdentifierPrefix)Com.CarlosCabanero.BlinkShell</string>
<string>$(AppIdentifierPrefix)$(KEYCHAIN_ID1)</string>
<string>$(AppIdentifierPrefix)$(KEYCHAIN_ID2)</string>
</array>
</dict>
</plist>
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ We made a ton easier to build and install Blink yourself on your iOS devices thr
git clone --recursive https://github.com/blinksh/blink.git && \
cd blink && ./get_frameworks.sh && \
rm -rf Blink.xcodeproj/project.xcworkspace/xcshareddata/
```
2. Open the project in XCode
3. Before doing anything else, go into the capabilities for the project and turn off Push Notifications, iCloud, and Keychain Sharing
4. Go to the General tab and change the bundle identifier to something that will work for your team
5. Stay in the general tab and select your team under the "Signing" section
6. Connect the device you want to build for and select it in Product -> Destination
7. Build and run on the device

2. Do the following
cd blink
cp template_setup.xcconfig developer_setup.xcconfig
edit developer_setup.xcconfig (change apple developer id etc).

3. Open the project in XCode

3a. If you want to build without iCloud, Push Notificationa and/or Keychain sharing, Before doing anything else, go into the capabilities for the project and turn off Push Notifications, iCloud, and Keychain Sharing

4. Connect the device you want to build for and select it in Product -> Destination
5. Build and run on the device

This will download Blink and the associated frameworks: `libssh2`, `OpenSSL`, `libmoshios`, `protobuf` and `ios_system`.

Expand Down
24 changes: 24 additions & 0 deletions template_setup.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// template_setup.xcconfig
// --> copied to developer_setup.xcconfig
//
// Created by Jan Iversen on 20/03/2021.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974

// update TEAM_ID with your apple developer id
TEAM_ID = HV2S48975V

// BUNDLE_ID is used as name for BUNDLE_IDENTIFIER
BUNDLE_ID = Com.CarlosCabanero.BlinkShell

// CLOUD_ID is used as name for iCloud (prefix icloud. is added)
CLOUD_ID = com.carloscabanero.blinkshell
// if you want to build without iCloud, please remove the section in xCode

// KEYCHAIN_ID is used as name for keychain
KEYCHAIN_ID1 = Com.carloscabanero.blink
KEYCHAIN_ID2 = Com.carloscabanero.blinkshell
// if you want to build without keychain, please remove the section in xCode

0 comments on commit ed56fa5

Please sign in to comment.