Skip to content

Commit

Permalink
1.1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
wstyres committed May 26, 2021
1 parent cc5f70e commit cd2eb95
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 90 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,27 @@ jobs:
- name: Clone gh-pages
run: |
git clone -b gh-pages https://${{ github.repository_owner }}:${{ github.token }}@github.com/wstyres/Zebra.git ~/website
git clone -b gh-pages https://${{ github.repository_owner }}:${{ github.token }}@github.com/zbrateam/Safari.git ~/website
- name: Move package to repo
if: "!github.event.release.prerelease"
run: |
mkdir ~/website/repo/newpackages
cd packages
fn=$(ls -t | head -n1)
echo $fn
mv -f -- "$fn" ~/website/repo/newpackages
mv -f -- "$fn" ~/website/repo/pool
- name: Move package to beta repo
if: "github.event.release.prerelease"
run: |
mkdir ~/website/beta/newpackages
cd packages
fn=$(ls -t | head -n1)
echo $fn
mv -f -- "$fn" ~/website/beta/newpackages
mv -f -- "$fn" ~/website/beta/pool
- name: Push repo
if: "!github.event.release.prerelease"
run: |
cd ~/website
chmod +x repo_update.sh
./repo_update.sh
run: git push
- name: Push beta repo
if: "github.event.release.prerelease"
run: |
cd ~/website
chmod +x beta_update.sh
./beta_update.sh
run: git push

- name: Attach package to release
if: "!github.event.release.prerelease"
Expand Down
4 changes: 2 additions & 2 deletions Zebra.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.18;
MARKETING_VERSION = 1.1.19;
OTHER_LDFLAGS = "-ObjC";
PACKAGE_VERSION = "'@\"$(MARKETING_VERSION)\"'";
PRODUCT_BUNDLE_IDENTIFIER = xyz.willy.Zebra;
Expand Down Expand Up @@ -1702,7 +1702,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.18;
MARKETING_VERSION = 1.1.19;
OTHER_LDFLAGS = "-ObjC";
PACKAGE_VERSION = "'@\"$(MARKETING_VERSION)\"'";
PRODUCT_BUNDLE_IDENTIFIER = xyz.willy.Zebra;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#import <Console/ZBConsoleCommandDelegate.h>

@import SafariServices;
@import MessageUI;

#import <MessageUI/MessageUI.h>

@class ZBPackage;

Expand Down
146 changes: 73 additions & 73 deletions Zebra/Tabs/Sources/Controllers/ZBSourceListTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (void)viewDidLoad {
[self.tableView registerNib:[UINib nibWithNibName:@"ZBSourceTableViewCell" bundle:nil] forCellReuseIdentifier:@"sourceTableViewCell"];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(delewhoop:) name:@"deleteSourceTouchAction" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkClipboard) name:UIApplicationWillEnterForegroundNotification object:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkClipboard) name:UIApplicationWillEnterForegroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshTable) name:@"ZBDatabaseCompletedUpdate" object:nil];

[self refreshTable];
Expand All @@ -74,11 +74,11 @@ - (void)viewWillAppear:(BOOL)animated {
[self.tableView reloadData];
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self checkClipboard];
}
//- (void)viewDidAppear:(BOOL)animated {
// [super viewDidAppear:animated];
//
// [self checkClipboard];
//}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"ZBDatabaseCompletedUpdate" object:nil];
Expand Down Expand Up @@ -306,73 +306,73 @@ - (void)layoutNavigationButtonsNormal {

#pragma mark - Clipboard

- (void)checkClipboard {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSURL *url = [NSURL URLWithString:pasteboard.string];
BOOL isValidURL = url && [NSURLConnection canHandleRequest:[NSURLRequest requestWithURL:url]];
if (!isValidURL) {
return;
}
NSArray *urlBlacklist = @[@"www.youtube.com", @"youtube.com",
@"www.youtu.be", @"youtu.be",
@"www.google.com", @"google.com",
@"www.goo.gl", @"goo.gl",
@"www.reddit.com", @"reddit.com",
@"www.twitter.com", @"twitter.com",
@"www.facebook.com", @"facebook.com",
@"www.imgur.com", @"imgur.com",
@"www.discord.com", @"discord.com",
@"www.discord.gg", @"discord.gg",
@"www.apple.com", @"apple.com",
@"share.icloud.com", @"icloud.com",
@"www.gmail.com", @"gmail.com",
@"www.pastebin.com", @"pastebin.com",
@"www.tinyurl.com", @"tinyurl.com",
@"www.bit.ly", @"bit.ly"];

if (![urlBlacklist containsObject:url.host]) {
NSMutableArray *sources = [NSMutableArray new];
for (ZBSource *source in [self.databaseManager sources]) {
NSString *host = [[NSURL URLWithString:source.repositoryURI] host];
if (host) {
[sources addObject:host];
}
}
if (![sources containsObject:url]) {
NSString *finalURLString = url.absoluteString;
if (![finalURLString hasSuffix:@"/"]) {
finalURLString = [finalURLString stringByAppendingString:@"/"];
}
NSURL *finalURL = [NSURL URLWithString:finalURLString];
ZBBaseSource *baseSource = [[ZBBaseSource alloc] initFromURL:finalURL];
if (baseSource) {
[baseSource verify:^(ZBSourceVerificationStatus status) {
if (status == ZBSourceExists) {
if (!self->askedToAddFromClipboard || ![self->lastPaste isEqualToString:pasteboard.string]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self showAddSourceFromClipboardAlert:baseSource];
});
}
self->askedToAddFromClipboard = YES;
self->lastPaste = pasteboard.string;
}
}];
}
}
}
}

