Ejemplo n.º 1
0
    /// <summary>
    /// Stores Link information as a Ros message so that it will be send the next time when the user initializes to the cage
    /// </summary>
    /// <param name="info">the Link info.</param>
    public static void StoreLinkInformation(float[] info)
    {
        if (info.Length % linkInfoLength != 0)
        {
            Debug.LogWarning("Shape mismatch: Received array length " + info.Length + " not dividable by " +
                             linkInfoLength);
        }

        int numLinks = info.Length / linkInfoLength;

        linkInfo = new LinkInformation[numLinks];
        for (int i = 0; i < numLinks; i++)
        {
            int    o        = i * linkInfoLength;
            int    id       = (int)(info[o]);
            string linkName = linkNames[(int)(info[o + 1])];
            RosSharp.RosBridgeClient.MessageTypes.Geometry.Vector3 dimensions =
                new RosSharp.RosBridgeClient.MessageTypes.Geometry.Vector3(info[o + 2], info[o + 3], info[o + 4]);
            Point point = new Point(info[o + 5], info[o + 6], info[o + 7]);
            RosSharp.RosBridgeClient.MessageTypes.Geometry.Quaternion quaternion =
                new RosSharp.RosBridgeClient.MessageTypes.Geometry.Quaternion(info[o + 8], info[o + 9], info[o + 10],
                                                                              info[o + 11]);
            Pose init_pose = new Pose(point, quaternion);
            linkInfo[i] = new LinkInformation(id, linkName, dimensions, init_pose);
        }
    }
Ejemplo n.º 2
0
        private string GetLinkPreview(LinkInformation linkInformation)
        {
            if (string.IsNullOrEmpty(linkInformation.Scheme))
            {
                return("");
            }

            if (string.IsNullOrEmpty(linkInformation.Host))
            {
                return(linkInformation.Scheme + "://*");
            }

            if (string.IsNullOrEmpty(linkInformation.Path))
            {
                return(string.Format("{0}://{1}/*", linkInformation.Scheme, linkInformation.Host));
            }

            return(string.Format("{0}://{1}/{2}", linkInformation.Scheme, linkInformation.Host, linkInformation.Path));
        }
Ejemplo n.º 3
0
    public override void OnInspectorGUI()
    {
        QuartersInit quartersInit = (QuartersInit)target;

        EditorGUILayout.LabelField($"Quarters Unity SDK - Version {QuartersInit.SDK_VERSION}");
        if (GUILayout.Button("Open App Dashboard"))
        {
            Application.OpenURL(quartersInit.DASHBOARD_URL);
        }
        if (GUILayout.Button("My Apps"))
        {
            Application.OpenURL(quartersInit.POQ_APPS_URL);
        }


        EditorGUILayout.Space();
        base.DrawDefaultInspector();

        if (GUILayout.Button("Save"))
        {
            AppLinkingConfiguration config = new AppLinkingConfiguration();

            config.DisplayName          = "Quarters SDK";
            config.DeepLinkingProtocols = new List <LinkInformation>();

            LinkInformation linkInformation = new LinkInformation();
            linkInformation.Scheme = "https";
            linkInformation.Host   = $"{quartersInit.APP_UNIQUE_IDENTIFIER}.games.poq.gg";


            config.DeepLinkingProtocols.Add(linkInformation);

            ConfigurationStorage.Save(config);
            Debug.Log("Saved Quarters SDK Config");
        }
    }
