Changeset 3b38f5a for launchers


Ignore:
Timestamp:
Sep 22, 2018 10:13:40 PM (2 years ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
7a72049
Parents:
829eb665
Message:

Mac OS X Launcher:

  • In general bugfixes
  • Introduced event manager for better control flow
  • Splitted RouterStatusView? to own file
  • Added shell script to setup and produce dmg file
Location:
launchers/macosx
Files:
4 added
12 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/I2PLauncher.xcodeproj/project.pbxproj

    r829eb665 r3b38f5a  
    4444                BFBDCB02215060190014EB07 /* DetectJava.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBDCB01215060190014EB07 /* DetectJava.swift */; };
    4545                BFBDCB04215060970014EB07 /* StatusBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBDCB03215060970014EB07 /* StatusBarController.swift */; };
     46                BFDD81DA2156B3E30014EB07 /* RouterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDD81D92156B3E30014EB07 /* RouterManager.swift */; };
     47                BFE16BF82156C61E0014EB07 /* RouterStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE16BF72156C61E0014EB07 /* RouterStatusView.swift */; };
     48                BFE16BFA2156DAED0014EB07 /* EventManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE16BF92156DAED0014EB07 /* EventManager.swift */; };
    4649                BFE1CBAD2151908F0014EB07 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFE1CBAC2151908F0014EB07 /* CoreFoundation.framework */; };
    4750                BFF4581C213C48EA0014EB07 /* EventMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF4581B213C48EA0014EB07 /* EventMonitor.swift */; };
     
    9598                BFBDCB01215060190014EB07 /* DetectJava.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetectJava.swift; sourceTree = "<group>"; };
    9699                BFBDCB03215060970014EB07 /* StatusBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBarController.swift; sourceTree = "<group>"; };
     100                BFDD81D92156B3E30014EB07 /* RouterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouterManager.swift; sourceTree = "<group>"; };
     101                BFE16BF72156C61E0014EB07 /* RouterStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouterStatusView.swift; sourceTree = "<group>"; };
     102                BFE16BF92156DAED0014EB07 /* EventManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventManager.swift; sourceTree = "<group>"; };
     103                BFE16BFB2156E94E0014EB07 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ../../../Sparkle/build/Release/Sparkle.framework; sourceTree = "<group>"; };
    97104                BFE1CBAC2151908F0014EB07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
    98105                BFF45818213C428E0014EB07 /* I2PLauncher-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "I2PLauncher-Bridging-Header.h"; sourceTree = "<group>"; };
     
    135142                                BFBDCB03215060970014EB07 /* StatusBarController.swift */,
    136143                                BF531514215105B40014EB07 /* LogViewController.swift */,
     144                                BFE16BF72156C61E0014EB07 /* RouterStatusView.swift */,
    137145                        );
    138146                        path = userinterface;
     
    192200                        isa = PBXGroup;
    193201                        children = (
     202                                BFE16BFB2156E94E0014EB07 /* Sparkle.framework */,
    194203                                BFE1CBAC2151908F0014EB07 /* CoreFoundation.framework */,
    195204                                BF865416215182820014EB07 /* Foundation.framework */,
     
    210219                                BF5315082150C6760014EB07 /* RouterDeployer.swift */,
    211220                                BF53150A2150C6E80014EB07 /* I2PSubprocess.swift */,
     221                                BFDD81D92156B3E30014EB07 /* RouterManager.swift */,
    212222                        );
    213223                        path = routermgmt;
     
    222232                                BFBDCAF7215047FE0014EB07 /* ArrayExtensions.swift */,
    223233                                BF53150C2150CE310014EB07 /* DateTimeUtils.swift */,
     234                                BFE16BF92156DAED0014EB07 /* EventManager.swift */,
    224235                        );
    225236                        path = Utils;
     
    335346                                BFBDCAF8215047FE0014EB07 /* ArrayExtensions.swift in Sources */,
    336347                                BF5315072150C55B0014EB07 /* RouterRunner.swift in Sources */,
     348                                BFE16BFA2156DAED0014EB07 /* EventManager.swift in Sources */,
    337349                                BFBDCAF12150420C0014EB07 /* ExecutionResult.swift in Sources */,
    338350                                BF5315092150C6760014EB07 /* RouterDeployer.swift in Sources */,
     351                                BFE16BF82156C61E0014EB07 /* RouterStatusView.swift in Sources */,
    339352                                BFBDCAEF215041E30014EB07 /* Error.swift in Sources */,
    340353                                BF1EFA41215141110014EB07 /* RouterTask.mm in Sources */,
     
    351364                                BF5315132150EB510014EB07 /* RouterProcessStatus+ObjectiveC.swift in Sources */,
    352365                                BFBDCAFE2150567D0014EB07 /* SwiftMainDelegate.swift in Sources */,
     366                                BFDD81DA2156B3E30014EB07 /* RouterManager.swift in Sources */,
    353367                                BF53150B2150C6E80014EB07 /* I2PSubprocess.swift in Sources */,
    354368                                BFF4581C213C48EA0014EB07 /* EventMonitor.swift in Sources */,
  • launchers/macosx/I2PLauncher/SwiftMainDelegate.swift

    r829eb665 r3b38f5a  
    1212@objc class SwiftMainDelegate : NSObject {
    1313 
    14   //let statusItem = NSStatusBar.system().statusItem(withLength: NSSquareStatusItemLength )
    1514  let statusBarController = StatusBarController()
     15  let sharedRouterMgmr = RouterManager.shared()
    1616  static let javaDetector = DetectJava()
    17   static let objCBridge = SBridge()
    1817 
    1918  override init() {
     
    3837      RouterProcessStatus.isRouterRunning = false
    3938      print("I2P Router seems to NOT be running")
    40      
    4139    }
    42    
    43    
    4440  } // End of init()
    4541 
     
    6460    let results:ExecutionResult = sub.execute(captureOutput: true)!
    6561    if (results.didCaptureOutput) {
    66       print("captured output")
    6762      let i2pVersion = results.outputLines.first?.replace(target: "I2P Core version: ", withString: "")
    6863      NSLog("I2P version detected: %@",i2pVersion ?? "Unknown")
    6964      RouterProcessStatus.routerVersion = i2pVersion
     65      RouterManager.shared().eventManager.trigger(eventName: "router_version", information: i2pVersion)
    7066    } else {
    71       print("did NOT captured output")
    72      
     67      print("Warning: Version Detection did NOT captured output")
    7368    }
    7469  }
     
    7974    i2pPath += "/Library/I2P"
    8075   
    81     let fileManager = FileManager()
    82     var ok = ObjCBool(true)
    83     let doesI2PDirExists = fileManager.fileExists(atPath: i2pPath, isDirectory: &ok)
    84    
    85     if (!doesI2PDirExists) {
    86       // Deploy
    87     }
    88    
    89     //let i2pJarPath = i2pPath + "/lib/i2p.jar"
    90    
    9176    findInstalledI2PVersion()
    9277  }
    9378 
    9479  @objc static func openLink(url: String) {
    95     objCBridge.openUrl(url)
     80    SBridge.sharedInstance().openUrl(url)
    9681  }
    9782 
  • launchers/macosx/I2PLauncher/routermgmt/RouterProcessStatus+ObjectiveC.swift

    r829eb665 r3b38f5a  
    1010
    1111extension RouterProcessStatus {
     12 
    1213  static func createNewRouterProcess(i2pPath: String, javaBinPath: String) {
    13     let bridge = SBridge()
    1414    let timeWhenStarted = Date()
    1515    RouterProcessStatus.routerStartedAt = timeWhenStarted
    16     bridge.startupI2PRouter(i2pPath, javaBinPath: javaBinPath)
     16    SBridge.sharedInstance().startupI2PRouter(i2pPath, javaBinPath: javaBinPath)
     17    RouterManager.shared().updateState()
     18  }
     19  static func shutdownRouterChildProcess() {
     20    RouterManager.shared().getRouterTask()?.requestShutdown()
     21    RouterManager.shared().updateState()
    1722  }
    1823}
  • launchers/macosx/I2PLauncher/routermgmt/RouterProcessStatus.swift

    r829eb665 r3b38f5a  
    3232  @objc func getJavaHome() -> String {
    3333    return RouterProcessStatus.knownJavaBinPath!
     34  }
     35 
     36  @objc func triggerEvent(en: String, details: String? = nil) {
     37    RouterManager.shared().eventManager.trigger(eventName: en, information: details)
    3438  }
    3539}
  • launchers/macosx/I2PLauncher/userinterface/LogViewController.swift

    r829eb665 r3b38f5a  
    1515  @IBOutlet var textFieldView: NSTextView?
    1616 
     17  private var outputPipe : Pipe?
     18 
     19  override init(identifier: Any?) {
     20    super.init(identifier: identifier)
     21    self.captureStandardOutputAndRouteToTextView()
     22  }
     23 
     24  required init?(coder aDecoder: NSCoder) {
     25    super.init(coder: aDecoder)
     26    self.captureStandardOutputAndRouteToTextView()
     27  }
     28 
     29 
     30  func captureStandardOutputAndRouteToTextView() {
     31    outputPipe = RouterManager.shared().getRouterTask()?.processPipe
     32    outputPipe?.fileHandleForReading.waitForDataInBackgroundAndNotify()
     33   
     34    NotificationCenter.default.addObserver(forName: NSNotification.Name.NSFileHandleDataAvailable, object: outputPipe?.fileHandleForReading , queue: nil) {
     35      notification in
    1736
    18  
     37      let output = self.outputPipe?.fileHandleForReading.availableData
     38      let outputString = String(data: output!, encoding: String.Encoding.utf8) ?? ""
     39     
     40      DispatchQueue.main.async(execute: {
     41        let previousOutput = self.textFieldView?.string ?? ""
     42        let nextOutput = previousOutput + "\n" + outputString
     43        self.textFieldView?.string = nextOutput
     44       
     45        let range = NSRange(location:nextOutput.characters.count,length:0)
     46        self.textFieldView?.scrollRangeToVisible(range)
     47       
     48      })
     49     
     50      self.outputPipe?.fileHandleForReading.waitForDataInBackgroundAndNotify()
     51    }
     52   
     53  }
    1954}
    2055
    21 class LogViewController {
    22  
    23 }
    2456
  • launchers/macosx/I2PLauncher/userinterface/PopoverViewController.swift

    r829eb665 r3b38f5a  
    1313  required init?(coder: NSCoder) {
    1414    super.init(coder: coder)
    15     //super.init(nibName: "UserInterfaces", bundle: Bundle.main)!
    16     //let nib = NSNib(nibNamed: "UserInterfaces", bundle: Bundle.main)
    17    
    1815  }
    1916 
     
    2320    // Do view setup here.
    2421  }
    25  
    26  
    27  
    28 }
    29 
    30 @objc class RouterStatusView : NSView {
    31   static var instance: RouterStatusView?
    32  
    33   static func getInstance() -> RouterStatusView? {
    34     if (self.instance != Optional.none) {
    35       return RouterStatusView.instance
    36     }
    37     return Optional.none
    38   }
    39  
    40   @IBOutlet var routerStatusLabel: NSTextField?
    41   @IBOutlet var routerVersionLabel: NSTextField?
    42   @IBOutlet var routerStartedByLabel: NSTextField?
    43   @IBOutlet var routerUptimeLabel: NSTextField?
    44  
    45   @IBOutlet var quickControlView: NSView?
    46   @IBOutlet var routerStartStopButton: NSButton?
    47  
    48  
    49   @objc func actionBtnStartRouter(_ sender: Any?) {
    50     NSLog("START ROUTER")
    51     (sender as! NSButton).cell?.stringValue = "Stop Router"
    52     let timeWhenStarted = Date()
    53     RouterProcessStatus.routerStartedAt = timeWhenStarted
    54     SwiftMainDelegate.objCBridge.startupI2PRouter(RouterProcessStatus.i2pDirectoryPath, javaBinPath: RouterProcessStatus.knownJavaBinPath!)
    55   }
    56   @objc func actionBtnStopRouter(_ sender: Any?) {
    57     NSLog("STOP ROUTER")
    58   }
    59   @objc func actionBtnRestartRouter(sender: Any?) {}
    60  
    61   override func viewWillDraw() {
    62     super.viewWillDraw()
    63     if (RouterStatusView.instance != nil) {
    64       RouterStatusView.instance = self
    65     }
    66     self.setRouterStatusLabelText()
    67   }
    68  
    69   func setRouterStatusLabelText() {
    70     if (RouterProcessStatus.isRouterRunning) {
    71       routerStatusLabel?.cell?.stringValue = "Router status: Running"
    72       routerStartStopButton?.action = #selector(self.actionBtnStopRouter(_:))
    73     } else {
    74       routerStatusLabel?.cell?.stringValue = "Router status: Not running"
    75       routerStartStopButton?.action = #selector(self.actionBtnStartRouter(_:))
    76     }
    77     routerStartStopButton?.needsDisplay = true
    78     routerStartStopButton?.target = self
    79     quickControlView?.needsDisplay = true
    80    
    81     if let version = RouterProcessStatus.routerVersion {
    82       routerVersionLabel?.cell?.stringValue = "Router version: " + version
    83     } else {
    84       routerVersionLabel?.cell?.stringValue = "Router version: Still unknown"
    85     }
    86     if let routerStartTime = RouterProcessStatus.routerStartedAt {
    87       routerUptimeLabel?.cell?.stringValue = "Router has runned for " + DateTimeUtils.timeAgoSinceDate(date: NSDate(date: routerStartTime), numericDates: false)
    88     }
    89   }
    90  
    91   init() {
    92     let c = NSCoder()
    93     super.init(coder: c)!
    94     self.setRouterStatusLabelText()
    95   }
    96  
    97   required init?(coder decoder: NSCoder) {
    98     super.init(coder: decoder)
    99     self.setRouterStatusLabelText()
    100   }
    101  
    10222}
    10323
  • launchers/macosx/I2PLauncher/userinterface/StatusBarController.swift

    r829eb665 r3b38f5a  
    2323  @objc func constructMenu() -> NSMenu {
    2424    let menu = NSMenu()
    25     //let sb = SwiftMainDelegate.objCBridge
    2625   
    2726    menu.addItem(NSMenuItem(title: "Open I2P Console", action: #selector(self.handleOpenConsole(_:)), keyEquivalent: "O"))
     
    3433 
    3534  override init() {
    36     super.init()//(xib: "UserInterface", bundle: nil)
     35    super.init()
    3736    popover.contentViewController = PopoverViewController.freshController()
    3837   
    3938    if let button = statusItem.button {
    4039      button.image = NSImage(named:"StatusBarButtonImage")
    41       //button.title = "I2P"
    4240      button.toolTip = "I2P Launch Manager"
    43       //button.isVisible = true
    44       //button.action = #selector(self.statusBarButtonClicked)
    45       //button.sendAction(on: [.leftMouseUp, .rightMouseUp])
    46       //button.doubleAction = #selector(self.systemBarIconDoubleClick)
    4741      button.target = self
    4842      button.action = #selector(self.statusBarButtonClicked(sender:))
     
    9892      closePopover(sender: sender)
    9993    } else {
     94      RouterManager.shared().updateState()
    10095      showPopover(sender: sender)
    10196    }
  • launchers/macosx/RouterTask.h

    r829eb665 r3b38f5a  
    4040@interface I2PRouterTask : NSObject
    4141@property (strong) NSTask* routerTask;
     42
     43// TODO: Not in use, remove?
     44/*
    4245@property (strong) NSUserDefaults *userPreferences;
    4346@property (strong) NSFileHandle *readLogHandle;
    4447@property (strong) NSMutableData *totalLogData;
     48@property (strong) NSFileHandle *input;
     49*/
     50
    4551@property (strong) NSPipe *processPipe;
    46 @property (strong) NSFileHandle *input;
    4752@property (atomic) BOOL isRouterRunning;
    4853@property (atomic) BOOL userRequestedRestart;
  • launchers/macosx/RouterTask.mm

    r829eb665 r3b38f5a  
    3232  self.userRequestedRestart = NO;
    3333  self.isRouterRunning = NO;
    34   self.input = [NSFileHandle fileHandleWithStandardInput];
     34  //self.input = [NSFileHandle fileHandleWithStandardInput];
    3535  self.routerTask = [NSTask new];
    3636  self.processPipe = [NSPipe new];
     
    4545        [self.routerTask setStandardError:self.processPipe];
    4646
    47     NSFileHandle *stdoutFileHandle = [self.processPipe fileHandleForReading];
    48     [[NSNotificationCenter defaultCenter] addObserver:self
    49         selector:@selector(routerStdoutData:)
    50         name:NSFileHandleDataAvailableNotification
    51         object:stdoutFileHandle];
     47  /*
     48  NSFileHandle *stdoutFileHandle = [self.processPipe fileHandleForReading];
     49  dup2([[self.processPipe fileHandleForWriting] fileDescriptor], fileno(stdout));
     50  auto source = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, [stdoutFileHandle fileDescriptor], 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
     51  dispatch_source_set_event_handler(source, ^{
     52    void* data = malloc(4096);
     53    ssize_t readResult = 0;
     54    do
     55    {
     56      errno = 0;
     57      readResult = read([stdoutFileHandle fileDescriptor], data, 4096);
     58    } while (readResult == -1 && errno == EINTR);
     59    if (readResult > 0)
     60    {
     61      //AppKit UI should only be updated from the main thread
     62      dispatch_async(dispatch_get_main_queue(),^{
     63        NSString* stdOutString = [[NSString alloc] initWithBytesNoCopy:data length:readResult encoding:NSUTF8StringEncoding freeWhenDone:YES];
     64        NSAttributedString* stdOutAttributedString = [[NSAttributedString alloc] initWithString:stdOutString];
     65        NSLog(@"Router stdout: %@", stdOutString);
     66        //auto logForwarder = new LogForwarder();
     67        //[logForwarder appendLogViewWithLogLine:stdOutAttributedString];
     68      });
     69    }
     70    else{free(data);}
     71  });
     72  dispatch_resume(source);
     73  */
     74  /*
     75  [[NSNotificationCenter defaultCenter] addObserver:self
     76      selector:@selector(routerStdoutData:)
     77      name:NSFileHandleDataAvailableNotification
     78      object:stdoutFileHandle];
    5279
    5380  [stdoutFileHandle waitForDataInBackgroundAndNotify];
     81  */
    5482
    5583  [self.routerTask setTerminationHandler:^(NSTask* task) {
     
    5987    [swiftRouterStatus setRouterStatus: false];
    6088    [swiftRouterStatus setRouterRanByUs: false];
     89    [swiftRouterStatus triggerEventWithEn:@"router_stop" details:@"normal shutdown"];
     90    [[SBridge sharedInstance] setCurrentRouterInstance:nil];
    6191    sendUserNotification(APP_IDSTR, @"I2P Router has stopped");
    6292  }];
     
    83113{
    84114    @try {
     115      auto swiftRouterStatus = [[RouterProcessStatus alloc] init];
     116      [swiftRouterStatus triggerEventWithEn:@"router_start" details:@"normal start"];
    85117      [self.routerTask launch];
    86       watchPid([self.routerTask processIdentifier]);
    87118      self.isRouterRunning = YES;
    88119      return 1;
     
    92123                NSLog(@"Expection occurred %@", [e reason]);
    93124    auto swiftRouterStatus = [[RouterProcessStatus alloc] init];
     125    self.isRouterRunning = NO;
    94126    [swiftRouterStatus setRouterStatus: false];
    95127    [swiftRouterStatus setRouterRanByUs: false];
     128    [swiftRouterStatus triggerEventWithEn:@"router_stop" details:@"error shutdown"];
     129    [[SBridge sharedInstance] setCurrentRouterInstance:nil];
    96130    sendUserNotification(@"An error occured, can't start the I2P Router", [e reason]);
    97131    return 0;
  • launchers/macosx/SBridge.h

    r829eb665 r3b38f5a  
    99#import <Foundation/Foundation.h>
    1010#import <Cocoa/Cocoa.h>
     11
     12#import "RouterTask.h"
    1113
    1214#ifdef __cplusplus
     
    5557
    5658@interface SBridge : NSObject
     59@property (nonatomic, assign) I2PRouterTask* currentRouterInstance;
    5760- (NSString*) buildClassPath:(NSString*)i2pPath;
    5861- (void) startupI2PRouter:(NSString*)i2pRootPath javaBinPath:(NSString*)javaBinPath;
    5962- (void) openUrl:(NSString*)url;
     63+ (instancetype)sharedInstance; // this makes it a singleton
    6064@end
  • launchers/macosx/SBridge.mm

    r829eb665 r3b38f5a  
    3434    options.i2pBaseDir = i2pBaseDir;
    3535    auto instance = [[I2PRouterTask alloc] initWithOptions: options];
     36   
     37    [[SBridge sharedInstance] setCurrentRouterInstance:instance];
    3638    [instance execute];
    3739    sendUserNotification(APP_IDSTR, @"The I2P router is starting up.");
    3840    auto pid = [instance getPID];
     41    NSLog(@"Got pid: %d", pid);
     42   
     43    auto swiftRouterStatus = [[RouterProcessStatus alloc] init];
     44    [swiftRouterStatus triggerEventWithEn:@"router_pid" details:[NSString stringWithFormat:@"%d", pid]];
     45   
    3946    return std::async(std::launch::async, [&pid]{
    4047      return pid;
     
    4653    NSLog(@"%@", errStr);
    4754    sendUserNotification(APP_IDSTR, errStr);
     55    [[SBridge sharedInstance] setCurrentRouterInstance:nil];
     56   
     57    auto swiftRouterStatus = [[RouterProcessStatus alloc] init];
     58    [swiftRouterStatus setRouterStatus: false];
     59    [swiftRouterStatus setRouterRanByUs: false];
     60    [swiftRouterStatus triggerEventWithEn:@"router_exception" details:errStr];
     61   
    4862    return std::async(std::launch::async, [&]{
    4963      return 0;
     
    5670@implementation SBridge
    5771
     72// this makes it a singleton
     73+ (instancetype)sharedInstance {
     74  static SBridge *sharedInstance = nil;
     75  static dispatch_once_t onceToken;
     76 
     77  dispatch_once(&onceToken, ^{
     78    sharedInstance = [[SBridge alloc] init];
     79  });
     80  return sharedInstance;
     81}
    5882
    5983- (void) openUrl:(NSString*)url
     
    126150    [routerStatus setRouterStatus: false];
    127151    [routerStatus setRouterRanByUs: false];
     152    [routerStatus triggerEventWithEn:@"router_exception" details:[NSString stringWithFormat:@"Error: %@", errMsg]];
    128153  }
    129154}
  • launchers/macosx/main.mm

    r829eb665 r3b38f5a  
    205205
    206206  NSBundle *launcherBundle = [NSBundle mainBundle];
    207   auto sBridge = [[SBridge alloc] init];
    208207 
    209208  // Helper object to hold statefull path information
     
    238237      [self.swiftRuntime findInstalledI2PVersion];
    239238      if (shouldAutoStartRouter) {
    240         [sBridge startupI2PRouter:self.metaInfo.i2pBase javaBinPath:self.metaInfo.javaBinary];
     239        [[SBridge sharedInstance] startupI2PRouter:self.metaInfo.i2pBase javaBinPath:self.metaInfo.javaBinary];
    241240        [routerStatus setRouterRanByUs: true];
    242241      }
     
    249248   
    250249    if (shouldAutoStartRouter) {
    251       [sBridge startupI2PRouter:self.metaInfo.i2pBase javaBinPath:self.metaInfo.javaBinary];
     250      [[SBridge sharedInstance] startupI2PRouter:self.metaInfo.i2pBase javaBinPath:self.metaInfo.javaBinary];
    252251      [routerStatus setRouterRanByUs: true];
    253252    }
Note: See TracChangeset for help on using the changeset viewer.