diff --git a/ooniprobe/Test/Test/AbstractTest.h b/ooniprobe/Test/Test/AbstractTest.h index 514aeb45..48625f61 100644 --- a/ooniprobe/Test/Test/AbstractTest.h +++ b/ooniprobe/Test/Test/AbstractTest.h @@ -31,6 +31,8 @@ @property id task; @property BOOL storeDB; @property BOOL autoRun; +@property NSString *runId; + @property BOOL isPreparing; -(id)initTest:(NSString*)testName; diff --git a/ooniprobe/Test/Test/AbstractTest.m b/ooniprobe/Test/Test/AbstractTest.m index 5436cfb6..fde3cae7 100644 --- a/ooniprobe/Test/Test/AbstractTest.m +++ b/ooniprobe/Test/Test/AbstractTest.m @@ -57,6 +57,7 @@ - (Measurement*)createMeasurementObject{ -(void)prepareRun{ self.settings = [Settings new]; + self.settings.annotations[@"ooni_run_link_id"] = self.runId; if (self.autoRun) { self.settings.annotations[@"origin"] = @"autorun"; self.settings.options.software_name = [NSString stringWithFormat:@"%@%@",SOFTWARE_NAME,@"-unattended"]; diff --git a/ooniprobe/View/OONIRun/OoniRunViewController.h b/ooniprobe/View/OONIRun/OoniRunViewController.h index 09372c28..d001c9b6 100644 --- a/ooniprobe/View/OONIRun/OoniRunViewController.h +++ b/ooniprobe/View/OONIRun/OoniRunViewController.h @@ -16,6 +16,8 @@ @property (nonatomic, strong) IBOutlet RunButton *runButton; @property (nonatomic, retain) NSString *testName; + +@property (nonatomic, retain) NSString *runId; @property (nonatomic, retain) NSDictionary *testArguments; @property (nonatomic, retain) NSString *testDescription; diff --git a/ooniprobe/View/OONIRun/OoniRunViewController.m b/ooniprobe/View/OONIRun/OoniRunViewController.m index 3e18b2b4..635908a0 100644 --- a/ooniprobe/View/OONIRun/OoniRunViewController.m +++ b/ooniprobe/View/OONIRun/OoniRunViewController.m @@ -68,8 +68,12 @@ -(void)handleUrlScheme{ if ([self checkMv:parameters]) { if ([parameters objectForKey:@"tn"] && [TestUtility getCategoryForTest:[parameters objectForKey:@"tn"]]) { [self setTestName:[parameters objectForKey:@"tn"]]; - if ([parameters objectForKey:@"ta"]) + if ([parameters objectForKey:@"ta"]) { [self setTestArguments:[parameters objectForKey:@"ta"]]; + } + if ([parameters objectForKey:@"runId"]) { + [self setRunId:[parameters objectForKey:@"runId"]]; + } [self showTestScreen]; } else { [self showErrorScreen]; @@ -275,6 +279,7 @@ -(IBAction)runTest { AbstractSuite *testSuite = [[AbstractSuite alloc] initSuite:testSuiteName]; AbstractTest *test = [[AbstractTest alloc] initTest:testName]; [test setAnnotation:YES]; + [test setRunId:self.runId]; [testSuite setTestList:[NSMutableArray arrayWithObject:test]]; if ([testSuiteName isEqualToString:@"websites"] && [urls count] > 0) [(WebConnectivity*)test setInputs:urls]; diff --git a/ooniprobe/View/TestResults/Footer/TestDetailsFooterViewController.m b/ooniprobe/View/TestResults/Footer/TestDetailsFooterViewController.m index 1344d8a7..ef5b5dca 100644 --- a/ooniprobe/View/TestResults/Footer/TestDetailsFooterViewController.m +++ b/ooniprobe/View/TestResults/Footer/TestDetailsFooterViewController.m @@ -65,7 +65,8 @@ - (void)viewDidLoad { -(IBAction)openExplorerUrl:(id)sender{ NSString *url = [self getExplorerUrl]; if (url != nil) - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url] options:@{} completionHandler:nil]; + } -(NSString*)getExplorerUrl{