Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cdac409
Apply the $DATA match suppression to Core/Universal
dinhngtu Oct 8, 2026
7e72416
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 1)
dinhngtu Oct 8, 2026
daee926
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 2)
dinhngtu Oct 8, 2026
05491e1
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 3)
dinhngtu Oct 8, 2026
e116aa6
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 4)
dinhngtu Oct 8, 2026
5f056ba
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 5)
dinhngtu Oct 8, 2026
c42d87d
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 6)
dinhngtu Oct 10, 2026
58e3b45
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 7)
dinhngtu Oct 10, 2026
dbdf0e2
Add upstream 7-Zip files for NanaZip.Universal.FileManager (part 8)
dinhngtu Oct 10, 2026
9ba9dd1
Add fixes for NanaZip.Universal.FileManager
dinhngtu Oct 10, 2026
e238799
Add NanaZip.Universal.FileManager project files
dinhngtu Oct 10, 2026
3dd6919
Add more fixes for NanaZip.Universal.FileManager
dinhngtu Oct 10, 2026
54dc3e6
Add BrowseDialog2 and more fixes for NanaZip.Universal.FileManager
dinhngtu Oct 10, 2026
b38cf7d
Add more fixes to BrowseDialog2 and Panel in Universal FM
dinhngtu Oct 10, 2026
56845e4
Disable unused resources in Universal FM resource.rc
dinhngtu Oct 10, 2026
8bbc822
Add missing ports and file references for Universal.FM
dinhngtu Oct 10, 2026
32dc6b8
Add some panel fixes
dongle-the-gadget Oct 10, 2026
1c2f13d
Replace NanaZip.Modern.FileManager with NanaZip.Universal.FileManager
dinhngtu Oct 10, 2026
a96321e
Fix WAP entry point
dongle-the-gadget Oct 10, 2026
58b769c
Remove menu bar and fix DWM frame
dongle-the-gadget Oct 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion K7User/K7UserDarkMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ namespace
static bool IsFileManagerWindowClassName(
_In_ LPCWSTR ClassName)
{
return (0 == std::wcscmp(ClassName, L"NanaZip.Modern.FileManager"));
return (0 == std::wcscmp(ClassName, L"NanaZip.Modern.FileManager"))
|| (0 == std::wcscmp(ClassName, L"NanaZip.Universal.FileManager"));
}