Ejemplo n.º 4
0
        public override bool LinkISO(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
        {
            bool OK = true;

            string BinPath = LinkInfo.ISOPath.Replace(".iso", ".bin");
            string ElfPath = LinkInfo.ISOPath.Replace(".iso", ".elf");

            StreamWriter ASMWriter = new StreamWriter(LinkInfo.ASMPath, false);

            StringBuilder CommandLineArgsBuilder = new StringBuilder();
            CommandLineArgsBuilder.Append("--fatal-warnings -EL -Os -T \"" + LinkInfo.LinkScriptPath + "\" -o \"" + ElfPath + "\"");

            StringBuilder LinkScript = new StringBuilder();
            LinkScript.Append(@"ENTRY(Kernel_Start)
OUTPUT_ARCH(mips)

SECTIONS {
   . = 0x" + Options.BaseAddress.ToString("X8") + @";

   .text : AT(ADDR(.text) - " + Options.LoadOffset.ToString() + @") {
");

            for (int i = 0; i < LinkInfo.SequencedASMBlocks.Count; i++)
            {
                LinkScript.AppendLine(string.Format("       \"{0}\" (.text);", LinkInfo.SequencedASMBlocks[i].ObjectOutputFilePath));
                ASMWriter.WriteLine(File.ReadAllText(LinkInfo.SequencedASMBlocks[i].ASMOutputFilePath));
            }


            LinkScript.AppendLine(@"
          * (.text);
   }

    . = ALIGN(0x4);
   .data : AT(ADDR(.data) - " + Options.LoadOffset.ToString() + @") {
          * (.data*);
   }

   . = ALIGN(0x4);
   .bss : AT(ADDR(.bss) - " + Options.LoadOffset.ToString() + @") {
          * (.bss*);
   }
}
");

            ASMWriter.Close();

            File.WriteAllText(LinkInfo.LinkScriptPath, LinkScript.ToString());
            OK = Utilities.ExecuteProcess(LinkInfo.LdWorkingDir, Path.Combine(LinkInfo.ToolsPath, @"MIPS\mips-linux-gnu-ld.exe"), CommandLineArgsBuilder.ToString(), "Ld");

            if (OK)
            {
                if (File.Exists(BinPath))
                {
                    File.Delete(BinPath);
                }

                OK = Utilities.ExecuteProcess(Options.OutputPath, Path.Combine(LinkInfo.ToolsPath, @"MIPS\mips-linux-gnu-objcopy.exe"), string.Format("-O binary \"{0}\" \"{1}\"", ElfPath, BinPath), "MIPS:ObjCopy");

                if (OK)
                {
                    if (File.Exists(LinkInfo.MapPath))
                    {
                        File.Delete(LinkInfo.MapPath);
                    }

                    OK = Utilities.ExecuteProcess(Options.OutputPath, Path.Combine(LinkInfo.ToolsPath, @"MIPS\mips-linux-gnu-objdump.exe"), string.Format("--wide --syms \"{0}\"", ElfPath), "MIPS:ObjDump", false, LinkInfo.MapPath);
                }
            }

            return OK;
        }
Ejemplo n.º 5
0
 public override bool LinkELF(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
 {
     return false;
 }
Ejemplo n.º 6
0
        public override bool LinkELF(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
        {
            StringBuilder CommandLineArgsBuilder = new StringBuilder();
            if (!LinkInfo.ExecutableOutput)
            {
                CommandLineArgsBuilder.Append("-shared ");
            }
            CommandLineArgsBuilder.Append("-L .\\Output -T \"" + LinkInfo.LinkScriptPath + "\" -o \"" + LinkInfo.BinPath + "\"");

            StreamWriter ASMWriter = new StreamWriter(LinkInfo.ASMPath, false);

            StringBuilder LinkScript = new StringBuilder();
            LinkScript.Append((LinkInfo.ExecutableOutput ? "ENTRY(" + LinkInfo.EntryPoint + ")\r\n" : "") +
@"GROUP(");

            LinkScript.Append(string.Join(" ", LinkInfo.SequencedASMBlocks
                .Where(x => File.Exists(x.OutputFilePath))
                .Select(x => "\"" + x.OutputFilePath + "\"")));

            LinkScript.Append(@")

");
            if (LinkInfo.depLibNames.Count > 0)
            {
                LinkScript.Append("GROUP(");
                LinkScript.Append(string.Join(" ", LinkInfo.depLibNames.Select(x => "-l" + x)));
                LinkScript.Append(")");
            }

            LinkScript.AppendLine(@"

SECTIONS {
   . = 0x" + (0x40000000 + (LinkInfo.depLibNames.Count * 0x1000)).ToString("X2") + @";

   .text : {
");

            for (int i = 0; i < LinkInfo.SequencedASMBlocks.Count; i++)
            {
                LinkScript.AppendLine(string.Format("       \"{0}\" (.text);", LinkInfo.SequencedASMBlocks[i].OutputFilePath));
                ASMWriter.WriteLine(File.ReadAllText(LinkInfo.SequencedASMBlocks[i].OutputFilePath.Replace("\\Objects", "\\ASM").Replace(".o", ".s")));
            }


            LinkScript.AppendLine(@"
          * (.text);
          * (.rodata*);
   }

   . = ALIGN(0x1000);
   .data : AT(ADDR(.data)) {
          * (.data*);
   }

   . = ALIGN(0x1000);
   .bss : AT(ADDR(.bss)) {
          * (.bss*);
   }
}
");
            ASMWriter.Close();

            File.WriteAllText(LinkInfo.LinkScriptCmdPath, CommandLineArgsBuilder.ToString());
            File.WriteAllText(LinkInfo.LinkScriptPath, LinkScript.ToString());
            return Utilities.ExecuteProcess(LinkInfo.LdWorkingDir, Path.Combine(LinkInfo.ToolsPath, @"Cygwin\ld.exe"), CommandLineArgsBuilder.ToString(), "Ld");
        }
Ejemplo n.º 7
0
        public override bool LinkISO(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
        {
            bool OK = true;

            StreamWriter ASMWriter = new StreamWriter(LinkInfo.ASMPath, false);

            StringBuilder CommandLineArgsBuilder = new StringBuilder();
            CommandLineArgsBuilder.Append("--fatal-warnings -T \"" + LinkInfo.LinkScriptPath + "\" -o \"" + LinkInfo.BinPath + "\"");

            StringBuilder LinkScript = new StringBuilder();
            LinkScript.Append(@"ENTRY(Kernel_Start)
OUTPUT_FORMAT(elf32-i386)

GROUP(");

            LinkScript.Append(string.Join(" ", LinkInfo.SequencedASMBlocks
                .Where(x => File.Exists(x.OutputFilePath))
                .Select(x => "\"" + x.OutputFilePath + "\"")));

            LinkScript.AppendLine(@")

SECTIONS {
   /* The kernel will live at 3GB + 1MB in the virtual
      address space, which will be mapped to 1MB in the
      physical address space. */
   . = 0x" + Options.BaseAddress.ToString("X8") + @";

   .text : AT(ADDR(.text) - " + Options.LoadOffset.ToString() + @") {
");

            for (int i = 0; i < LinkInfo.SequencedASMBlocks.Count; i++)
            {
                LinkScript.AppendLine(string.Format("       \"{0}\" (.text);", LinkInfo.SequencedASMBlocks[i].OutputFilePath));
                ASMWriter.WriteLine(File.ReadAllText(LinkInfo.SequencedASMBlocks[i].OutputFilePath.Replace("\\Objects", "\\ASM").Replace(".o", ".s")));
            }


            LinkScript.AppendLine(@"
          * (.text);
          * (.rodata*);
   }

   . = ALIGN(0x1000);
   .data : AT(ADDR(.data) - " + Options.LoadOffset.ToString() + @") {
          * (.data*);
   }

   . = ALIGN(0x1000);
   .bss : AT(ADDR(.bss) - " + Options.LoadOffset.ToString() + @") {
          * (.bss*);
   }
}
");

            ASMWriter.Close();

            File.WriteAllText(LinkInfo.LinkScriptPath, LinkScript.ToString());
            OK = Utilities.ExecuteProcess(LinkInfo.LdWorkingDir, Path.Combine(LinkInfo.ToolsPath, @"Cygwin\ld.exe"), CommandLineArgsBuilder.ToString(), "Ld");

            if (OK)
            {
                if (File.Exists(LinkInfo.ISOPath))
                {
                    File.Delete(LinkInfo.ISOPath);
                }

                OK = Utilities.ExecuteProcess(Options.OutputPath, LinkInfo.ISOGenPath,
                    string.Format("4 \"{0}\" \"{1}\" true \"{2}\"", LinkInfo.ISOPath, LinkInfo.ISOLinuxPath, LinkInfo.ISODirPath), "ISO9660Generator");

                if (OK)
                {
                    if (File.Exists(LinkInfo.MapPath))
                    {
                        File.Delete(LinkInfo.MapPath);
                    }

                    OK = Utilities.ExecuteProcess(Options.OutputPath, Path.Combine(LinkInfo.ToolsPath, @"Cygwin\objdump.exe"), string.Format("--wide --syms \"{0}\"", LinkInfo.BinPath), "ObjDump", false, LinkInfo.MapPath);
                }
            }

            return OK;
        }
Ejemplo n.º 8
0
        public override bool LinkISO(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
        {
            bool OK = true;

            string BinPath = LinkInfo.ISOPath.Replace(".iso", ".bin");
            string ElfPath = LinkInfo.ISOPath.Replace(".iso", ".elf");

            StreamWriter ASMWriter = new StreamWriter(LinkInfo.ASMPath, false);

            StringBuilder CommandLineArgsBuilder = new StringBuilder();

            CommandLineArgsBuilder.Append("--fatal-warnings -EL -Os -T \"" + LinkInfo.LinkScriptPath + "\" -o \"" + ElfPath + "\"");

            StringBuilder LinkScript = new StringBuilder();

            LinkScript.Append(@"ENTRY(Kernel_Start)
OUTPUT_ARCH(mips)

SECTIONS {
   . = 0x" + Options.BaseAddress.ToString("X8") + @";

   .text : AT(ADDR(.text) - " + Options.LoadOffset.ToString() + @") {
");

            for (int i = 0; i < LinkInfo.SequencedASMBlocks.Count; i++)
            {
                LinkScript.AppendLine(string.Format("       \"{0}\" (.text);", LinkInfo.SequencedASMBlocks[i].ObjectOutputFilePath));
                ASMWriter.WriteLine(File.ReadAllText(LinkInfo.SequencedASMBlocks[i].ASMOutputFilePath));
            }


            LinkScript.AppendLine(@"
          * (.text);
   }

    . = ALIGN(0x4);
   .data : AT(ADDR(.data) - " + Options.LoadOffset.ToString() + @") {
          * (.data*);
   }

   . = ALIGN(0x4);
   .bss : AT(ADDR(.bss) - " + Options.LoadOffset.ToString() + @") {
          * (.bss*);
   }
}
");

            ASMWriter.Close();

            File.WriteAllText(LinkInfo.LinkScriptPath, LinkScript.ToString());
            OK = Utilities.ExecuteProcess(LinkInfo.LdWorkingDir, Path.Combine(LinkInfo.ToolsPath, @"MIPS\mips-linux-gnu-ld.exe"), CommandLineArgsBuilder.ToString(), "Ld");

            if (OK)
            {
                if (File.Exists(BinPath))
                {
                    File.Delete(BinPath);
                }

                OK = Utilities.ExecuteProcess(Options.OutputPath, Path.Combine(LinkInfo.ToolsPath, @"MIPS\mips-linux-gnu-objcopy.exe"), string.Format("-O binary \"{0}\" \"{1}\"", ElfPath, BinPath), "MIPS:ObjCopy");

                if (OK)
                {
                    if (File.Exists(LinkInfo.MapPath))
                    {
                        File.Delete(LinkInfo.MapPath);
                    }

                    OK = Utilities.ExecuteProcess(Options.OutputPath, Path.Combine(LinkInfo.ToolsPath, @"MIPS\mips-linux-gnu-objdump.exe"), string.Format("--wide --syms \"{0}\"", ElfPath), "MIPS:ObjDump", false, LinkInfo.MapPath);
                }
            }

            return(OK);
        }
Ejemplo n.º 9
0
 public override bool LinkELF(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
 {
     return(false);
 }
Ejemplo n.º 10
0
        // Do not add any additional code to this method
        private async void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
            {
                return;
            }

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new RadPhoneApplicationFrame
            {
                // Add default page transitions animations
                Transition = new RadTransition()
                {
                    ForwardInAnimation   = AnimationService.GetPageInAnimation(),
                    ForwardOutAnimation  = AnimationService.GetPageOutAnimation(),
                    BackwardInAnimation  = AnimationService.GetPageInAnimation(),
                    BackwardOutAnimation = AnimationService.GetPageOutAnimation(),
                }
            };

            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Handle reset requests for clearing the backstack
            RootFrame.Navigated += CheckForResetNavigation;

#if WINDOWS_PHONE_81
            RootFrame.Navigating += RootFrameOnNavigating;

            // Handle contract activation such as returned values from file open or save picker
            PhoneApplicationService.Current.ContractActivated += CurrentOnContractActivated;
#endif

            // Assign the URI-mapper class to the application frame.
            RootFrame.UriMapper = new AssociationUriMapper();

            // Initialize the application information
            AppInformation = new AppInformation();

            // Initialize the links information
            LinkInformation = new LinkInformation();

            // Initialize SDK parameters
            SdkService.InitializeSdkParams();

            // Initialize the main drive
            CloudDrive = new CloudDriveViewModel(SdkService.MegaSdk, AppInformation);

            // Add a global notifications listener.
            GlobalListener = new GlobalListener(AppInformation);
            SdkService.MegaSdk.addGlobalListener(GlobalListener);

            // Add a global request listener to process all.
            SdkService.MegaSdk.addRequestListener(this);

            // Add a global transfer listener to process all transfers.
            SdkService.MegaSdk.addTransferListener(TransfersService.GlobalTransferListener);

            // Initialize Folders
            AppService.InitializeAppFolders();

            // Set the current resolution that we use later on for our image selection
            AppService.CurrentResolution = ResolutionHelper.CurrentResolution;

            // Clear settings values we do no longer use
            AppService.ClearObsoleteSettings();

            // Save the app version information for future use (like deleting settings)
            AppService.SaveAppInformation();

            // Set MEGA red as Accent Color
            ((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = (Color)Resources["MegaRedColor"];

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }
Ejemplo n.º 11
0
        private void FinishRequest(OnPremiseConnectorRequest request, IOnPremiseConnectorResponse response, LinkInformation link, string path, HttpStatusCode statusCode)
        {
            if (request == null)
            {
                return;
            }

            request.RequestFinished = DateTime.UtcNow;

            _logger?.Verbose("Finishing request. request-id={RequestId}, link-id={LinkId}, link-name={LinkName}, on-premise-duration={RemoteDuration}, global-duration={GlobalDuration}", request.RequestId, link.Id, link.SymbolicName, response?.RequestFinished - response?.RequestStarted, request.RequestFinished - request.RequestStarted);

            _traceManager.Trace(request, response, link.TraceConfigurationIds);
            _requestLogger.LogRequest(request, response, link.Id, _backendCommunication.OriginId, path, statusCode);
        }
Ejemplo n.º 12
0
        private bool CanRequestBeHandled(string path, PathInformation pathInformation, LinkInformation link)
        {
            if (link == null)
            {
                _logger?.Information("Link for path {RequestPath} not found", path);
                return(false);
            }

            if (link.IsDisabled)
            {
                _logger?.Information("Link {LinkName} is disabled", link.SymbolicName);
                return(false);
            }

            if (String.IsNullOrWhiteSpace(pathInformation.PathWithoutUserName))
            {
                _logger?.Information("Path {RequestPath} for link {LinkName} without user name is not found", path, link.SymbolicName);
                return(false);
            }

            if (link.AllowLocalClientRequestsOnly && !Request.IsLocal())
            {
                _logger?.Information("Link {LinkName} only allows local requests", link.SymbolicName);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 13
0
        public override bool LinkELF(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
        {
            StringBuilder CommandLineArgsBuilder = new StringBuilder();

            if (!LinkInfo.ExecutableOutput)
            {
                CommandLineArgsBuilder.Append("-shared ");
            }
            CommandLineArgsBuilder.Append("-L .\\Output -T \"" + LinkInfo.LinkScriptPath + "\" -o \"" + LinkInfo.BinPath + "\"");

            StreamWriter ASMWriter = new StreamWriter(LinkInfo.ASMPath, false);

            StringBuilder LinkScript = new StringBuilder();

            LinkScript.Append((LinkInfo.ExecutableOutput ? "ENTRY(" + LinkInfo.EntryPoint + ")\r\n" : "") +
                              @"GROUP(");

            LinkScript.Append(string.Join(" ", LinkInfo.SequencedASMBlocks
                                          .Where(x => File.Exists(x.ObjectOutputFilePath))
                                          .Select(x => "\"" + x.ObjectOutputFilePath + "\"")));

            LinkScript.Append(@")

");
            if (LinkInfo.depLibNames.Count > 0)
            {
                LinkScript.Append("GROUP(");
                LinkScript.Append(string.Join(" ", LinkInfo.depLibNames.Select(x => "-l" + x)));
                LinkScript.Append(")");
            }

            LinkScript.AppendLine(@"

SECTIONS {
   . = 0x" + (0x40000000 + (LinkInfo.depLibNames.Count * 0x1000)).ToString("X2") + @";

   .text : {
");

            for (int i = 0; i < LinkInfo.SequencedASMBlocks.Count; i++)
            {
                LinkScript.AppendLine(string.Format("       \"{0}\" (.text);", LinkInfo.SequencedASMBlocks[i].ObjectOutputFilePath));
                ASMWriter.WriteLine(File.ReadAllText(LinkInfo.SequencedASMBlocks[i].ASMOutputFilePath));
            }


            LinkScript.AppendLine(@"
          * (.text);
          * (.rodata*);
   }

   . = ALIGN(0x1000);
   .data : AT(ADDR(.data)) {
          * (.data*);
   }

   . = ALIGN(0x1000);
   .bss : AT(ADDR(.bss)) {
          * (.bss*);
   }
}
");
            ASMWriter.Close();

            File.WriteAllText(LinkInfo.LinkScriptCmdPath, CommandLineArgsBuilder.ToString());
            File.WriteAllText(LinkInfo.LinkScriptPath, LinkScript.ToString());
            return(Utilities.ExecuteProcess(LinkInfo.LdWorkingDir, Path.Combine(LinkInfo.ToolsPath, @"Cygwin\ld.exe"), CommandLineArgsBuilder.ToString(), "Ld"));
        }
Ejemplo n.º 14
0
        public override bool LinkISO(IL.ILLibrary TheLibrary, LinkInformation LinkInfo)
        {
            bool OK = true;

            StreamWriter ASMWriter = new StreamWriter(LinkInfo.ASMPath, false);

            StringBuilder CommandLineArgsBuilder = new StringBuilder();

            CommandLineArgsBuilder.Append("--fatal-warnings -T \"" + LinkInfo.LinkScriptPath + "\" -o \"" + LinkInfo.BinPath + "\"");

            StringBuilder LinkScript = new StringBuilder();

            LinkScript.Append(@"ENTRY(Kernel_Start)
OUTPUT_FORMAT(elf32-i386)

GROUP(");

            LinkScript.Append(string.Join(" ", LinkInfo.SequencedASMBlocks
                                          .Where(x => File.Exists(x.ObjectOutputFilePath))
                                          .Select(x => "\"" + x.ObjectOutputFilePath + "\"")));

            LinkScript.AppendLine(@")

SECTIONS {
   /* The kernel will live at 3GB + 1MB in the virtual
      address space, which will be mapped to 1MB in the
      physical address space. */
   . = 0x" + Options.BaseAddress.ToString("X8") + @";

   .text : AT(ADDR(.text) - " + Options.LoadOffset.ToString() + @") {
");

            for (int i = 0; i < LinkInfo.SequencedASMBlocks.Count; i++)
            {
                LinkScript.AppendLine(string.Format("       \"{0}\" (.text);", LinkInfo.SequencedASMBlocks[i].ObjectOutputFilePath));
                ASMWriter.WriteLine(File.ReadAllText(LinkInfo.SequencedASMBlocks[i].ASMOutputFilePath));
            }


            LinkScript.AppendLine(@"
          * (.text);
          * (.rodata*);
   }

   . = ALIGN(0x1000);
   .data : AT(ADDR(.data) - " + Options.LoadOffset.ToString() + @") {
          * (.data*);
   }

   . = ALIGN(0x1000);
   .bss : AT(ADDR(.bss) - " + Options.LoadOffset.ToString() + @") {
          * (.bss*);
   }
}
");

            ASMWriter.Close();

            File.WriteAllText(LinkInfo.LinkScriptPath, LinkScript.ToString());
            OK = Utilities.ExecuteProcess(LinkInfo.LdWorkingDir, Path.Combine(LinkInfo.ToolsPath, @"Cygwin\ld.exe"), CommandLineArgsBuilder.ToString(), "Ld");

            if (OK)
            {
                if (File.Exists(LinkInfo.ISOPath))
                {
                    File.Delete(LinkInfo.ISOPath);
                }

                OK = Utilities.ExecuteProcess(Options.OutputPath, LinkInfo.ISOGenPath,
                                              string.Format("4 \"{0}\" \"{1}\" true \"{2}\"", LinkInfo.ISOPath, LinkInfo.ISOLinuxPath, LinkInfo.ISODirPath), "ISO9660Generator");

                if (OK)
                {
                    if (File.Exists(LinkInfo.MapPath))
                    {
                        File.Delete(LinkInfo.MapPath);
                    }

                    OK = Utilities.ExecuteProcess(Options.OutputPath, Path.Combine(LinkInfo.ToolsPath, @"Cygwin\objdump.exe"), string.Format("--wide --syms \"{0}\"", LinkInfo.BinPath), "ObjDump", false, LinkInfo.MapPath);
                }
            }

            return(OK);
        }
Ejemplo n.º 15
0
        // Do not add any additional code to this method
        private async void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
            {
                return;
            }

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new RadPhoneApplicationFrame
            {
                // Add default page transitions animations
                Transition = new RadTransition()
                {
                    ForwardInAnimation   = AnimationService.GetPageInAnimation(),
                    ForwardOutAnimation  = AnimationService.GetPageOutAnimation(),
                    BackwardInAnimation  = AnimationService.GetPageInAnimation(),
                    BackwardOutAnimation = AnimationService.GetPageOutAnimation(),
                }
            };

            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Handle reset requests for clearing the backstack
            RootFrame.Navigated += CheckForResetNavigation;

#if WINDOWS_PHONE_81
            RootFrame.Navigating += RootFrameOnNavigating;

            // Handle contract activation such as returned values from file open or save picker
            PhoneApplicationService.Current.ContractActivated += CurrentOnContractActivated;
#endif

            // Assign the URI-mapper class to the application frame.
            RootFrame.UriMapper = new AssociationUriMapper();

            // Initialize the application information
            AppInformation = new AppInformation();

            // Initialize the links information
            LinkInformation = new LinkInformation();

            //The next line enables a custom logger, if this function is not used OutputDebugString() is called
            //in the native library and log messages are only readable with the native debugger attached.
            //The default behavior of MegaLogger() is to print logs using Debug.WriteLine() but it could
            //be used to sends log to a file, for example.
            LogService.SetLoggerObject(new MegaLogger());

            //You can select the maximum output level for debug messages.
            //By default FATAL, ERROR, WARNING and INFO will be enabled
            //DEBUG and MAX can only be enabled in Debug builds, they are ignored in Release builds
            LogService.SetLogLevel(MLogLevel.LOG_LEVEL_DEBUG);

            //You can send messages to the logger using LogService.Log(), those messages will be received
            //in the active logger
            LogService.Log(MLogLevel.LOG_LEVEL_INFO, "Example log message");

            // Set the ID for statistics
            MegaSDK.setStatsID(Convert.ToBase64String((byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId")));

            // Initialize the main MegaSDK instance
            MegaSdk = new MegaSDK(AppResources.AppKey, String.Format("{0}/{1}/{2}",
                                                                     AppService.GetAppUserAgent(), DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName),
                                  ApplicationData.Current.LocalFolder.Path, new MegaRandomNumberProvider());

            // Initialize the MegaSDK instance for Folder Links
            MegaSdkFolderLinks = new MegaSDK(AppResources.AppKey, String.Format("{0}/{1}/{2}",
                                                                                AppService.GetAppUserAgent(), DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName),
                                             ApplicationData.Current.LocalFolder.Path, new MegaRandomNumberProvider());

            // Initialize the main drive
            CloudDrive = new CloudDriveViewModel(MegaSdk, AppInformation);
            // Add notifications listener. Needs a DriveViewModel
            GlobalDriveListener = new GlobalDriveListener(AppInformation);
            MegaSdk.addGlobalListener(GlobalDriveListener);
            // Add a global request listener to process all.
            MegaSdk.addRequestListener(this);
            // Add a global transfer listener to process all transfers.
            GlobalTransferListener = new GlobalTransferListener();
            MegaSdk.addTransferListener(GlobalTransferListener);
            // Initialize the transfer listing
            MegaTransfers = new TransferQueu();
            // Initialize Folders
            AppService.InitializeAppFolders();
            // Set the current resolution that we use later on for our image selection
            AppService.CurrentResolution = ResolutionHelper.CurrentResolution;
            // Clear settings values we do no longer use
            AppService.ClearObsoleteSettings();
            // Save the app version information for future use (like deleting settings)
            AppService.SaveAppInformation();
            // Set MEGA red as Accent Color
            ((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = (Color)Resources["MegaRedColor"];

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }