Skip to content

Commit

Permalink
added trial license beginnings
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Mar 28, 2023
1 parent 72da3de commit 5a6cc5a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 14 deletions.
18 changes: 15 additions & 3 deletions XCredsLoginPlugIn/LoginWindow/LoginWindowControls.xib
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<customObject id="-2" userLabel="File's Owner" customClass="LoginWindowControlsWindowController" customModule="XCredsLoginPlugin" customModuleProvider="target">
<connections>
<outlet property="macLoginWindowGribColumn" destination="wvm-rM-lRK" id="bUx-fo-f3O"/>
<outlet property="trialVersionStatusTextField" destination="4Mf-Zr-Ve0" id="7cm-zX-gJq"/>
<outlet property="versionTextField" destination="CZW-Aq-1af" id="4tX-3s-sXH"/>
<outlet property="wifiGridColumn" destination="1Cd-fS-KBP" id="nYv-8P-Xte"/>
<outlet property="window" destination="wkO-FS-5uW" id="ui3-ZB-mfw"/>
Expand All @@ -20,7 +21,7 @@
<windowStyleMask key="styleMask" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="25" y="25" width="872" height="117"/>
<rect key="screenRect" x="0.0" y="0.0" width="1728" height="1079"/>
<rect key="screenRect" x="0.0" y="0.0" width="3440" height="1415"/>
<view key="contentView" id="Tpj-ss-EMv">
<rect key="frame" x="0.0" y="0.0" width="872" height="117"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -56,7 +57,7 @@
</gridCell>
<gridCell row="XHx-7d-YkX" column="cUX-O2-zNV" xPlacement="center" id="2Gc-hy-IjQ">
<button key="contentView" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6f9-0z-Xqg">
<rect key="frame" x="154" y="0.0" width="65" height="48"/>
<rect key="frame" x="153" y="0.0" width="66" height="48"/>
<buttonCell key="cell" type="bevel" title="Shutdown" bezelStyle="rounded" image="ShutdownX" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="WRj-LR-MaW">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -124,13 +125,24 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4Mf-Zr-Ve0">
<rect key="frame" x="0.0" y="98" width="872" height="19"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Unsupported – Visit twocanoes.com/xcreds/support for support options." drawsBackground="YES" id="DH5-if-nXu">
<font key="font" metaFont="system" size="16"/>
<color key="textColor" name="systemBlueColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="sxl-0U-ne5" firstAttribute="centerY" secondItem="Tpj-ss-EMv" secondAttribute="centerY" constant="0.5" id="2Wq-KM-ceX"/>
<constraint firstAttribute="trailing" secondItem="4Mf-Zr-Ve0" secondAttribute="trailing" id="9sL-iB-86p"/>
<constraint firstItem="4Mf-Zr-Ve0" firstAttribute="top" secondItem="Tpj-ss-EMv" secondAttribute="top" id="ETp-Pk-3l7"/>
<constraint firstAttribute="bottom" secondItem="CZW-Aq-1af" secondAttribute="bottom" constant="2" id="GqF-H9-jma"/>
<constraint firstAttribute="trailing" secondItem="sxl-0U-ne5" secondAttribute="trailing" id="HvD-9w-Gp7"/>
<constraint firstItem="CZW-Aq-1af" firstAttribute="leading" secondItem="Tpj-ss-EMv" secondAttribute="leading" constant="12" id="LV2-Cx-B9c"/>
<constraint firstItem="sxl-0U-ne5" firstAttribute="leading" secondItem="Tpj-ss-EMv" secondAttribute="leading" id="P6t-00-a6e"/>
<constraint firstItem="4Mf-Zr-Ve0" firstAttribute="leading" secondItem="Tpj-ss-EMv" secondAttribute="leading" id="V4x-cE-RIp"/>
<constraint firstItem="sxl-0U-ne5" firstAttribute="centerX" secondItem="Tpj-ss-EMv" secondAttribute="centerX" id="eIH-vl-2ht"/>
</constraints>
</view>
Expand All @@ -140,7 +152,7 @@
<resources>
<image name="RestartX" width="32" height="32"/>
<image name="ShutdownX" width="32" height="32"/>
<image name="loginwindow" width="41" height="31.5"/>
<image name="loginwindow" width="41" height="32"/>
<image name="refresh symbol" width="989" height="989"/>
<image name="wifi" width="32" height="32"/>
</resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class LoginWindowControlsWindowController: NSWindowController {
var loadPageURL:URL?
var resolutionObserver:Any?
var wifiWindowController:WifiWindowController?
@IBOutlet weak var trialVersionStatusTextField: NSTextField!
var refreshTimer:Timer?
func dismiss() {
if let resolutionObserver = resolutionObserver {
Expand Down Expand Up @@ -69,8 +70,21 @@ class LoginWindowControlsWindowController: NSWindowController {
self.macLoginWindowGribColumn?.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowMacLoginButton .rawValue)

self.versionTextField?.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowVersionInfo.rawValue)
self.trialVersionStatusTextField?.isHidden = false

// self.versionTextField?.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowVersionInfo.rawValue)
let check = TCSLicenseCheck()

self.versionTextField?.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowVersionInfo.rawValue)
let status = check.checkLicenseStatus("com.twocanoes.xcreds", withExtension: "")

if status != .invalid {
TCSLogWithMark("valid license")

}
else {
TCSLogWithMark("invalid license")

}



Expand Down
15 changes: 13 additions & 2 deletions app_to_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@ xcodebuild -scheme "XCreds" -configuration "Release" -derivedDataPath "${DERI

ssh root@"${REMOTE_MAC}" 'bash -c "if [ -e "/Applications/XCreds.app" ] ; then echo removing; rm -rf "/Applications/XCreds.app"; fi"'

scp -r "${DERIVED_DATA_DIR}"/Build/Products/Release/XCreds.app root@"${REMOTE_MAC}":/Applications/
if [ -e /tmp/xcreds/xcreds.zip ]; then
rm /tmp/xcreds/xcreds.zip
fi

pushd /tmp/xcreds/DerivedData/Build/Products/Release/
zip -r /tmp/xcreds/xcreds.zip XCreds.app
popd

ssh root@"${REMOTE_MAC}" 'bash -c "if [ -e "/tmp/xcreds.zip" ] ; then echo removing; rm -rf "/tmp/xcreds.zip"; fi"'

scp -r /tmp/xcreds/xcreds.zip root@"${REMOTE_MAC}":/tmp/xcreds.zip

#ssh -J tcadmin@simac.local root@test001.local reboot || exit 0

ssh root@"${REMOTE_MAC}" unzip /tmp/xcreds.zip -d /Applications
#scp -r /tmp/xcreds/DerivedData/Build/Products/Release/XCreds.app root@"${REMOTE_MAC}":/Applications
ssh root@"${REMOTE_MAC}" /Applications/XCreds.app/Contents/Resources/xcreds_login.sh -r

ssh root@"${REMOTE_MAC}" /Applications/XCreds.app/Contents/Resources/xcreds_login.sh -i
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3504;
CURRENT_PROJECT_VERSION = 3509;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1026,7 +1026,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3504;
CURRENT_PROJECT_VERSION = 3509;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1091,7 +1091,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3504;
CURRENT_PROJECT_VERSION = 3509;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1127,7 +1127,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3504;
CURRENT_PROJECT_VERSION = 3509;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1276,7 +1276,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3504;
CURRENT_PROJECT_VERSION = 3509;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1311,7 +1311,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3504;
CURRENT_PROJECT_VERSION = 3509;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@
filePath = "XCredsLoginPlugIn/LoginWindow/LoginWindowControlsWindowController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
startingLineNumber = "54"
endingLineNumber = "54"
landmarkName = "windowDidLoad()"
landmarkType = "7">
</BreakpointContent>
Expand Down

0 comments on commit 5a6cc5a

Please sign in to comment.