static bool IsFileManagerPanelWindowClassName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,20 @@ static void ReplaceIncorrectChars(UString &s)
void Correct_AltStream_Name(UString &s)
{
unsigned len = s.Len();
// **************** NanaZip Modification Start ****************
// ":$DATA" match suppressed in NanaZip because of security risk.
// For example, ":Zone.Identifier:$DATA" can be used to bypass rejection of
// Zone.Identifier streams embedded in the archive.
#if 0 // ******** Annotated 7-Zip Mainline Source Code snippet Start ********
const unsigned kPostfixSize = 6;
if (s.Len() >= kPostfixSize
&& StringsAreEqualNoCase_Ascii(s.RightPtr(kPostfixSize), ":$DATA"))
{
len -= kPostfixSize;
s.DeleteFrom(len);
}
#endif // ******** Annotated 7-Zip Mainline Source Code snippet End ********
// **************** NanaZip Modification End ****************
for (unsigned i = 0; i < len; i++)
{
const wchar_t c = s[i];
Expand Down
175 changes: 175 additions & 0 deletions NanaZip.Universal/NanaZip.UI.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
/*
* PROJECT: NanaZip
* FILE: NanaZip.UI.cpp
* PURPOSE: Implementation for NanaZip Modern UI Shared Infrastructures
*
* LICENSE: The MIT License
*
* MAINTAINER: MouriNaruto (Kenji.Mouri@outlook.com)
*/

#include "NanaZip.UI.h"

#include <Mile.Helpers.h>
#include <Mile.Xaml.h>

#include <NanaZip.Modern.h>

#include "../SevenZip/CPP/Common/Common.h"
#include "../SevenZip/CPP/7zip/UI/Common/LoadCodecs.h"

extern CCodecs* g_CodecsObj;

winrt::handle NanaZip::UI::ShowAboutDialog(
_In_ HWND ParentWindowHandle)
{
return winrt::handle(Mile::CreateThread([=]()
{
UString ExtendedMessage;
if (g_CodecsObj)
{
g_CodecsObj->GetCodecsErrorMessage(ExtendedMessage);
}

::K7ModernShowAboutDialog(ParentWindowHandle, ExtendedMessage);
}));
}

namespace
{
static void SplitCommandLineEx(
std::wstring const& CommandLine,
std::vector<std::wstring> const& OptionPrefixes,
std::vector<std::wstring> const& OptionParameterSeparators,
std::wstring& ApplicationName,
std::map<std::wstring, std::wstring>& OptionsAndParameters,
std::wstring& UnresolvedCommandLine)
{
ApplicationName.clear();
OptionsAndParameters.clear();
UnresolvedCommandLine.clear();

size_t arg_size = 0;
for (auto& SplitArgument : Mile::SplitCommandLineWideString(CommandLine))
{
// We need to process the application name at the beginning.
if (ApplicationName.empty())
{
// For getting the unresolved command line, we need to cumulate
// length which including spaces.
arg_size += SplitArgument.size() + 1;

// Save
ApplicationName = SplitArgument;
}
else
{
bool IsOption = false;
size_t OptionPrefixLength = 0;

for (auto& OptionPrefix : OptionPrefixes)
{
if (0 == _wcsnicmp(
SplitArgument.c_str(),
OptionPrefix.c_str(),
OptionPrefix.size()))
{
IsOption = true;
OptionPrefixLength = OptionPrefix.size();
}
}

if (IsOption)
{
// For getting the unresolved command line, we need to cumulate
// length which including spaces.
arg_size += SplitArgument.size() + 1;

// Get the option name and parameter.

wchar_t* OptionStart = &SplitArgument[0] + OptionPrefixLength;
wchar_t* ParameterStart = nullptr;

for (auto& OptionParameterSeparator
: OptionParameterSeparators)
{
wchar_t* Result = wcsstr(
OptionStart,
OptionParameterSeparator.c_str());
if (nullptr == Result)
{
continue;
}

Result[0] = L'\0';
ParameterStart = Result + OptionParameterSeparator.size();

break;
}

// Save
OptionsAndParameters[(OptionStart ? OptionStart : L"")] =
(ParameterStart ? ParameterStart : L"");
}
else
{
// Get the approximate location of the unresolved command line.
// We use "(arg_size - 1)" to ensure that the program path
// without quotes can also correctly parse.
wchar_t* search_start =
const_cast<wchar_t*>(CommandLine.c_str()) + (arg_size - 1);

// Get the unresolved command line. Search for the beginning of
// the first parameter delimiter called space and exclude the
// first space by adding 1 to the result.
wchar_t* command = wcsstr(search_start, L" ") + 1;

// Omit the space. (Thanks to wzzw.)
while (command && *command == L' ')
{
++command;
}

// Save
if (command)
{
UnresolvedCommandLine = command;
}

break;
}
}
}
}
}

void NanaZip::UI::SpecialCommandHandler()
{
std::wstring ApplicationName;
std::map<std::wstring, std::wstring> OptionsAndParameters;
std::wstring UnresolvedCommandLine;

::SplitCommandLineEx(
std::wstring(::GetCommandLineW()),
std::vector<std::wstring>{ L"-", L"/", L"--" },
std::vector<std::wstring>{ L"=", L":" },
ApplicationName,
OptionsAndParameters,
UnresolvedCommandLine);

bool AcquireSponsorEdition = false;

for (auto& Current : OptionsAndParameters)
{
if (0 == _wcsicmp(Current.first.c_str(), L"AcquireSponsorEdition"))
{
AcquireSponsorEdition = true;
}
}

if (AcquireSponsorEdition)
{
::MileXamlThreadInitialize();
::ExitProcess(::K7ModernShowSponsorDialog(nullptr));
}
}
25 changes: 25 additions & 0 deletions NanaZip.Universal/NanaZip.UI.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* PROJECT: NanaZip
* FILE: NanaZip.UI.h
* PURPOSE: Definition for NanaZip Modern UI Shared Infrastructures
*
* LICENSE: The MIT License
*
* MAINTAINER: MouriNaruto (Kenji.Mouri@outlook.com)
*/

#ifndef NANAZIP_UI
#define NANAZIP_UI

#include <Mile.Helpers.CppBase.h>
#include <Mile.Helpers.CppWinRT.h>

namespace NanaZip::UI
{
winrt::handle ShowAboutDialog(
_In_ HWND ParentWindowHandle);

void SpecialCommandHandler();
}

#endif // !NANAZIP_UI
Loading
Loading