diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ff92284 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +name: Build AtmoXL-Titel-Installer + +on: [push, pull_request] + +jobs: + Build: + runs-on: ubuntu-latest + container: devkitpro/devkita64:latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Update packages + run: | + sudo -n apt-get update + sudo -n apt-get upgrade -y patch autoconf automake diffutils pkgconf fakeroot git file tar bzip2 + sudo -n dkp-pacman --noconfirm -U \ + "https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.2-1-any.pkg.tar.xz" + + - name: Silence all git safe directory warnings + run: git config --system --add safe.directory '*' + + - name: Checkout latest libnx commit + run: | + git clone --recurse-submodules https://github.com/switchbrew/libnx.git + + - name: Checkout latest libusbhsfs commit + run: | + git clone https://github.com/DarkMatterCore/libusbhsfs.git + + - name: Set workspace permissions + run: chmod 777 -R "$GITHUB_WORKSPACE" + + - name: Build and install libnx + run: | + cd libnx + make install -j$(nproc) + + - name: Build libusbhsfs dependencies + run: | + cd libusbhsfs + cd libntfs-3g; su -s /bin/bash nobody -c "dkp-makepkg -c -C -f" > /dev/null; sudo -n dkp-pacman -U --needed --noconfirm *.pkg.tar.* > /dev/null; cd .. + cd liblwext4; su -s /bin/bash nobody -c "dkp-makepkg -c -C -f" > /dev/null; sudo -n dkp-pacman -U --needed --noconfirm *.pkg.tar.* > /dev/null; cd .. + make BUILD_TYPE=GPL release + + - name: Build AtmoXL-Titel-Installer + run: | + make -j$(nproc) + + - uses: actions/upload-artifact@v3 + with: + name: AtmoXL-Titel-Installer + path: AtmoXL-Titel-Installer.nro + if-no-files-found: error diff --git a/Makefile b/Makefile index 1488adb..4167bbf 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ LIBS += -lz -lssh2 -lusbhsfs -lntfs-3g -llwext4 -lmbedtls -lmbedcrypto -lmbedx50 # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- -LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/include/Plutonium/Plutonium/Output +LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/include/Plutonium/Plutonium/Output $(CURDIR)/libusbhsfs #--------------------------------------------------------------------------------- diff --git a/source/install/install_nsp.cpp b/source/install/install_nsp.cpp index cae1b07..35aee96 100644 --- a/source/install/install_nsp.cpp +++ b/source/install/install_nsp.cpp @@ -69,7 +69,8 @@ namespace tin::install::nsp NcmContentInfo cnmtContentInfo; cnmtContentInfo.content_id = cnmtContentId; - *(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF; + ncmU64ToContentInfoSize(cnmtNcaSize & 0xFFFFFFFFFFFF, &cnmtContentInfo); + //*(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF; cnmtContentInfo.content_type = NcmContentType_Meta; CNMTList.push_back( { tin::util::GetContentMetaFromNCA(cnmtNCAFullPath), cnmtContentInfo } ); @@ -182,4 +183,4 @@ namespace tin::install::nsp ASSERT_OK(esImportTicket(tikBuf.get(), tikSize, certBuf.get(), certSize), "Failed to import ticket"); } } -} \ No newline at end of file +} diff --git a/source/install/install_xci.cpp b/source/install/install_xci.cpp index 9b229a4..ccacd14 100644 --- a/source/install/install_xci.cpp +++ b/source/install/install_xci.cpp @@ -65,7 +65,8 @@ namespace tin::install::xci NcmContentInfo cnmtContentInfo; cnmtContentInfo.content_id = cnmtContentId; - *(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF; + ncmU64ToContentInfoSize(cnmtNcaSize & 0xFFFFFFFFFFFF, &cnmtContentInfo); + //*(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF; cnmtContentInfo.content_type = NcmContentType_Meta; CNMTList.push_back( { tin::util::GetContentMetaFromNCA(cnmtNCAFullPath), cnmtContentInfo } ); @@ -181,4 +182,4 @@ namespace tin::install::xci ASSERT_OK(esImportTicket(tikBuf.get(), tikSize, certBuf.get(), certSize), "Failed to import ticket"); } } -} \ No newline at end of file +} diff --git a/source/nx/fs.cpp b/source/nx/fs.cpp index 445e275..43895c5 100644 --- a/source/nx/fs.cpp +++ b/source/nx/fs.cpp @@ -116,7 +116,7 @@ namespace nx::fs path.reserve(FS_MAX_PATH); std::string errorMsg = "Failed to open file system with id: " + path; - rc = fsOpenFileSystemWithId(&m_fileSystem, titleId, fileSystemType, path.c_str()); + rc = fsOpenFileSystemWithId(&m_fileSystem, titleId, fileSystemType, path.c_str(), FsContentAttributes_All); if (rc == 0x236e02) errorMsg = "File " + path + " is unreadable! You may have a bad dump, fs_mitm may need to be removed, or your firmware version may be too low to decrypt it.";