Skip to content

Commit

Permalink
bundleid&days
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakey authored and Jakey committed Mar 20, 2020
1 parent d220d52 commit 26bc1ed
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 59 deletions.
2 changes: 1 addition & 1 deletion ProfilesManager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
};
buildConfigurationList = A21193141AF1CA5B0064CA7D /* Build configuration list for PBXProject "ProfilesManager" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down
32 changes: 12 additions & 20 deletions ProfilesManager/Controller/ProfilesManagerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// static NSString *kColumnIdentifierUUID = @"uuid";
static NSString *kColumnIdentifierExpirationDate = @"expirationDate";
static NSString *kColumnIdentifierCreateDate = @"creationDate";
static NSString *kColumnIdentifierCreateDays = @"days";

@implementation ProfilesManagerViewController

Expand Down Expand Up @@ -83,12 +84,15 @@ - (void)loadProfileFilesWithSearchWord:(NSString *)searchWord {
NSArray *profileNames = [[[NSFileManager defaultManager] subpathsAtPath:_profileDir] pathsMatchingExtensions:@[@"mobileprovision", @"MOBILEPROVISION", @"provisionprofile", @"PROVISIONPROFILE"]];

NSMutableDictionary *provisions = [NSMutableDictionary dictionary];
for (NSString *fileName in profileNames) {
for (NSUInteger i=0;i<[profileNames count];i++) {
NSString *fileName = [profileNames objectAtIndex:i];

NSString *plistString;
NSMutableDictionary *dic = (NSMutableDictionary *)[PlistManager readPlist:[_profileDir stringByAppendingString:fileName ? : @""] plistString:&plistString];
dic[@"filePath"] = [_profileDir stringByAppendingString:fileName ? : @""];
NSMutableDictionary *dic = (NSMutableDictionary *)[PlistManager readPlist:[_profileDir stringByAppendingString:fileName?:@""] plistString:&plistString];
dic[@"filePath"] = [_profileDir stringByAppendingString:fileName?:@""];

if (dic && fileName) {

if (dic && fileName) {
if ([searchWord lowercaseString] && searchWord.length > 0) {
if ([[plistString lowercaseString] rangeOfString:[searchWord lowercaseString]].location != NSNotFound) {
provisions[fileName] = dic;
Expand Down Expand Up @@ -139,9 +143,11 @@ - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTabl
} else if ([[tableColumn identifier] isEqualToString:kColumnIdentifierDetal]) {
return realItem.detail;
} else if ([[tableColumn identifier] isEqualToString:kColumnIdentifierExpirationDate]) {
return realItem.expirationDate;
return [[DateManager sharedManager] stringConvert_YMDHM_FromDate:realItem.expirationDate];
} else if ([[tableColumn identifier] isEqualToString:kColumnIdentifierCreateDate]) {
return realItem.creationDate;
return [[DateManager sharedManager] stringConvert_YMDHM_FromDate:realItem.creationDate];
}else if ([[tableColumn identifier] isEqualToString:kColumnIdentifierCreateDays]) {
return realItem.days;
}
return @"";
}
Expand Down Expand Up @@ -199,20 +205,6 @@ - (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArr
sortedArray = [currChildren sortedArrayUsingDescriptors:@[sortDescriptor]];
_rootNode.childrenNodes = sortedArray;
[outlineView reloadData];
// NSSortDescriptor *sortDescriptor;
//
// NSString *key=[[[outlineView sortDescriptors] objectAtIndex:0] key];
// BOOL isAscending=[[[outlineView sortDescriptors] objectAtIndex:0] ascending];
//
// sortDescriptor = [[NSSortDescriptor alloc] initWithKey:key ascending:isAscending] ;
// NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
// NSArray *sortedArray;
//
// NSMutableArray *currChildren= [_rootNode.childrenNodes mutableCopy];
// sortedArray = [currChildren sortedArrayUsingDescriptors:sortDescriptors];
// _rootNode.childrenNodes = sortedArray;
// [outlineView reloadData];
//}
}

- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
Expand Down
51 changes: 32 additions & 19 deletions ProfilesManager/Controller/ProfilesManagerViewController.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -16,25 +16,25 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="1000" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="1030" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bQP-D8-T2r">
<rect key="frame" x="0.0" y="20" width="1000" height="580"/>
<rect key="frame" x="0.0" y="20" width="1030" height="580"/>
<clipView key="contentView" drawsBackground="NO" id="O7w-RX-5YA">
<rect key="frame" x="1" y="0.0" width="998" height="564"/>
<rect key="frame" x="1" y="0.0" width="1028" height="564"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<outlineView appearanceType="vibrantLight" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" headerView="Ygp-i7-VyR" indentationPerLevel="16" outlineTableColumn="FkK-IV-RHo" id="3ki-mw-HE6" customClass="DragOutlineView">
<rect key="frame" x="0.0" y="0.0" width="1009" height="541"/>
<autoresizingMask key="autoresizingMask"/>
<rect key="frame" x="0.0" y="0.0" width="1029" height="541"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="5"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="key" width="245" minWidth="40" maxWidth="400" id="FkK-IV-RHo">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Filename or Key">
<font key="font" metaFont="smallSystem"/>
<tableColumn identifier="key" width="231" minWidth="40" maxWidth="500" id="FkK-IV-RHo">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="AppID">
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand All @@ -45,9 +45,9 @@
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
<tableColumn identifier="type" width="229" minWidth="140" maxWidth="280" id="ggW-Oi-DM3" userLabel="type">
<tableColumn identifier="type" width="210" minWidth="140" maxWidth="800" id="ggW-Oi-DM3" userLabel="type">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Name or Type">
<font key="font" metaFont="smallSystem"/>
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand All @@ -60,7 +60,7 @@
</tableColumn>
<tableColumn identifier="detail" width="250" minWidth="40" maxWidth="3.4028234663852886e+38" id="4N6-rc-Q65" userLabel="detail">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Status or Detail">
<font key="font" metaFont="smallSystem"/>
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand All @@ -73,7 +73,7 @@
</tableColumn>
<tableColumn identifier="creationDate" width="135" minWidth="135" maxWidth="135" id="PQW-JJ-FJD" userLabel="creationDate">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="CreateDate">
<font key="font" metaFont="smallSystem"/>
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand All @@ -86,7 +86,7 @@
</tableColumn>
<tableColumn identifier="expirationDate" width="135" minWidth="135" maxWidth="135" id="Mf9-vb-Si1" userLabel="expirationDate">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="ExpirationDate">
<font key="font" metaFont="smallSystem"/>
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
Expand All @@ -97,6 +97,19 @@
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
<tableColumn identifier="days" width="50" minWidth="50" maxWidth="50" id="cc0-py-mUm" userLabel="days">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Days">
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="NY6-K3-edK">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
</tableColumns>
<connections>
<outlet property="dataSource" destination="-2" id="x0y-Ur-KhI"/>
Expand All @@ -107,20 +120,20 @@
<nil key="backgroundColor"/>
</clipView>
<scroller key="horizontalScroller" verticalHuggingPriority="750" horizontal="YES" id="94R-Le-I0r">
<rect key="frame" x="1" y="564" width="998" height="15"/>
<rect key="frame" x="1" y="564" width="1028" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="Rib-nd-9D3">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="Ygp-i7-VyR">
<rect key="frame" x="0.0" y="0.0" width="1009" height="23"/>
<rect key="frame" x="0.0" y="0.0" width="1029" height="23"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BLd-8B-ILm">
<rect key="frame" x="-2" y="0.0" width="1004" height="20"/>
<rect key="frame" x="-2" y="0.0" width="1034" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="er9-nR-EZ2"/>
</constraints>
Expand All @@ -140,7 +153,7 @@
<constraint firstItem="bQP-D8-T2r" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="vgB-2e-9d7"/>
<constraint firstAttribute="trailing" secondItem="BLd-8B-ILm" secondAttribute="trailing" id="yR6-dQ-hTF"/>
</constraints>
<point key="canvasLocation" x="168.5" y="534"/>
<point key="canvasLocation" x="280" y="536"/>
</customView>
</objects>
</document>
7 changes: 4 additions & 3 deletions ProfilesManager/Model/ProfilesNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
@property (nonatomic, copy)NSString *uuid;
@property (nonatomic, copy)NSString *filePath;
@property (nonatomic, strong)NSDictionary *extra;
@property (nonatomic, copy)NSString *expirationDate;
@property (nonatomic, copy)NSString *creationDate;

@property (nonatomic, strong)NSDate *expirationDate;
@property (nonatomic, strong)NSDate *creationDate;

@property (nonatomic, copy)NSString *days;
- (id)initWithRootNode:(ProfilesNode *)rootNote originInfo:(id)info key:(NSString*)key;

@end
Loading

0 comments on commit 26bc1ed

Please sign in to comment.