XorTroll / Goldleaf

🍂 Multipurpose homebrew tool for Nintendo Switch
GNU General Public License v3.0
2.59k stars 350 forks source link

Add support for direct .NCA installation #119

Open platinumleaf opened 5 years ago

platinumleaf commented 5 years ago

.NSP as an installation format is DRM for official devs using DevMenu; there are no particular benefits to using .NSPs, unlike 3DS-era .CIAs there is no native system code to support them, they essentially act as generic containers the way they're being used in DevMenu and GoldLeaf; the code to install a .NCA directly (or even a ZIPed one) would be simpler than the code used for installing .NSPs even, not needing privileged calls unlike .NSP. Given this, it would be nice if GoldLeaf also supported installing .NCA files directly, without them being inside of an NSP container, or perhaps even inside of a generic ZIP.

Proof of this stuff, from ReSwitched's #switch-hacking-meta channel:

AnalogMan - 28/08/2018
So, assuming we did have a homebrew way to build these ticketless homebrew NSPs that are floating around, what's the consensus on using homebrew as an NSP? Benefits I see are they run as apps instead of applets, can be suspended, and obviously don't require hijacking the Album applet. Downsides are they add more icons to the already unorganizable screen, are harder to update (requiring a reinstall rather than updating the NRO, though there are homebrew NSPs that are just forwarders) and increased ban risk. However these titles don't seem to appear in your play log? Not sure why, perhaps because they have no ticket?

SciresM - 28/08/2018
They do
Anything launched from home screen telemetries prepo shit to N.
I tested + REd that quite thoroughly.

AnalogMan - 28/08/2018
So the consensus is pretty much never then. Until all telemetry is figured out and safely blocked homebrew NSPs will never be recommended.

SciresM - 28/08/2018
Also NSP as an install format is just total warez nonsense
There's zero system code to support it
CIA was one thing where there were sysmodule calls to ease install and explicit OS level support for the format
NSP has literally zero of that.
It's just mounted as an IFilesystem, zero difference from a directory.
It's just pirates stealing SDK submission format :P

AnalogMan - 28/08/2018
Alright, what would be the proper term then? If you did make homebrew that was meant to be installed to the home screen how would you distribute it? A zip of NCA files?

SciresM - 28/08/2018
As a folder, yeah.
There's zero OS level imperative to use NSP over a zipped folder
No sysmodule IPC support for it
It's in fact more complicated if anything because you need to use privileged MountContent calls.
(To open an NSP as a directory)

AnalogMan - 28/08/2018
Wonder why DevMnuApp uses it then. I think that's the only reason it because the go to format since that was the only way they had to install it at the time.

SciresM - 28/08/2018
(Which is...identical to incoming code as a directory)
DevMenuApp --> warez
Not really good impetus

AnalogMan - 28/08/2018
Yes, but I mean for it's intended purpose, as a tool for licensed devs

SciresM - 28/08/2018
I don't buy that pitch.
:P

stuckpixel - 28/08/2018
(he's asking, why use nsp at all)
(even for official devs)

SciresM - 28/08/2018
As a homebrew community we shouldn't be bogged down by stupid support driven by warez-only imperatives. The code to install from a directory is literally simpler than from NSP.

AnalogMan - 28/08/2018
It's not a pitch, I am just wondering out loud why an official tool made by Nintendo for the SDK for devs to use only takes NSP files.

AnalogMan - 28/08/2018
I'm not saying we should use them

SciresM - 28/08/2018
Because it allows for them to lock installation to a single app which contains an FS privilege games do not
(The relevant MountContent cmd that mounts an NSP as a directory)
It is literally just a way of preventing devs from writing their own installers.
It's DRM.
Because that's the SDK nature -- it's why signature for ACID pubk exists
N signs an ACID so devs can use the key in it but not elevate their perms

AnalogMan - 28/08/2018
Ah, so it's a limit placed on devs then. Interesting.

SciresM - 28/08/2018
Yes. NSP has no place in homebrew imo. Directory is simpler code-wise.
And functionally identical.
(And is also not a format that literally only exists because warez, which is a bonus)
Adubbz commented 5 years ago

Extracted NSP installation is literally exactly this. It's a folder of NCAs. Also, no special privileges are needed for nsps, the functions to do so are just used for convenience. PFS0 parsing code is extremely simple to write, however it is not necessary as there is no benefit to doing so.

nnsee commented 5 years ago

already a feature.

XorTroll commented 5 years ago

This can eb a good idea, specially for system NCAs, and not very complex to be added. A warning should be added anyway as end users shouldn't use NCAs directly.

Aliasim800 commented 3 years ago

Great feature to add and I'm on board with it. Would be great to also install a directory which is hosting NCA files instead of just being able to install one NCA at a time.