- (void)showAddSourceFromClipboardAlert:(ZBBaseSource *)baseSource {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Would you like to add the URL from your clipboard?", @"") message:baseSource.repositoryURI preferredStyle:UIAlertControllerStyleAlert];
alertController.view.tintColor = [UIColor accentColor];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"No", @"") style:UIAlertActionStyleCancel handler:nil]];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Yes", @"") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self verifyAndAdd:[NSSet setWithObject:baseSource]];
}]];
[self presentViewController:alertController animated:YES completion:nil];
}
//- (void)checkClipboard {
// UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
// NSURL *url = [NSURL URLWithString:pasteboard.string];
// BOOL isValidURL = url && [NSURLConnection canHandleRequest:[NSURLRequest requestWithURL:url]];
// if (!isValidURL) {
// return;
// }
// NSArray *urlBlacklist = @[@"www.youtube.com", @"youtube.com",
// @"www.youtu.be", @"youtu.be",
// @"www.google.com", @"google.com",
// @"www.goo.gl", @"goo.gl",
// @"www.reddit.com", @"reddit.com",
// @"www.twitter.com", @"twitter.com",
// @"www.facebook.com", @"facebook.com",
// @"www.imgur.com", @"imgur.com",
// @"www.discord.com", @"discord.com",
// @"www.discord.gg", @"discord.gg",
// @"www.apple.com", @"apple.com",
// @"share.icloud.com", @"icloud.com",
// @"www.gmail.com", @"gmail.com",
// @"www.pastebin.com", @"pastebin.com",
// @"www.tinyurl.com", @"tinyurl.com",
// @"www.bit.ly", @"bit.ly"];
//
// if (![urlBlacklist containsObject:url.host]) {
// NSMutableArray *sources = [NSMutableArray new];
// for (ZBSource *source in [self.databaseManager sources]) {
// NSString *host = [[NSURL URLWithString:source.repositoryURI] host];
// if (host) {
// [sources addObject:host];
// }
// }
// if (![sources containsObject:url]) {
// NSString *finalURLString = url.absoluteString;
// if (![finalURLString hasSuffix:@"/"]) {
// finalURLString = [finalURLString stringByAppendingString:@"/"];
// }
// NSURL *finalURL = [NSURL URLWithString:finalURLString];
// ZBBaseSource *baseSource = [[ZBBaseSource alloc] initFromURL:finalURL];
// if (baseSource) {
// [baseSource verify:^(ZBSourceVerificationStatus status) {
// if (status == ZBSourceExists) {
// if (!self->askedToAddFromClipboard || ![self->lastPaste isEqualToString:pasteboard.string]) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [self showAddSourceFromClipboardAlert:baseSource];
// });
// }
// self->askedToAddFromClipboard = YES;
// self->lastPaste = pasteboard.string;
// }
// }];
// }
// }
// }
//}
//
//- (void)showAddSourceFromClipboardAlert:(ZBBaseSource *)baseSource {
// UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Would you like to add the URL from your clipboard?", @"") message:baseSource.repositoryURI preferredStyle:UIAlertControllerStyleAlert];
// alertController.view.tintColor = [UIColor accentColor];
//
// [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"No", @"") style:UIAlertActionStyleCancel handler:nil]];
// [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Yes", @"") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
// [self verifyAndAdd:[NSSet setWithObject:baseSource]];
// }]];
//
// [self presentViewController:alertController animated:YES completion:nil];
//}

#pragma mark - Adding a Source

Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: xyz.willy.zebra
Name: Zebra
Version: 1.1.18
Version: 1.1.19
Architecture: iphoneos-arm
Depends: dpkg, uikittools, firmware (>= 9.0)
Description: A Useful Package Manager
Expand Down

0 comments on commit cd2eb95

Please sign in to comment.