Uname:Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64

Base Dir : /var/www/html

User : gavin


403WebShell
403Webshell
Server IP : 68.183.124.220  /  Your IP : 216.73.217.137
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : gavin ( 1000)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/src/Python-3.6.8/Mac/PythonLauncher/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/Python-3.6.8/Mac/PythonLauncher/MyAppDelegate.m
#import "MyAppDelegate.h"
#import "PreferencesWindowController.h"
#import <Carbon/Carbon.h>
#import <ApplicationServices/ApplicationServices.h>

@implementation MyAppDelegate

- (id)init
{
    self = [super init];
    initial_action_done = NO;
    should_terminate = NO;
    return self;
}

- (IBAction)showPreferences:(id)sender
{
    [PreferencesWindowController getPreferencesWindow];
}

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
    // Test that the file mappings are correct
    [self testFileTypeBinding];
    // If we were opened because of a file drag or doubleclick
    // we've set initial_action_done in shouldShowUI
    // Otherwise we open a preferences dialog.
    if (!initial_action_done) {
        initial_action_done = YES;
        [self showPreferences: self];
    }
}

- (BOOL)shouldShowUI
{
    // if this call comes before applicationDidFinishLaunching: we
    // should terminate immediately after starting the script.
    if (!initial_action_done)
        should_terminate = YES;
    initial_action_done = YES;
    if( GetCurrentKeyModifiers() & optionKey )
        return YES;
    return NO;
}

- (BOOL)shouldTerminate
{
    return should_terminate;
}

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
    return NO;
}

- (void)testFileTypeBinding
{
    NSURL *ourUrl;
    OSStatus err;
    FSRef appRef;
    NSURL *appUrl;
    static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL};
    NSString **ext_p;
    int i;

    if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest"])
        return;
    ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]];
    for( ext_p = extensions; *ext_p; ext_p++ ) {
        err = LSGetApplicationForInfo(
            kLSUnknownType,
            kLSUnknownCreator,
            (CFStringRef)*ext_p,
            kLSRolesViewer,
            &appRef,
            (CFURLRef *)&appUrl);
        if (err || ![appUrl isEqual: ourUrl] ) {
            i = NSRunAlertPanel(@"File type binding",
                @"PythonLauncher is not the default application for all " \
                  @"Python script types. You should fix this with the " \
                  @"Finder's \"Get Info\" command.\n\n" \
                  @"See \"Changing the application that opens a file\" in " \
                  @"Mac Help for details.",
                @"OK",
                @"Don't show this warning again",
                NULL);
            if ( i == 0 ) { // Don't show again
                [[NSUserDefaults standardUserDefaults]
                    setObject:@"YES" forKey:@"SkipFileBindingTest"];
            }
            return;
        }
    }
}

@end

Youez - 2016 - github.com/yon3zu
LinuXploit