Changeset e046418f for launchers


Ignore:
Timestamp:
Sep 19, 2018 5:00:17 PM (19 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
0f8a618
Parents:
802115e
Message:

Cleaning up the code base, remove dead code and failed attempts.

Location:
launchers/macosx
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/AppDelegate.h

    r802115e re046418f  
    55#include <string.h>
    66#include <memory.h>
     7
     8#ifdef __cplusplus
     9#include <unistd.h>
     10#include <sys/types.h>
     11#include <pwd.h>
     12#include <assert.h>
     13#endif
    714
    815#include <Cocoa/Cocoa.h>
     
    3643@property (copy) NSString* jarFile;
    3744@end
     45
     46
    3847#ifdef __cplusplus
    39 #include "JavaHelper.h"
     48
     49inline const char* RealHomeDirectory() {
     50  struct passwd *pw = getpwuid(getuid());
     51  assert(pw);
     52  return pw->pw_dir;
     53}
     54
     55inline std::string getDefaultBaseDir()
     56{
     57  // Figure out base directory
     58  auto homeDir = RealHomeDirectory();
     59  const char* pathFromHome = "%s/Library/I2P";
     60  char buffer[strlen(homeDir)+strlen(pathFromHome)];
     61  sprintf(buffer, pathFromHome, homeDir);
     62  std::string i2pBaseDir(buffer);
     63  return i2pBaseDir;
     64}
    4065
    4166inline void sendUserNotification(NSString* title, NSString* informativeText, NSImage* contentImage = NULL, bool makeSound = false) {
  • launchers/macosx/I2PLauncher.xcodeproj/project.pbxproj

    r802115e re046418f  
    44        classes = {
    55        };
    6         objectVersion = 50;
     6        objectVersion = 47;
    77        objects = {
    88
     
    1515                BF1EFA47215141640014EB07 /* base.zip in Resources */ = {isa = PBXBuildFile; fileRef = BF1EFA44215141630014EB07 /* base.zip */; };
    1616                BF1EFA48215141640014EB07 /* ItoopieTransparent.png in Resources */ = {isa = PBXBuildFile; fileRef = BF1EFA45215141640014EB07 /* ItoopieTransparent.png */; };
    17                 BF1EFA4A215141CD0014EB07 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF5061932113C6ED0014EB07 /* NetworkExtension.framework */; };
    1817                BF5061702113C48E0014EB07 /* I2PLauncher.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = BF50616E2113C48E0014EB07 /* I2PLauncher.xcdatamodeld */; };
    1918                BF5061722113C4900014EB07 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BF5061712113C4900014EB07 /* Assets.xcassets */; };
     
    2625                BF5315132150EB510014EB07 /* RouterProcessStatus+ObjectiveC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF5315122150EB510014EB07 /* RouterProcessStatus+ObjectiveC.swift */; };
    2726                BF531515215105B40014EB07 /* LogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF531514215105B40014EB07 /* LogViewController.swift */; };
     27                BF650CA92152AC7D0014EB07 /* bumpInfoPlist.sh in Resources */ = {isa = PBXBuildFile; fileRef = BF650CA52152AC7D0014EB07 /* bumpInfoPlist.sh */; };
     28                BF650CAA2152AC7D0014EB07 /* dmgconfig.py in Resources */ = {isa = PBXBuildFile; fileRef = BF650CA62152AC7D0014EB07 /* dmgconfig.py */; };
     29                BF650CAB2152AC7D0014EB07 /* Deployer.m in Sources */ = {isa = PBXBuildFile; fileRef = BF650CA72152AC7D0014EB07 /* Deployer.m */; };
    2830                BF7506CB21509CFD0014EB07 /* RouterProcessStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7506CA21509CFD0014EB07 /* RouterProcessStatus.swift */; };
     31                BF86541321515CA00014EB07 /* launcher.jar in Resources */ = {isa = PBXBuildFile; fileRef = BF1EFA46215141640014EB07 /* launcher.jar */; };
     32                BF865417215182820014EB07 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF865416215182820014EB07 /* Foundation.framework */; };
    2933                BFBDCAE9215040670014EB07 /* Subprocess.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBDCAE8215040670014EB07 /* Subprocess.swift */; };
    3034                BFBDCAEB215041630014EB07 /* TaskPipeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBDCAEA215041630014EB07 /* TaskPipeline.swift */; };
     
    4044                BFBDCB02215060190014EB07 /* DetectJava.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBDCB01215060190014EB07 /* DetectJava.swift */; };
    4145                BFBDCB04215060970014EB07 /* StatusBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBDCB03215060970014EB07 /* StatusBarController.swift */; };
     46                BFE1CBAD2151908F0014EB07 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFE1CBAC2151908F0014EB07 /* CoreFoundation.framework */; };
    4247                BFF4581C213C48EA0014EB07 /* EventMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF4581B213C48EA0014EB07 /* EventMonitor.swift */; };
    4348/* End PBXBuildFile section */
     
    6368                BF5061762113C4900014EB07 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
    6469                BF5061792113C4900014EB07 /* I2PLauncher.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = I2PLauncher.entitlements; sourceTree = "<group>"; };
    65                 BF5061932113C6ED0014EB07 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
    6670                BF5061952113C84E0014EB07 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
    6771                BF5315062150C55B0014EB07 /* RouterRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouterRunner.swift; sourceTree = "<group>"; };
     
    7175                BF5315122150EB510014EB07 /* RouterProcessStatus+ObjectiveC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RouterProcessStatus+ObjectiveC.swift"; sourceTree = "<group>"; };
    7276                BF531514215105B40014EB07 /* LogViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogViewController.swift; sourceTree = "<group>"; };
     77                BF650CA52152AC7D0014EB07 /* bumpInfoPlist.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = bumpInfoPlist.sh; sourceTree = SOURCE_ROOT; };
     78                BF650CA62152AC7D0014EB07 /* dmgconfig.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = dmgconfig.py; sourceTree = SOURCE_ROOT; };
     79                BF650CA72152AC7D0014EB07 /* Deployer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Deployer.m; sourceTree = SOURCE_ROOT; };
     80                BF650CA82152AC7D0014EB07 /* Deployer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Deployer.h; sourceTree = SOURCE_ROOT; };
    7381                BF7506CA21509CFD0014EB07 /* RouterProcessStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouterProcessStatus.swift; sourceTree = "<group>"; };
     82                BF865414215180F60014EB07 /* libswiftDarwin.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftDarwin.tbd; path = System/Library/PrivateFrameworks/Swift/libswiftDarwin.tbd; sourceTree = SDKROOT; };
     83                BF865416215182820014EB07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
    7484                BFBDCAE8215040670014EB07 /* Subprocess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Subprocess.swift; sourceTree = "<group>"; };
    7585                BFBDCAEA215041630014EB07 /* TaskPipeline.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskPipeline.swift; sourceTree = "<group>"; };
     
    8696                BFBDCB01215060190014EB07 /* DetectJava.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetectJava.swift; sourceTree = "<group>"; };
    8797                BFBDCB03215060970014EB07 /* StatusBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBarController.swift; sourceTree = "<group>"; };
     98                BFE1CBAC2151908F0014EB07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
    8899                BFF45818213C428E0014EB07 /* I2PLauncher-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "I2PLauncher-Bridging-Header.h"; sourceTree = "<group>"; };
    89100                BFF4581B213C48EA0014EB07 /* EventMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventMonitor.swift; sourceTree = "<group>"; };
     
    95106                        buildActionMask = 2147483647;
    96107                        files = (
    97                                 BF1EFA4A215141CD0014EB07 /* NetworkExtension.framework in Frameworks */,
     108                                BFE1CBAD2151908F0014EB07 /* CoreFoundation.framework in Frameworks */,
     109                                BF865417215182820014EB07 /* Foundation.framework in Frameworks */,
    98110                                BFBDCB0021505BEE0014EB07 /* AppKit.framework in Frameworks */,
    99111                                BF5061962113C84E0014EB07 /* Cocoa.framework in Frameworks */,
     
    151163                        isa = PBXGroup;
    152164                        children = (
     165                                BF650CA52152AC7D0014EB07 /* bumpInfoPlist.sh */,
     166                                BF650CA82152AC7D0014EB07 /* Deployer.h */,
     167                                BF650CA72152AC7D0014EB07 /* Deployer.m */,
     168                                BF650CA62152AC7D0014EB07 /* dmgconfig.py */,
    153169                                BF1EFA42215141220014EB07 /* include */,
    154170                                BF1EFA3F215141110014EB07 /* AppDelegate.h */,
     
    178194                        isa = PBXGroup;
    179195                        children = (
     196                                BFE1CBAC2151908F0014EB07 /* CoreFoundation.framework */,
     197                                BF865416215182820014EB07 /* Foundation.framework */,
     198                                BF865414215180F60014EB07 /* libswiftDarwin.tbd */,
    180199                                BFBDCAFF21505BED0014EB07 /* AppKit.framework */,
    181200                                BF5061952113C84E0014EB07 /* Cocoa.framework */,
    182                                 BF5061932113C6ED0014EB07 /* NetworkExtension.framework */,
    183201                        );
    184202                        name = Frameworks;
     
    237255                        isa = PBXProject;
    238256                        attributes = {
    239                                 LastUpgradeCheck = 0940;
     257                                LastUpgradeCheck = 1000;
    240258                                ORGANIZATIONNAME = "The I2P Project";
    241259                                TargetAttributes = {
    242260                                        BF5061672113C48E0014EB07 = {
    243261                                                CreatedOnToolsVersion = 9.4.1;
     262                                                DevelopmentTeam = DTX4Q6WZN2;
    244263                                                LastSwiftMigration = 0940;
     264                                                ProvisioningStyle = Automatic;
    245265                                                SystemCapabilities = {
     266                                                        com.apple.ApplicationGroups.Mac = {
     267                                                                enabled = 0;
     268                                                        };
    246269                                                        com.apple.NetworkExtensions = {
    247                                                                 enabled = 1;
     270                                                                enabled = 0;
    248271                                                        };
    249272                                                        com.apple.Sandbox = {
     
    255278                        };
    256279                        buildConfigurationList = BF5061632113C48E0014EB07 /* Build configuration list for PBXProject "I2PLauncher" */;
    257                         compatibilityVersion = "Xcode 9.3";
     280                        compatibilityVersion = "Xcode 6.3";
    258281                        developmentRegion = en;
    259282                        hasScannedForEncodings = 0;
     
    277300                        buildActionMask = 2147483647;
    278301                        files = (
     302                                BF86541321515CA00014EB07 /* launcher.jar in Resources */,
     303                                BF650CAA2152AC7D0014EB07 /* dmgconfig.py in Resources */,
     304                                BF650CA92152AC7D0014EB07 /* bumpInfoPlist.sh in Resources */,
    279305                                BF07789721506C810014EB07 /* Storyboard.storyboard in Resources */,
    280306                                BF5061722113C4900014EB07 /* Assets.xcassets in Resources */,
     
    299325                        runOnlyForDeploymentPostprocessing = 0;
    300326                        shellPath = /bin/sh;
    301                         shellScript = "# Run from launchers/macosx\nexport BUILDDIR=$(pwd)\ncd ../..\nant preppkg-osx\ncd pkg-temp\nrm -f ../base.zip\nzip -r7 ../base.zip *\ncp ../base.zip $BUILDDIR\ncd $BUILDDIR\n\n\n\n";
     327                        shellScript = "# Run from launchers/macosx\nexport BUILDDIR=$(pwd)\ncd ..\nsbt macosx:assembly\ncd ..\nant preppkg-osx\ncd pkg-temp\nrm -f ../base.zip\nzip -r -v -9 ../base.zip *\ncp ../base.zip $BUILDDIR/base.zip\ncd $BUILDDIR\ncp $BUILDDIR/target/scala-2.11/routerLauncher-assembly-0.1.0-SNAPSHOT.jar $BUILDDIR/launcher.jar\n\n\n\n";
    302328                };
    303329/* End PBXShellScriptBuildPhase section */
     
    321347                                BFBDCB02215060190014EB07 /* DetectJava.swift in Sources */,
    322348                                BF07789E21506D2B0014EB07 /* PopoverViewController.swift in Sources */,
     349                                BF650CAB2152AC7D0014EB07 /* Deployer.m in Sources */,
    323350                                BF1EFA40215141110014EB07 /* main.mm in Sources */,
    324351                                BFBDCAF4215042670014EB07 /* AppleStuffExceptionHandler.m in Sources */,
     
    359386                                CLANG_CXX_LIBRARY = "libc++";
    360387                                CLANG_ENABLE_MODULES = YES;
    361                                 CLANG_ENABLE_OBJC_ARC = YES;
     388                                CLANG_ENABLE_OBJC_ARC = NO;
    362389                                CLANG_ENABLE_OBJC_WEAK = YES;
    363390                                CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
     
    401428                                GCC_WARN_UNUSED_FUNCTION = YES;
    402429                                GCC_WARN_UNUSED_VARIABLE = YES;
    403                                 MACOSX_DEPLOYMENT_TARGET = 10.13;
     430                                MACOSX_DEPLOYMENT_TARGET = 10.11;
    404431                                MTL_ENABLE_DEBUG_INFO = YES;
    405432                                ONLY_ACTIVE_ARCH = YES;
    406                                 SDKROOT = macosx;
     433                                SDKROOT = macosx10.13;
    407434                        };
    408435                        name = Debug;
     
    417444                                CLANG_CXX_LIBRARY = "libc++";
    418445                                CLANG_ENABLE_MODULES = YES;
    419                                 CLANG_ENABLE_OBJC_ARC = YES;
     446                                CLANG_ENABLE_OBJC_ARC = NO;
    420447                                CLANG_ENABLE_OBJC_WEAK = YES;
    421448                                CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
     
    453480                                GCC_WARN_UNUSED_FUNCTION = YES;
    454481                                GCC_WARN_UNUSED_VARIABLE = YES;
    455                                 MACOSX_DEPLOYMENT_TARGET = 10.13;
     482                                MACOSX_DEPLOYMENT_TARGET = 10.11;
    456483                                MTL_ENABLE_DEBUG_INFO = NO;
    457                                 SDKROOT = macosx;
     484                                SDKROOT = macosx10.13;
     485                                SWIFT_COMPILATION_MODE = wholemodule;
    458486                        };
    459487                        name = Release;
     
    462490                        isa = XCBuildConfiguration;
    463491                        buildSettings = {
    464                                 ALWAYS_SEARCH_USER_PATHS = YES;
    465492                                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
    466                                 CLANG_CXX_LANGUAGE_STANDARD = "c++14";
    467                                 CLANG_ENABLE_MODULES = YES;
    468                                 CLANG_ENABLE_OBJC_ARC = NO;
    469493                                CODE_SIGN_ENTITLEMENTS = I2PLauncher/I2PLauncher.entitlements;
    470494                                CODE_SIGN_IDENTITY = "Mac Developer";
    471495                                CODE_SIGN_STYLE = Automatic;
    472496                                COMBINE_HIDPI_IMAGES = YES;
    473                                 DEVELOPMENT_TEAM = W3C42P2LA8;
    474                                 GCC_C_LANGUAGE_STANDARD = gnu11;
     497                                DEAD_CODE_STRIPPING = YES;
     498                                DEFINES_MODULE = YES;
     499                                DEVELOPMENT_TEAM = DTX4Q6WZN2;
     500                                FRAMEWORK_SEARCH_PATHS = (
     501                                        /Library/Frameworks,
     502                                        /System/Library/Frameworks,
     503                                );
    475504                                HEADER_SEARCH_PATHS = (
    476505                                        "$(SRCROOT)/include",
     
    479508                                INCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = include;
    480509                                INFOPLIST_FILE = I2PLauncher/Info.plist;
    481                                 LD_RUNPATH_SEARCH_PATHS = (
    482                                         "$(inherited)",
    483                                         "@executable_path/../Frameworks",
    484                                 );
    485                                 MACOSX_DEPLOYMENT_TARGET = 10.10;
    486                                 PRODUCT_BUNDLE_IDENTIFIER = net.i2p.launcher.I2PLauncher;
     510                                LD_NO_PIE = YES;
     511                                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/Frameworks";
     512                                MACOSX_DEPLOYMENT_TARGET = 10.11;
     513                                PRODUCT_BUNDLE_IDENTIFIER = net.i2p.bootstrap.macosx.I2PLauncher;
    487514                                PRODUCT_NAME = "$(TARGET_NAME)";
     515                                PROVISIONING_PROFILE = "";
    488516                                PROVISIONING_PROFILE_SPECIFIER = "";
     517                                SDKROOT = macosx;
    489518                                SWIFT_OBJC_BRIDGING_HEADER = "I2PLauncher/I2PLauncher-Bridging-Header.h";
    490519                                SWIFT_OPTIMIZATION_LEVEL = "-Onone";
    491520                                SWIFT_VERSION = 3.0;
    492521                                SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/include/**";
    493                                 USER_HEADER_SEARCH_PATHS = "";
    494522                        };
    495523                        name = Debug;
     
    498526                        isa = XCBuildConfiguration;
    499527                        buildSettings = {
    500                                 ALWAYS_SEARCH_USER_PATHS = YES;
    501528                                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
    502                                 CLANG_CXX_LANGUAGE_STANDARD = "c++14";
    503                                 CLANG_ENABLE_MODULES = YES;
    504                                 CLANG_ENABLE_OBJC_ARC = NO;
    505529                                CODE_SIGN_ENTITLEMENTS = I2PLauncher/I2PLauncher.entitlements;
    506530                                CODE_SIGN_IDENTITY = "Mac Developer";
    507531                                CODE_SIGN_STYLE = Automatic;
    508532                                COMBINE_HIDPI_IMAGES = YES;
    509                                 DEVELOPMENT_TEAM = W3C42P2LA8;
    510                                 GCC_C_LANGUAGE_STANDARD = gnu11;
     533                                DEAD_CODE_STRIPPING = YES;
     534                                DEFINES_MODULE = YES;
     535                                DEVELOPMENT_TEAM = DTX4Q6WZN2;
     536                                FRAMEWORK_SEARCH_PATHS = (
     537                                        /Library/Frameworks,
     538                                        /System/Library/Frameworks,
     539                                );
    511540                                HEADER_SEARCH_PATHS = (
    512541                                        "$(SRCROOT)/include",
     
    515544                                INCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = include;
    516545                                INFOPLIST_FILE = I2PLauncher/Info.plist;
    517                                 LD_RUNPATH_SEARCH_PATHS = (
    518                                         "$(inherited)",
    519                                         "@executable_path/../Frameworks",
    520                                 );
    521                                 MACOSX_DEPLOYMENT_TARGET = 10.10;
    522                                 PRODUCT_BUNDLE_IDENTIFIER = net.i2p.launcher.I2PLauncher;
     546                                LD_NO_PIE = YES;
     547                                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/Frameworks";
     548                                MACOSX_DEPLOYMENT_TARGET = 10.11;
     549                                PRODUCT_BUNDLE_IDENTIFIER = net.i2p.bootstrap.macosx.I2PLauncher;
    523550                                PRODUCT_NAME = "$(TARGET_NAME)";
    524551                                PROVISIONING_PROFILE_SPECIFIER = "";
     552                                SDKROOT = macosx;
    525553                                SWIFT_OBJC_BRIDGING_HEADER = "I2PLauncher/I2PLauncher-Bridging-Header.h";
    526554                                SWIFT_VERSION = 3.0;
    527555                                SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/include/**";
    528                                 USER_HEADER_SEARCH_PATHS = "";
    529556                        };
    530557                        name = Release;
  • launchers/macosx/I2PLauncher.xcworkspace/contents.xcworkspacedata

    r802115e re046418f  
    33   version = "1.0">
    44   <FileRef
     5      location = "group:RouterService/RouterService.xcodeproj">
     6   </FileRef>
     7   <FileRef
    58      location = "group:I2PLauncher.xcodeproj">
    69   </FileRef>
  • launchers/macosx/I2PLauncher/Info.plist

    r802115e re046418f  
    3535        </array>
    3636        <key>CFBundleVersion</key>
    37         <string>3</string>
     37        <string>4</string>
    3838        <key>LSApplicationCategoryType</key>
    3939        <string>public.app-category.utilities</string>
     
    5454                <dict/>
    5555        </array>
     56        <key>SUFeedURL</key>
     57        <string>http://i2browser.i2p/updates/v1/appcast.xml</string>
    5658</dict>
    5759</plist>
  • launchers/macosx/README.md

    r802115e re046418f  
    11# The Mac OS X Launcher
     2
     3## Misc
    24
    35**Note** this project is WIP, cause Meeh has yet to merge in Obj-C/Swift code for GUI stuff in OSX.
     
    79More code will be merged in, it's just a f* mess which Meeh needs to clean up and move into repo.
    810
    9 `./fullBuild.sh` triggers Ant jobs and prepare the base.zip, as well as starting the ninja build.
     11## Howto build
     12
     13You can both build the project from the Xcode UI or you can build it from command line.
     14
     15An example build command:
     16`xcodebuild -target I2PLauncher -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk`
     17
     18
  • launchers/macosx/RouterTask.mm

    r802115e re046418f  
    5050        object:stdoutFileHandle];
    5151
    52     [stdoutFileHandle waitForDataInBackgroundAndNotify];
     52  [stdoutFileHandle waitForDataInBackgroundAndNotify];
    5353
    54     [self.routerTask setTerminationHandler:^(NSTask* task) {
    55       NSLog(@"termHandler triggered!");
    56       auto swiftRouterStatus = [[RouterProcessStatus alloc] init];
    57       [swiftRouterStatus setRouterStatus: true];
    58       NSBundle *launcherBundle = [NSBundle mainBundle];
    59       auto iconImage = [launcherBundle pathForResource:@"AppIcon" ofType:@"png"];
    60       sendUserNotification(APP_IDSTR, @"I2P Router has stopped");
    61       // Cleanup
    62       self.isRouterRunning = NO;
    63     }];
     54  [self.routerTask setTerminationHandler:^(NSTask* task) {
     55    NSLog(@"termHandler triggered!");
     56    auto swiftRouterStatus = [[RouterProcessStatus alloc] init];
     57    [swiftRouterStatus setRouterStatus: true];
     58    sendUserNotification(APP_IDSTR, @"I2P Router has stopped");
     59    // Cleanup
     60    //self.isRouterRunning = NO;
     61  }];
    6462/*
    6563    self.readLogHandle = [self.processPipe fileHandleForReading];
  • launchers/macosx/include/strutil.hpp

    r802115e re046418f  
    5454}
    5555
    56 bool replace(std::string& str, const std::string& from, const std::string& to) {
     56inline bool replace(std::string& str, const std::string& from, const std::string& to) {
    5757  size_t start_pos = str.find(from);
    5858  if(start_pos == std::string::npos)
  • launchers/macosx/main.mm

    r802115e re046418f  
    3535#include "include/portcheck.h"
    3636
     37#ifdef __cplusplus
     38#import "SBridge.h"
     39
     40#include "include/subprocess.hpp"
     41#include "include/strutil.hpp"
     42
     43using namespace subprocess;
     44
     45JvmListSharedPtr gRawJvmList = nullptr;
     46
     47maybeAnRouterRunner getGlobalRouterObject()
     48{
     49  std::lock_guard<std::mutex> lock(globalRouterStatusMutex);
     50  return globalRouterStatus; // Remember this might be nullptr now.
     51}
     52
     53void setGlobalRouterObject(I2PRouterTask* newRouter)
     54{
     55  std::lock_guard<std::mutex> lock(globalRouterStatusMutex);
     56  globalRouterStatus = newRouter;
     57}
     58
     59
     60pthread_mutex_t mutex;
     61
     62bool getGlobalRouterIsRunning()
     63{
     64  pthread_mutex_lock(&mutex);
     65  bool current = isRuterRunning;
     66  pthread_mutex_unlock(&mutex);
     67  return current;
     68}
     69void setGlobalRouterIsRunning(bool running)
     70{
     71  pthread_mutex_lock(&mutex);
     72  isRuterRunning = running;
     73  pthread_mutex_unlock(&mutex);
     74}
     75
     76#endif
     77
    3778#define debug(format, ...) CFShow([NSString stringWithFormat:format, ## __VA_ARGS__]);
    3879
     
    4081@end
    4182
    42 #ifdef __cplusplus
    43 #import "SBridge.h"
    44 JvmListSharedPtr gRawJvmList = nullptr;
    45 #endif
    46 
    47 
    48 @interface AppDelegate () <NSUserNotificationCenterDelegate, NSApplicationDelegate>
    49 @end
    50 
    51 #ifdef __cplusplus
    52 maybeAnRouterRunner getGlobalRouterObject()
    53 {
    54     std::lock_guard<std::mutex> lock(globalRouterStatusMutex);
    55     return globalRouterStatus; // Remember this might be nullptr now.
    56 }
    57 
    58 void setGlobalRouterObject(I2PRouterTask* newRouter)
    59 {
    60     std::lock_guard<std::mutex> lock(globalRouterStatusMutex);
    61     globalRouterStatus = newRouter;
    62 }
    63 
    64 
    65 pthread_mutex_t mutex;
    66 
    67 bool getGlobalRouterIsRunning()
    68 {
    69     pthread_mutex_lock(&mutex);
    70     bool current = isRuterRunning;
    71     pthread_mutex_unlock(&mutex);
    72     return current;
    73 }
    74 void setGlobalRouterIsRunning(bool running)
    75 {
    76     pthread_mutex_lock(&mutex);
    77     isRuterRunning = running;
    78     pthread_mutex_unlock(&mutex);
    79 }
    80 
    81 #endif
    82 
    8383
    8484@implementation ExtractMetaInfo : NSObject
     
    9292
    9393#ifdef __cplusplus
    94 
    95 #include <unistd.h>
    96 #include <sys/types.h>
    97 #include <pwd.h>
    98 #include <assert.h>
    99 
    100 #include "include/subprocess.hpp"
    101 #include "include/strutil.hpp"
    102 
    103 using namespace subprocess;
    104 
    105 const char* RealHomeDirectory() {
    106   struct passwd *pw = getpwuid(getuid());
    107   assert(pw);
    108   return pw->pw_dir;
    109 }
    11094
    11195- (void)extractI2PBaseDir:(void(^)(BOOL success, NSError *error))completion
     
    223207
    224208#ifdef __cplusplus
    225 
    226 inline std::string getDefaultBaseDir()
    227 {
    228   // Figure out base directory
    229   const char* pathFromHome = "/Users/%s/Library/I2P";
    230   auto username = getenv("USER");
    231   char buffer[strlen(pathFromHome)+strlen(username)];
    232   sprintf(buffer, pathFromHome, username);
    233   std::string i2pBaseDir(buffer);
    234   return i2pBaseDir;
    235 }
    236209
    237210- (NSString *)userSelectJavaHome:(JvmListPtr)rawJvmList
Note: See TracChangeset for help on using the changeset viewer.