RELEASE Goldleaf - A Nintendo Switch multipurpose homebrew tool

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by XorTroll, Dec 30, 2018.


    Front-page RELEASE
    Goldleaf - A Nintendo Switch multipurpose homebrew tool!


    Goldleaf is multipurpose homebrew tool for Nintendo Switch.
    Table of contents
    Download it from here!

    If you like my work, consider becoming a patron and supporting all my work:


    Goldleaf has a very similar concept to FBI, which is a similar tool for Nintendo 3DS homebrew.

    As installed content, it's application Id / titleId is 050032A5CF12E000.

    These are its main features:
    • SD card browser: A simple but fully equiped file browser for the SD card, supporting several file formats (such as NSP, NRO, NACP, NXTheme, JPEG, tickets...), and with support for copying, pasting, renaming, deleting and creating files and directories.
    • Console memory browser: Same browser but to be used with NAND partitions, which also warns when writing or deleting content as it can be dangerous.
    • USB installer: Via USB connection, you can send NSPs from Goldtree or other PC clients and install them into your console. Keep in mind that this feature is unstable, and might face bugs and issues.
    • Content manager: Browse any kind of content in your SD card, console memory or game cartridge. You can browse all the NCAs, and as title options, you can remove the content, or export it as a NSP. NAND SYSTEM contents (system titles or contents) aren't allowed to be deleted. Invidual contents such as updates or DLC can be removed individually.
    • Ticket manager: Browse all tickets, both common and personalized. You can remove them, but an extra warning will be displayed when attempting to remove tickets being used by some content.
    • Internet via web applets: Using the console's web applets, Goldleaf allows to search and navigate through web pages. If Goldleaf is launched through hbmenu as a NRO, WifiWebAuth applet will be used, which tends to fail sometimes, along with fewer features, such as lack of video support.
    • User account manager: Select a user account, and easily change things as the user's nickname or even delete it. Via the file browsers you can replace a user's icon with a JPEG image, but it can be a risky action. The icon needs to be a valid JPEG, with 256x256 dimensions. Goldleaf checks if the icon is valid to replace the other one.
    • Console information: Simple menu to see current firmware string, and the total free and occupied size on SD card and console memory.​
    Among all this features, Goldleaf is a very intuitive tool, with a fancy UI, and fully translated into 5 different languages: English, Spanish, German, French and Italian.

    Common controls
    • (L-stick / D-pad) Move through the menu
    • (R-stick) Move (very) fast through the menu
    • (ZL / ZR) Show a dialog to shut down or reboot the console.
    • (+ / -) [NRO only] exit the application in order to return to hbmenu.​

    NSP installs
    Always keep in mind that installing NSPs can be a very easy way to get banned. If you use airplane mode and special DNSs like 90DNS, there is a smaller chance to get banned.

    NEVER install untrusted NSPs. Goldleaf can identify (according to the NSP's application ID) whether the NSP is a homebrew NSP (IDs starting with "05", usually for forwarders), or a regular title (official ID range just allows IDs starting with "01")

    Tickets represent a game purchase, but technically speaking, you can't boot a title if the ticket isn't present (in case the title requires the ticket).

    NSPs which don't have (nor require) a ticket are "standard crypto" NSPs. Standard-crypto titles aren't offical (usually reconverted content to avoid importing tickets).

    Goldleaf will display whether a ticket is present or not, and if so, it's titlekey. Titlekeys are required to decrypt and access titles' content which require a ticket. Otherwise, they are undecryptable, hence unlaunchable by the system.


    Goldleaf supports the customization of colors, assets and other options via a INI file located at Goldleaf's folder: sd:/goldleaf/goldleaf.ini.

    These are the options supported on the INI file (not found boolean options are defaulted to false):

    Section Option Description
    General useCustomLanguage { true, false } If not true,'customLanguage' will be ignored.
    General customLanguage { en, es, de, fr, it } Ignores the console's language and use this one.
    General keysPath { (path starting with "/") } Key file path, defaults to "/switch/prod.keys".
    UI romfsReplace { true, false } If not true, 'romfsReplacePath' will be ignored.
    UI romfsReplacePath { (path starting with "/") } Path to search RomFs resources, if it's a valid one.
    UI useCustomColors { true, false } If not true, colors' options will be ignored.
    UI colorBackground { (color in 4 bytes, example: "55,125,255,255") } Background color.
    UI colorBase { (color in 4 bytes, example: "55,125,255,255") } Base display color.
    UI colorBaseFocus { (color in 4 bytes, example: "55,125,255,255") } Base display color, when focused.
    UI colorText { (color in 4 bytes, example: "55,125,255,255") } Text color.
    UI useCustomSizes { true, false } If not true, sizes' options will be ignored.
    UI fileBrowserItemsSize { (number, divisible by 5) } Size of the items on file browsers, 50 by default.

    Via RomFs replacement, when Goldleaf tries to locate, for instance, romfs:/FileSystem/FileDataFont.ttf resource font, if romfsReplace is true and romfsReplacePath is, for instance, /goldleaf/testromfs, Goldleaf will look if sd:/goldleaf/testromfs/FileSystem/FileDataFont.ttf exists and use it if so, otherwise will use RomFs's one.

    So, via this configurations, UI's images, resources, element sizes and even translations (using custom JSON translations) can be used, plus some more assets which will be added in future updates.

    Known bugs
    • On Atmosphère and SX OS, exiting Goldleaf via HOME menu (as a NRO) seems to crash the system on 7.x firmwares.
    • USB installation in general seems to have several bugs, most of them related to the UI system.​
    Credits and support

    The main concepts of Goldleaf are and have been developed by XorTroll, but without the effort and support of many others, this project wouldn't be what it is now:

    (from all the people listed below, special thanks to Adubbz, exelix, C4Phoenix, The-4n and SciresM, for their huge support on their respective areas of homebrew)
    • Adubbz and all the (old) Tinfoil contributors, for their huge work with title installing.
    • exelix and Qcean team, for all their huge support with Home Menu themes. Goldleaf uses (adapted) SwitchThemesCommon libraries to handle theme installs.
    • C4Phoenix, for his awesome work doing this project's logo, and the GIF displayed when launching the installed version.
    • All the icons except Goldleaf's one (see credit above) were grabbed from Icons8.
    • 2767mr, for all the support for making USB installs more stable, and the work-in-progress .NET core version of Goldtree.
    • The-4n, for hacBrewPack, to make completely legal NSPs.
    • SciresM for hactool, which was ported as a library to make NCA extraction a thing in Goldleaf.
    • Thealexbarney, for his C# libraries for various Nintendo Switch formats: LibHac, used by Goldtree.
    • Simon for his libusbK implementation for C#, which has made Goldtree client possible.
    • shchmue for FATFS libs and the system to get titlekeys without breaking processes, found in Lockpick.
    • Translators: unbranched and exelix for Italian, tiliarou and FuryBaguette for French, and LoOkYe for German. (Both English and Spanish were made by me)
    • All the testers, for reporting bugs and helping a lot with the project's development.​

    Enjoy this amazing homebrew!
    Discussion (646 replies)
  1. thaikhoa

    thaikhoa GBAtemp Advanced Maniac

    Sep 16, 2008
    Thanks. If only there's an ability to replace the name and logo.
    Dr.Hacknik and Illuminaticy like this.
  2. mrdude

    mrdude GBAtemp Advanced Fan

    Dec 11, 2015
    Thanks, this looks like a very good homebrew - thanks for posting, i'll definitely be trying this one.
  3. LordApplz

    LordApplz Member

    Sep 22, 2018
    Good Job Xor
    DollyWhipDoll and x65943 like this.
  4. iriez

    iriez GBAtemp Fan

    Oct 27, 2016
    United States
    Congrats on the release. Feels especially rewarding after a certain person claimed you picked up projects and dropped them without spending much time on them.

    Looks real nice.
  5. azoreseuropa

    azoreseuropa GBAtemp Guru

    Nov 6, 2002
    United States
    Last edited by azoreseuropa, Dec 30, 2018
  6. crissal

    crissal GBAtemp Regular

    Dec 3, 2017
    When launched as nro it didn't delete files nor folders, but as nsp works really well. BTW nice job!
    EDIT: some random crashes even with nsp version, especially when entering some menus (config, about, ...) and then entering sd browser
    Last edited by crissal, Dec 30, 2018
  7. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    Oct 27, 2002
    Engine room, learning
    Nice too see more features, like the theme installers or file browser :)
    though, it might be dangerous to allow deleting files from partitions. Do you have proper warning and confirmation? maybe disable it by default, and force users to enable an option to allow deletion.
    I wouldn't want to have to see lot of users requesting help because of bad usage of this feature.

    more questions:
    Did you implement a safety check for title installation?
    permission check, or TitleID mask?

    Does it work with split nsp files?
    Is xci support planned?

    general question:
    anyone had issue with Zadig and libusbk on win7 x64?
    I fear it would mess my current drivers or break Windows.
    Last edited by Cyan, Dec 30, 2018
  8. a9lh-1user

    a9lh-1user Newbie

    An what do you think?!
    The "Troll" delivered ;)

  9. XorTroll

    XorTroll Dev: Goldleaf, emuiibo, Brew.js...

    Dec 28, 2017
    There is no safety for title installing for the moment, but it does warn when the user attempts to delete or paste contents in NAND partitions
    noctis90210 and Cyan like this.
  10. BlastedGuy9905

    BlastedGuy9905 where's the updated autopsy report

    Apr 13, 2017
    United States
    under your desk
    This is AMAZING! One thing though, could you implement a dark theme after a while? Some people really prefer dark over creamish white.
  11. Gee19

    Gee19 Member

    Dec 30, 2018
    Been having a ton of trouble with USB installs lately. It would be sweet to investigate using a transaction to install NSPs so it could be resumed if any parts failed.

    EDIT: Reinstalling libusbK via zadig seemed to help

    I'd be willing to contribute on the C# side of things, anyway keep up the good work man.
    Last edited by Gee19, Dec 30, 2018
  12. Cubuss

    Cubuss GBAtemp Fan

    Aug 4, 2017
    High Quality Shitposter
    Is it possible to mount the sd card to pc with goldtree aswel?
  13. Gee19

    Gee19 Member

    Dec 30, 2018
    I think it strictly communicates with Goldleaf NSP/NRO
  14. Tommy084

    Tommy084 GBAtemp Regular

    Feb 24, 2013
    Great work!!
  15. sj33

    sj33 GBAtemp Psycho!

    Oct 22, 2013
    This is the official replacement for Tinfoil, right? Great stuff.
  16. blawar

    blawar GBAtemp Advanced Fan

    Nov 21, 2016
    United States
    I noticed you didn't harp this project about lack of included licenses :) I thought you were the MIT / ISC license enforcer?

    Nice release XorTroll, it looks well done. Do I have a license to copy everything?

    — Posts automatically merged - Please don't double post! —

    There is no official replacement for Tinfoil, as noone uses tinfoil code (unless you ask @iriez )
    Subtle Demise, mmajunkie77 and vpd like this.
  17. -Pao

    -Pao Member

    Nov 16, 2018
    Thank you so much dude
  18. hippy dave

    hippy dave BBMB

    Apr 30, 2012
    United Kingdom
    Great work on the release!

    Couldn't you detect this (read the required key generation from the nsp and compare to current firmware), and give a more specific error?

    I second the request for a dark theme, and you know I'm gonna keep bugging you about mac support for goldtree! Keep up the good work.
    wicksand420 likes this.
  19. blawar

    blawar GBAtemp Advanced Fan

    Nov 21, 2016
    United States
    Horizon does not expose the NCA header when mounting like he is doing, so there is no way for him to read the master key level. If the user provides keys.txt / prod.keys, he could go well out of his way to decrypt the header and try to figure out what is wrong, but that is a lot of work for very little gain.

    He could try to make an assumption that the master key level for the nca's is the same as the ticket or rights id, but this is not always the case.