summaryrefslogtreecommitdiffstats
path: root/QuickActions/QuickActionsPrefs/QASRootListController.m
diff options
context:
space:
mode:
Diffstat (limited to 'QuickActions/QuickActionsPrefs/QASRootListController.m')
-rw-r--r--QuickActions/QuickActionsPrefs/QASRootListController.m35
1 files changed, 35 insertions, 0 deletions
diff --git a/QuickActions/QuickActionsPrefs/QASRootListController.m b/QuickActions/QuickActionsPrefs/QASRootListController.m
index e781ab6..2fe7cb2 100644
--- a/QuickActions/QuickActionsPrefs/QASRootListController.m
+++ b/QuickActions/QuickActionsPrefs/QASRootListController.m
@@ -1,5 +1,22 @@
+/*
+ * Copyright (C) 2021 Cameron Katri
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
#import <Foundation/Foundation.h>
#import "QASRootListController.h"
+#include <spawn.h>
@implementation QASRootListController
@@ -12,9 +29,27 @@
return _specifiers;
}
+-(void)viewDidLoad
+{
+ [super viewDidLoad];
+ UIBarButtonItem *respringButton = [[UIBarButtonItem alloc] initWithTitle:@"Respring"
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(respring)];
+ respringButton.tintColor = [UIColor systemRedColor];
+ [self.navigationItem setRightBarButtonItem:respringButton];
+}
+
-(void)openSource
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://git.cameronkatri.com/tweaks/tree/QuickActions"] options:@{} completionHandler:nil];
}
+-(void)respring
+{
+ pid_t pid;
+ const char *args[] = {"sbreload", NULL, NULL, NULL};
+ posix_spawn(&pid, "usr/bin/sbreload", NULL, NULL, (char *const *)args, NULL);
+}
+
@end