mirror of
https://gitlab.com/Nanolx/homebrewfilter.git
synced 2024-11-24 10:09:21 +01:00
revision 36 - release candidate
This commit is contained in:
parent
156448d538
commit
ed88fe9658
2
Makefile
2
Makefile
@ -45,7 +45,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--section-start,.init=0x8
|
||||
#---------------------------------------------------------------------------------
|
||||
# any extra libraries we wish to link with the project
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBS := -ldi -lpng -lz -lfat -lntfs -lwiiuse -lbte -lasnd -logc -lvorbisidec -lfreetype -lmxml -lext2fs -lzip
|
||||
LIBS := -ldi -lpng -lz -lfat -lntfs -lwiiuse -lbte -lasnd -logc -lvorbisidec -lfreetype -lmxml -lext2fs
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
# include and lib
|
||||
|
10
NEWS
10
NEWS
@ -1,10 +0,0 @@
|
||||
Version 36:
|
||||
- HBF is now OpenSource!
|
||||
- Added license-text of GNU GPL v2
|
||||
- Added support for EXT2/3/4
|
||||
- Adjusted download paths
|
||||
|
||||
TODO Version 36:
|
||||
- Adjust update paths
|
||||
- Unpack theme .zip files
|
||||
- ?
|
11
mkfilelist
Executable file
11
mkfilelist
Executable file
@ -0,0 +1,11 @@
|
||||
ARC=$1
|
||||
THM=$(basename $1 .zip)
|
||||
|
||||
unp -U $1
|
||||
|
||||
cd $THM/
|
||||
|
||||
for i in $(ls -1 *.png *.xml); do \
|
||||
echo "$THM/file:$i" >> temp ; \
|
||||
cat temp | tr "\n" "+" > filelist ; \
|
||||
done
|
37
revisions
Normal file
37
revisions
Normal file
@ -0,0 +1,37 @@
|
||||
36-
|
||||
35-
|
||||
34-
|
||||
33-
|
||||
32-
|
||||
31-
|
||||
30-
|
||||
29-
|
||||
28-
|
||||
27-
|
||||
26-
|
||||
25-
|
||||
24-
|
||||
23-
|
||||
22-
|
||||
21-
|
||||
20-
|
||||
19-
|
||||
18-
|
||||
17-
|
||||
16-
|
||||
15-
|
||||
14-
|
||||
13-
|
||||
12-
|
||||
11-
|
||||
10-
|
||||
9-
|
||||
8-
|
||||
7-
|
||||
6-
|
||||
5-
|
||||
4-
|
||||
3-
|
||||
2-
|
||||
1-
|
||||
end
|
@ -159,7 +159,7 @@ int MenuMain()
|
||||
LogoHomebrewFilterImg.SetPosition(30, 420);
|
||||
LogoHomebrewFilterImg.SetScale(0.65);
|
||||
|
||||
GuiText ownerTxt("hamachi-mp", 18, (GXColor){Theme.owner_1, Theme.owner_2, Theme.owner_3, 255});
|
||||
GuiText ownerTxt("Nano", 18, (GXColor){Theme.owner_1, Theme.owner_2, Theme.owner_3, 255});
|
||||
ownerTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
||||
ownerTxt.SetPosition(-35,430);
|
||||
|
||||
@ -1103,4 +1103,4 @@ int MenuMain()
|
||||
mainWindow->Remove(&Apps);
|
||||
mainWindow->Remove(&w);
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ int MenuSettingsFile()
|
||||
sprintf (Options.theme, options.value[THEME]);
|
||||
DefaultTheme();
|
||||
if(stricmp(Options.theme, tr("STANDARD")) != 0)
|
||||
theme(Settings.device_dat + ":/config/Homebrew Filter/themes/" + Options.theme + "/");
|
||||
theme(Settings.device_dat + ":/config/HBF/themes/" + Options.theme + "/");
|
||||
// Cursor und Hintergrund ändern
|
||||
#ifdef HW_RVL
|
||||
pointer = new GuiImageData(Theme.player_point);
|
||||
@ -445,7 +445,7 @@ int MenuSettingsFile()
|
||||
if(stricmp(Options.language, tr("STANDARD")) == 0)
|
||||
translate();
|
||||
else
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + Options.language + ".lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + Options.language + ".lang");
|
||||
/*********************************************************************/
|
||||
|
||||
AvailableCategory.categories[0] = tr(Settings.category_name_all);
|
||||
|
@ -46,7 +46,7 @@ int MenuSettingsFont()
|
||||
|
||||
DIR *dirHandle;
|
||||
struct dirent * dirEntry;
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Fonts").c_str());
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Fonts").c_str());
|
||||
if (dirHandle) {
|
||||
while (0 != (dirEntry = readdir(dirHandle)))
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ int MenuSettingsLanguage()
|
||||
DIR *dirHandle;
|
||||
struct dirent * dirEntry;
|
||||
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Languages").c_str());
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Languages").c_str());
|
||||
if (dirHandle)
|
||||
{
|
||||
while (0 != (dirEntry = readdir(dirHandle)))
|
||||
|
@ -46,7 +46,7 @@ int MenuSettingsTheme()
|
||||
|
||||
DIR *dirHandle;
|
||||
struct dirent * dirEntry;
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Themes").c_str());
|
||||
dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Themes").c_str());
|
||||
if (dirHandle) {
|
||||
while (0 != (dirEntry = readdir(dirHandle)))
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ void CheckVersion(void)
|
||||
{
|
||||
if(Settings.checkrev == -1)
|
||||
{
|
||||
struct block file = downloadfile("http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/version.txt");
|
||||
struct block file = downloadfile("http://download.tuxfamily.org/hbf/DOL/revisions");
|
||||
if (file.data != NULL)
|
||||
{
|
||||
revs = (char*)file.data;
|
||||
|
@ -12,7 +12,7 @@ bool readrev = true;
|
||||
string CheckNewVersions()
|
||||
{
|
||||
string revs = "error";
|
||||
struct block file = downloadfile("http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/version.txt");
|
||||
struct block file = downloadfile("http://download.tuxfamily.org/hbf/DOL/revisions");
|
||||
if (file.data != NULL)
|
||||
{
|
||||
revs = (char*)file.data;
|
||||
@ -24,7 +24,7 @@ string CheckNewVersions()
|
||||
string NewVersionsText()
|
||||
{
|
||||
string text = "error";
|
||||
struct block file = downloadfile("http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/version_text.txt");
|
||||
struct block file = downloadfile("http://download.tuxfamily.org/hbf/DOL/updates");
|
||||
if (file.data != NULL)
|
||||
{
|
||||
text = (char*)file.data;
|
||||
@ -38,9 +38,9 @@ string new_update(string rev, string filename)
|
||||
{
|
||||
char url[100];
|
||||
if(rev == "Beta")
|
||||
sprintf(url, "http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/Beta/%s", filename.c_str());
|
||||
sprintf(url, "http://download.tuxfamily.org/hbf/DOL//Beta/%s", filename.c_str());
|
||||
else
|
||||
sprintf(url, "http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/rev%s/%s", rev.c_str(), filename.c_str());
|
||||
sprintf(url, "http://download.tuxfamily.org/hbf/DOL/rev%s/%s", rev.c_str(), filename.c_str());
|
||||
|
||||
file = downloadfile(url);
|
||||
if (file.data && file.size > 0)
|
||||
@ -73,7 +73,7 @@ void update(string filename)
|
||||
{
|
||||
if (file.data && file.size > 0)
|
||||
{
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/"+ filename).c_str(), "wb");
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/HBF/"+ filename).c_str(), "wb");
|
||||
if(data)
|
||||
{
|
||||
fwrite(file.data, 1, file.size, data);
|
||||
|
@ -90,7 +90,7 @@ void fontDownload(string fontname)
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data && file.size > 0 && folder_exists())
|
||||
{
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/Fonts/"+ fontname).c_str(), "wb");
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/HBF/Fonts/"+ fontname).c_str(), "wb");
|
||||
if(data)
|
||||
{
|
||||
fwrite(file.data, 1, file.size, data);
|
||||
|
@ -90,7 +90,7 @@ void languageDownload(string languagename)
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data && file.size > 0 && folder_exists())
|
||||
{
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/Languages/"+ languagename).c_str(), "wb");
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/HBF/Languages/"+ languagename).c_str(), "wb");
|
||||
if(data)
|
||||
{
|
||||
fwrite(file.data, 1, file.size, data);
|
||||
|
@ -11,9 +11,8 @@
|
||||
#include "Network/network.h"
|
||||
#include "Network/update.h"
|
||||
#include "Network/http.h"
|
||||
#include "ZipFile.h"
|
||||
|
||||
/*** Extern variables ***/
|
||||
#/*** Extern variables ***/
|
||||
extern GuiWindow * mainWindow;
|
||||
|
||||
/*** Extern functions ***/
|
||||
@ -86,30 +85,45 @@ void themeDownload(string themename)
|
||||
ResumeGui();
|
||||
|
||||
char buffer[100];
|
||||
msgTxt.SetText(themename.c_str());
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Themes/%s", themename.c_str());
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data && file.size > 0)
|
||||
{
|
||||
FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + themename + ".zip").c_str(), "wb");
|
||||
if(data)
|
||||
{
|
||||
fwrite(file.data, 1, file.size, data);
|
||||
fclose(data);
|
||||
}
|
||||
}
|
||||
|
||||
if(file.data)
|
||||
free(file.data);
|
||||
sprintf(buffer, "http://www.nanolx.org/hbf/Themes/%s/filelist", themename.c_str());
|
||||
|
||||
ZipFile *zipfile = new ZipFile((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + themename + ".zip").c_str());
|
||||
zipfile->ExtractAll((Settings.device_dat + ":/config/Homebrew Filter/Themes/").c_str());
|
||||
struct block file = downloadfile(buffer);
|
||||
if (file.data != NULL)
|
||||
{
|
||||
string source_themes = (char*)file.data;
|
||||
|
||||
vector<string> themes;
|
||||
|
||||
while(1)
|
||||
{
|
||||
if((signed)source_themes.find(themename.c_str()) == -1)
|
||||
break;
|
||||
|
||||
source_themes.erase(0, source_themes.find(themename.c_str()) + themename.length() +6);
|
||||
|
||||
themes.push_back(source_themes.substr(0, source_themes.find("+")));
|
||||
|
||||
source_themes.erase(0, source_themes.find("+"));
|
||||
|
||||
}
|
||||
|
||||
for(int i = 0; i < (signed)themes.size(); i++)
|
||||
{
|
||||
msgTxt.SetText(themes[i].c_str());
|
||||
if(new_theme(themename, themes[i]) != "NULL")
|
||||
update("Themes/"+ themename + "/" + themes[i]);
|
||||
}
|
||||
|
||||
free(file.data);
|
||||
}
|
||||
|
||||
|
||||
msgTxt.SetText("");
|
||||
downloadTxt.SetText(tr("finished"));
|
||||
|
||||
promptWindow.Append(&btn1);
|
||||
|
||||
|
||||
while(stop)
|
||||
{
|
||||
usleep(100);
|
||||
|
@ -72,7 +72,7 @@ float GetFontScale()
|
||||
|
||||
void SetFont()
|
||||
{
|
||||
SetupDefaultFont((check_path(Settings.device_dat + ":/config/Homebrew Filter/fonts/") + Options.font).c_str());
|
||||
SetupDefaultFont((check_path(Settings.device_dat + ":/config/HBF/fonts/") + Options.font).c_str());
|
||||
SetFontScale( (float)51 / (float)fontSystem->getWidth(charToWideChar("a"), 100) ); // 51 -> breite von "a" mit standart schrift
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ bool font_folder_exists()
|
||||
{
|
||||
DIR *pDir;
|
||||
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Fonts").c_str());
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Fonts").c_str());
|
||||
|
||||
if(pDir != NULL)
|
||||
{
|
||||
@ -92,7 +92,7 @@ bool font_folder_exists()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Fonts").c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF/Fonts").c_str(), 0777) != -1)
|
||||
{
|
||||
closedir (pDir);
|
||||
return true;
|
||||
|
@ -15,7 +15,7 @@ void Screenshot()
|
||||
bool Exists = false;
|
||||
|
||||
folder_exists();
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Screenshots").c_str());
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Screenshots").c_str());
|
||||
|
||||
if(pDir != NULL)
|
||||
{
|
||||
@ -23,14 +23,14 @@ void Screenshot()
|
||||
closedir (pDir);
|
||||
}
|
||||
else
|
||||
if(mkdir((Settings.device_dat + ":/config/Homebrew Filter/Screenshots").c_str(), 777) != -1)
|
||||
if(mkdir((Settings.device_dat + ":/config/HBF/Screenshots").c_str(), 777) != -1)
|
||||
Exists = true;
|
||||
|
||||
if(Exists)
|
||||
{
|
||||
while(!stop)
|
||||
{
|
||||
sprintf (temp, "%s/%i.png", check_path(Settings.device_dat + ":/config/Homebrew Filter/Screenshots").c_str(), i);
|
||||
sprintf (temp, "%s/%i.png", check_path(Settings.device_dat + ":/config/HBF/Screenshots").c_str(), i);
|
||||
FILE * f= fopen (temp,"r");
|
||||
if (!f)
|
||||
stop = true;
|
||||
|
@ -53,13 +53,13 @@ void load()
|
||||
if (get_setting(source, "theme") != "")
|
||||
{
|
||||
sprintf (Options.theme, get_setting(source, "theme").c_str());
|
||||
theme(check_path(Settings.device_dat + ":/config/Homebrew Filter/themes/") + Options.theme + "/");
|
||||
theme(check_path(Settings.device_dat + ":/config/HBF/themes/") + Options.theme + "/");
|
||||
}
|
||||
|
||||
if(get_setting(source, "language") != "")
|
||||
{
|
||||
sprintf (Options.language, get_setting(source, "language").c_str());
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + Options.language + ".lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + Options.language + ".lang");
|
||||
AvailableCategory.categories[0] = tr(Settings.category_name_all);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ bool folder_exists()
|
||||
|
||||
if(pDir != NULL)
|
||||
{
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter").c_str());
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF").c_str());
|
||||
if(pDir != NULL)
|
||||
{
|
||||
closedir (pDir);
|
||||
@ -32,7 +32,7 @@ bool folder_exists()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter").c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF").c_str(), 0777) != -1)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -40,7 +40,7 @@ bool folder_exists()
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config").c_str(), 0777) != -1)
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter").c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF").c_str(), 0777) != -1)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -324,11 +324,11 @@ bool theme_folder_exists(string theme)
|
||||
DIR *pDir;
|
||||
|
||||
folder_exists();
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Themes").c_str());
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Themes").c_str());
|
||||
|
||||
if(pDir != NULL)
|
||||
{
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Themes/" + theme).c_str());
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Themes/" + theme).c_str());
|
||||
if(pDir != NULL)
|
||||
{
|
||||
closedir (pDir);
|
||||
@ -336,7 +336,7 @@ bool theme_folder_exists(string theme)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + theme).c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF/Themes/" + theme).c_str(), 0777) != -1)
|
||||
{
|
||||
closedir (pDir);
|
||||
return true;
|
||||
@ -345,9 +345,9 @@ bool theme_folder_exists(string theme)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Themes").c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF/Themes").c_str(), 0777) != -1)
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + theme).c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF/Themes/" + theme).c_str(), 0777) != -1)
|
||||
{
|
||||
closedir (pDir);
|
||||
return true;
|
||||
|
@ -69,15 +69,15 @@ const char* tr(string translate)
|
||||
void translate()
|
||||
{
|
||||
if(CONF_GetLanguage() == JAPANESE)
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "japanese.lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "japanese.lang");
|
||||
else if(CONF_GetLanguage() == ENGLISH)
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "english.lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "english.lang");
|
||||
else if(CONF_GetLanguage() == GERMAN)
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "german.lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "german.lang");
|
||||
else if(CONF_GetLanguage() == FRENCH)
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "french.lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "french.lang");
|
||||
else if(CONF_GetLanguage() == SPANISH)
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "spanish.lang");
|
||||
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "spanish.lang");
|
||||
}
|
||||
|
||||
bool language_folder_exists()
|
||||
@ -87,7 +87,7 @@ bool language_folder_exists()
|
||||
{
|
||||
DIR *pDir;
|
||||
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Languages").c_str());
|
||||
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Languages").c_str());
|
||||
|
||||
if(pDir != NULL)
|
||||
{
|
||||
@ -96,7 +96,7 @@ bool language_folder_exists()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Languages").c_str(), 0777) != -1)
|
||||
if (mkdir((Settings.device_dat + ":/config/HBF/Languages").c_str(), 0777) != -1)
|
||||
{
|
||||
closedir (pDir);
|
||||
return true;
|
||||
|
@ -1,328 +0,0 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2009-2011 Dimok
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
****************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/dirent.h>
|
||||
|
||||
//#include "../Prompts/ProgressWindow.h"
|
||||
//#include "../Prompts/PromptWindows.h"
|
||||
//#include "../Language/gettext.h"
|
||||
//#include "../Tools/ShowError.h"
|
||||
#include "ZipFile.h"
|
||||
|
||||
|
||||
ZipFile::ZipFile(const char *filepath, short mode)
|
||||
{
|
||||
if(!filepath)
|
||||
return;
|
||||
|
||||
ZipFilePath = filepath;
|
||||
OpenMode = mode;
|
||||
zFile = 0;
|
||||
uzFile = 0;
|
||||
|
||||
if(OpenMode == ZipFile::OPEN || OpenMode == ZipFile::APPEND)
|
||||
{
|
||||
uzFile = unzOpen(ZipFilePath.c_str());
|
||||
if(uzFile)
|
||||
this->LoadList();
|
||||
}
|
||||
}
|
||||
|
||||
ZipFile::~ZipFile()
|
||||
{
|
||||
ClearList();
|
||||
if(uzFile)
|
||||
unzClose(uzFile);
|
||||
if(zFile)
|
||||
zipClose(zFile, NULL);
|
||||
}
|
||||
|
||||
bool ZipFile::SwitchMode(short mode)
|
||||
{
|
||||
if(mode == ZipFile::OPEN)
|
||||
{
|
||||
if(zFile)
|
||||
{
|
||||
zipClose(zFile, NULL);
|
||||
zFile = 0;
|
||||
}
|
||||
|
||||
if(!uzFile)
|
||||
uzFile = unzOpen(ZipFilePath.c_str());
|
||||
|
||||
return (uzFile != 0);
|
||||
}
|
||||
else if(mode == ZipFile::CREATE || mode == ZipFile::APPEND)
|
||||
{
|
||||
if(uzFile)
|
||||
{
|
||||
unzClose(uzFile);
|
||||
uzFile = 0;
|
||||
}
|
||||
|
||||
if(!zFile)
|
||||
zFile = zipOpen(ZipFilePath.c_str(), mode);
|
||||
|
||||
return (zFile != 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ZipFile::ClearList()
|
||||
{
|
||||
for(u32 i = 0; i < ZipStructure.size(); i++)
|
||||
{
|
||||
if(ZipStructure[i]->filename)
|
||||
delete [] ZipStructure[i]->filename;
|
||||
|
||||
if(ZipStructure[i])
|
||||
delete ZipStructure[i];
|
||||
}
|
||||
|
||||
ZipStructure.clear();
|
||||
std::vector<ArchiveFileStruct *>().swap(ZipStructure);
|
||||
}
|
||||
|
||||
bool ZipFile::LoadList()
|
||||
{
|
||||
ClearList();
|
||||
|
||||
if(!SwitchMode(ZipFile::OPEN))
|
||||
return false;
|
||||
|
||||
int ret = unzGoToFirstFile(uzFile);
|
||||
if(ret != UNZ_OK)
|
||||
return false;
|
||||
|
||||
char filename[1024];
|
||||
unz_file_info cur_file_info;
|
||||
RealArchiveItemCount = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if(unzGetCurrentFileInfo(uzFile, &cur_file_info, filename, sizeof(filename), NULL, 0, NULL, 0) == UNZ_OK)
|
||||
{
|
||||
bool isDir = false;
|
||||
if(filename[strlen(filename)-1] == '/')
|
||||
{
|
||||
isDir = true;
|
||||
filename[strlen(filename)-1] = '\0';
|
||||
}
|
||||
|
||||
int strlength = strlen(filename)+1;
|
||||
|
||||
ArchiveFileStruct * CurArcFile = new ArchiveFileStruct;
|
||||
CurArcFile->filename = new char[strlength];
|
||||
strcpy(CurArcFile->filename, filename);
|
||||
CurArcFile->length = cur_file_info.uncompressed_size;
|
||||
CurArcFile->comp_length = cur_file_info.compressed_size;
|
||||
CurArcFile->isdir = isDir;
|
||||
CurArcFile->fileindex = RealArchiveItemCount;
|
||||
CurArcFile->ModTime = (u64) cur_file_info.dosDate;
|
||||
CurArcFile->archiveType = ZIP;
|
||||
|
||||
ZipStructure.push_back(CurArcFile);
|
||||
}
|
||||
++RealArchiveItemCount;
|
||||
}
|
||||
while(unzGoToNextFile(uzFile) == UNZ_OK);
|
||||
|
||||
PathControl();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ArchiveFileStruct * ZipFile::GetFileStruct(int ind)
|
||||
{
|
||||
if(ind < 0 || ind >= (int) ZipStructure.size())
|
||||
return NULL;
|
||||
|
||||
return ZipStructure[ind];
|
||||
}
|
||||
|
||||
bool ZipFile::SeekFile(int ind)
|
||||
{
|
||||
if(ind < 0 || ind >= (int) ZipStructure.size())
|
||||
return false;
|
||||
|
||||
if(!SwitchMode(ZipFile::OPEN))
|
||||
return false;
|
||||
|
||||
int ret = unzGoToFirstFile(uzFile);
|
||||
if(ret != UNZ_OK)
|
||||
return false;
|
||||
|
||||
while(ind > 0)
|
||||
{
|
||||
if(unzGoToNextFile(uzFile) != UNZ_OK)
|
||||
return false;
|
||||
|
||||
--ind;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ZipFile::CheckMissingPath(const char * path)
|
||||
{
|
||||
if(!path)
|
||||
return;
|
||||
|
||||
u32 i = 0;
|
||||
for(i = 0; i < ZipStructure.size(); i++)
|
||||
{
|
||||
if(strcasecmp(ZipStructure[i]->filename, path) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if(i == ZipStructure.size())
|
||||
{
|
||||
int strlength = strlen(path)+1;
|
||||
ArchiveFileStruct * CurArcFile = new ArchiveFileStruct;
|
||||
CurArcFile->filename = new char[strlength];
|
||||
strcpy(CurArcFile->filename, path);
|
||||
CurArcFile->length = 0;
|
||||
CurArcFile->comp_length = 0;
|
||||
CurArcFile->isdir = true;
|
||||
CurArcFile->fileindex = ZipStructure.size();
|
||||
CurArcFile->ModTime = 0;
|
||||
CurArcFile->archiveType = ZIP;
|
||||
|
||||
ZipStructure.push_back(CurArcFile);
|
||||
}
|
||||
}
|
||||
|
||||
void ZipFile::PathControl()
|
||||
{
|
||||
char missingpath[1024];
|
||||
|
||||
for(u32 n = 0; n < ZipStructure.size(); n++)
|
||||
{
|
||||
const char * filepath = ZipStructure[n]->filename;
|
||||
int strlength = strlen(filepath);
|
||||
|
||||
for(int i = 0; i < strlength; i++)
|
||||
{
|
||||
if(filepath[i] == '/')
|
||||
CheckMissingPath(missingpath);
|
||||
|
||||
missingpath[i] = filepath[i];
|
||||
missingpath[i+1] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ZipFile::ExtractAll(const char *dest)
|
||||
{
|
||||
if(!SwitchMode(OPEN))
|
||||
return -1;
|
||||
|
||||
bool Stop = false;
|
||||
|
||||
u32 blocksize = 1024*70;
|
||||
void *buffer = malloc(blocksize);
|
||||
|
||||
if(!buffer)
|
||||
return -5;
|
||||
|
||||
char writepath[1024];
|
||||
char filename[1024];
|
||||
memset(writepath, 0, sizeof(writepath));
|
||||
memset(filename, 0, sizeof(filename));
|
||||
|
||||
unz_file_info cur_file_info;
|
||||
|
||||
int ret = unzGoToFirstFile(uzFile);
|
||||
if(ret != UNZ_OK)
|
||||
{
|
||||
free(buffer);
|
||||
return -6;
|
||||
}
|
||||
|
||||
while(!Stop)
|
||||
{
|
||||
if(unzGetCurrentFileInfo(uzFile, &cur_file_info, filename, sizeof(filename), NULL, 0, NULL, 0) != UNZ_OK)
|
||||
{
|
||||
Stop = true;
|
||||
}
|
||||
|
||||
if(!Stop && filename[strlen(filename)-1] != '/')
|
||||
{
|
||||
u64 uncompressed_size = cur_file_info.uncompressed_size;
|
||||
|
||||
u64 done = 0;
|
||||
char *pointer = NULL;
|
||||
|
||||
ret = unzOpenCurrentFile(uzFile);
|
||||
|
||||
snprintf(writepath, sizeof(writepath), "%s/%s", dest, filename);
|
||||
|
||||
pointer = strrchr(writepath, '/');
|
||||
int position = pointer-writepath+2;
|
||||
|
||||
char temppath[strlen(writepath)];
|
||||
snprintf(temppath, position, "%s", writepath);
|
||||
|
||||
//CreateSubfolder(temppath);
|
||||
|
||||
if(ret == UNZ_OK)
|
||||
{
|
||||
FILE *pfile = fopen(writepath, "wb");
|
||||
if(!pfile)
|
||||
{
|
||||
free(buffer);
|
||||
fclose(pfile);
|
||||
unzCloseCurrentFile(uzFile);
|
||||
return -8;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if(uncompressed_size - done < blocksize)
|
||||
blocksize = uncompressed_size - done;
|
||||
|
||||
ret = unzReadCurrentFile(uzFile, buffer, blocksize);
|
||||
|
||||
if(ret == 0)
|
||||
break;
|
||||
|
||||
fwrite(buffer, 1, blocksize, pfile);
|
||||
|
||||
done += ret;
|
||||
|
||||
} while(done < uncompressed_size);
|
||||
|
||||
fclose(pfile);
|
||||
unzCloseCurrentFile(uzFile);
|
||||
}
|
||||
}
|
||||
if(unzGoToNextFile(uzFile) != UNZ_OK)
|
||||
{
|
||||
Stop = true;
|
||||
}
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
buffer = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,64 +0,0 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2009-2011 Dimok
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
****************************************************************************/
|
||||
#ifndef _ZIPFILE_H_
|
||||
#define _ZIPFILE_H_
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <zip/zip.h>
|
||||
#include <zip/unzip.h>
|
||||
|
||||
#include "ArchiveStruct.h"
|
||||
|
||||
class ZipFile
|
||||
{
|
||||
public:
|
||||
//!Constructor
|
||||
ZipFile(const char *filepath, short mode = ZipFile::OPEN);
|
||||
//!Destructor
|
||||
~ZipFile();
|
||||
//!Get the archive file structure
|
||||
ArchiveFileStruct * GetFileStruct(int fileIndx);
|
||||
//!Extract all files from a zip file to a directory
|
||||
int ExtractAll(const char *dest);
|
||||
//!Find a file inside the zip and return if it is existent or not
|
||||
bool FindFile(const char *filename);
|
||||
//!Load/Reload of the full item list in the zip
|
||||
bool LoadList();
|
||||
//!Enum for opening modes
|
||||
enum
|
||||
{
|
||||
CREATE = 0,
|
||||
OPEN,
|
||||
APPEND,
|
||||
};
|
||||
private:
|
||||
bool SeekFile(int ind);
|
||||
void PathControl();
|
||||
void CheckMissingPath(const char * path);
|
||||
void ClearList();
|
||||
bool SwitchMode(short mode);
|
||||
|
||||
zipFile zFile;
|
||||
unzFile uzFile;
|
||||
short OpenMode;
|
||||
int RealArchiveItemCount;
|
||||
std::string ZipFilePath;
|
||||
std::vector<ArchiveFileStruct *> ZipStructure;
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@ cat <<EOF > "$PWD"/meta.xml.boot
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<app version="1">
|
||||
<name>Homebrew Filter</name>
|
||||
<coder>Christopher Roy Bratusek<br>
|
||||
<coder>Christopher Roy Bratusek (Nano)<br>
|
||||
hamachi-mp</coder>
|
||||
<version>r$rev_new</version>
|
||||
<no_ios_reload/>
|
||||
@ -22,7 +22,7 @@ cat <<EOF > "$PWD"/meta.xml.installer
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<app version="1">
|
||||
<name>Homebrew Filter Installer</name>
|
||||
<coder>Christopher Roy Bratusek<br>
|
||||
<coder>Christopher Roy Bratusek (Nano)<br>
|
||||
hamachi-mp</coder>
|
||||
<version>r$rev_new</version>
|
||||
<no_ios_reload/>
|
||||
|
204
updates
Normal file
204
updates
Normal file
@ -0,0 +1,204 @@
|
||||
//rev36:
|
||||
- HBF is now OpenSource!
|
||||
- Added license-text of GNU GPL v2
|
||||
- Added support for EXT2/3/4
|
||||
- Adjusted download paths
|
||||
- added mkfilelist helper
|
||||
- compiled with devkitPPC 24 and libogc 1.8.8
|
||||
- new Fonts available for download:
|
||||
- FinalFrontier
|
||||
- FreqModClear
|
||||
- Iwona-Regular
|
||||
- QumpellkaNo12
|
||||
- Zekton
|
||||
|
||||
//rev35:
|
||||
- individuelle Anpassung an den Bildschirm überarbeitet
|
||||
- anzeigen von GC Apps in Kategorien
|
||||
- letzte Version
|
||||
|
||||
//rev34:
|
||||
- TCP-Bug beseitigt
|
||||
- meta.xml kann direkt bearbeitet werden
|
||||
- automatische Netzwerk Initialisierung beim Start (de)aktivierbar
|
||||
- Update-Info (de)aktivierbar
|
||||
- Navigationstasten können getauscht werden (PLUS/MINUS und LINKS/RECHTS)
|
||||
|
||||
//rev33:
|
||||
- übertragen von Apps an die Wii per wiiload
|
||||
- Fehler beim entfernen von der SD-Karte und USB-Geräten behoben
|
||||
|
||||
//rev32:
|
||||
- HBF installer eingeführt
|
||||
- Sprachen müssen jetzt seperat runtergeladen werden wie bei Fonts und Themes
|
||||
- Fehler beim Sortieren von SD und USB behoben
|
||||
- Einstellungen werden im NAND gespeichert
|
||||
- Löschen der Einstellungen ist über die Datenverwaltung möglich
|
||||
|
||||
//rev31:
|
||||
- NTFS Unterstützung
|
||||
- GameCube Apps Unterstützung ( Ordner "gc_apps" )
|
||||
- zuletzt benutztes Gerät wird gespeichert ( SD/USB )
|
||||
- Funktion fürs alphabetische Sortieren in einer Kategorie. ( Taste 1 )
|
||||
- Verschieben von Apps mit gehaltener B Taste
|
||||
- leicht überarbeitete Gui ( Menü und Passwort )
|
||||
- Gleichzeitiges Anzeigen von Programmen auf SD und USB
|
||||
- Config speichern auf SD oder USB
|
||||
|
||||
PS:
|
||||
für GC Apps muss ein kompatibles cMIOS installiert sein
|
||||
|
||||
//rev30:
|
||||
- Fehler in der Navigation beim Theme-download behoben
|
||||
- Sprachen überarbeitet
|
||||
- Japanisch eingefügt
|
||||
- Download und Auswahl von Schriftarten möglich
|
||||
|
||||
//rev29:
|
||||
- starten von BootMii integriert
|
||||
|
||||
//rev28:
|
||||
- Kein Code/Stack-Dump mehr mit dem Wii-Pointer
|
||||
- HOME-Button ruft Menü zum Beenden auf
|
||||
- Fehler beim Starten von Applikationen in der Gitteransicht behoben
|
||||
- Position der Buttons "Laden" und "Einfügen/Entfernen" getauscht
|
||||
- Letzte Katergorie beim Einfügen einer Applikation wird temporär gespeichert
|
||||
|
||||
//rev27:
|
||||
- Wii Pointer Code Dump beseitigt
|
||||
- Arguments-Tag eingeführt
|
||||
- interner Forwarder geändert
|
||||
- fehlender USB-Support für gestartete Apps behoben
|
||||
-> WiiXplorer, WiiMC, ...
|
||||
|
||||
//rev26:
|
||||
- Themes erweitert
|
||||
- Startkategorie eingeführt
|
||||
- Schnellstart eingeführt für Apps
|
||||
- Anzeigefehler beim löschen einer Katgorie behoben
|
||||
- Fehler beim Speichern des Standard Start-IOS
|
||||
- Kindersicherung
|
||||
|
||||
//rev25:
|
||||
- Fehler behoben beim Anzeigen der Beschreibung von Apps
|
||||
- Löschen von Apps von SD und USB
|
||||
- libogc 1.8.5 -> libogc 1.8.4
|
||||
- Info, wenn Update verfügbat ist
|
||||
|
||||
//rev24:
|
||||
- Fehler bei der Auswahl im Themedownload behoben
|
||||
- Fehler beim Abbrechen im Update-Menü behoben
|
||||
|
||||
//rev23:
|
||||
- Navigation in der Grid-Ansicht überarbeitet
|
||||
- Fehler beim speichern von einem erneut geänderten Start-IOS behoben
|
||||
- Fehler bei der Auswahl zum verschieben der Apps behoben
|
||||
- Position und Seite des zuletzt gestarteten App wird gespeichert
|
||||
|
||||
//rev22:
|
||||
- Start-IOS Auswahl wird gespeichert (Ordnername)
|
||||
- Themes downloadbar
|
||||
- Icon-Position in der 5er Ansicht korrigiert
|
||||
|
||||
//rev21:
|
||||
- neuer Forwarder mit IOS 58 und HW_AHBPROT
|
||||
- IOS Anzeige auf was der HBF läuft wird unter Info angezeigt
|
||||
- Start IOS Auswahl für ein App
|
||||
|
||||
//rev20:
|
||||
- automatische Netzwerk Initialisierung beim Start
|
||||
- Rückkehr zum HBF, wenn einen Forwarder mit der Titel ID "HBF0" installiert ist ( beta )
|
||||
|
||||
//rev19:
|
||||
- Design leicht geändert
|
||||
- Beenden Button eingefügt
|
||||
|
||||
//rev18:
|
||||
- Fehler beim kopieren in Kategorien behoben
|
||||
|
||||
//rev17:
|
||||
- Fehler beim erstellen von Kategorien behoben
|
||||
- Kategorien löschen überarbeitet
|
||||
|
||||
//rev16:
|
||||
- Apps auflisten von USB-Geräten
|
||||
- Neuauflistung der Apps beim wechseln von SD-Karte und USB-Gerät
|
||||
|
||||
//rev15:
|
||||
- Anzeigen von unkategorisierten Apps
|
||||
- Info zur Rev beim Online-Update
|
||||
- HBC Channel -> Version, Coder, Beschreibung hinzugefügt
|
||||
|
||||
//rev14:
|
||||
- Gitter-Ansicht hinzugefügt ( Taste 2 )
|
||||
- Wii-Reset-Button -> Rückkehr ins Wii-Menü
|
||||
- Wii-Power-Button -> Schaltet die Wii Aus bzw. in den Standby
|
||||
- HomeBrew Channel in die Liste der Apps mit eingefügt
|
||||
- mit der Home Taste zurück zum HomeBrew Channel wurde entfernt
|
||||
|
||||
//rev13:
|
||||
- Anpassung an den Bildschirm möglich ( beta )
|
||||
|
||||
//rev12:
|
||||
- Sprachen angepasst ( bei manchen Sonderzeichen wurde das Wort abgetrennt )
|
||||
- neue Sprachen hinzugefügt ( french.lang, portuguese.lang, spanish.lang )
|
||||
- Update menü überarbeitet ( Auswahl der Rev möglich )
|
||||
|
||||
//rev11:
|
||||
- fehler beim übergeben des Verzeichnissnamens behoben ( z.B. BootMii Configuration Editor v2.6 )
|
||||
- schnelleres einlesen der Kategorien
|
||||
- paar Schönheitsfehler beseitigt
|
||||
|
||||
//rev10:
|
||||
- update funktion eingebaut
|
||||
- probleme beim laden behoben (priiloader, forwarder, wiiload, exploit)
|
||||
- "kategorien.dat" wurde zu "categories.dat"
|
||||
- pfade geändert von settings.xml, categories.dat -> "Root/Config/Homebrew Filter/"
|
||||
|
||||
//rev9:
|
||||
- englische Sprache hinzugefügt
|
||||
- Screenshot erstellen ( 1 + 2 gleichzeitig drücken )
|
||||
|
||||
//rev8:
|
||||
- wegen total verlust neu gecodet
|
||||
- lange Beschreibung
|
||||
- Kategorien verschieben
|
||||
- neue Einstellmöglichkeiten
|
||||
|
||||
//rev7:
|
||||
- Themes können nun ausgewählt werden
|
||||
- Design angepasst
|
||||
|
||||
//rev6:
|
||||
- eigene Themes
|
||||
-> muss im Ordner vom HBF sein "Themes/default"
|
||||
-> bsp: (sd:/apps/Homebrew Filter/Themes/default)
|
||||
|
||||
//rev5:
|
||||
- kategorie umbenennen
|
||||
- Fehler mit der Breite des App-Namen behoben ( Dank an Dimok )
|
||||
|
||||
//rev4:
|
||||
- apps verschieben
|
||||
|
||||
//rev3:
|
||||
- Pfeile navigieren eingefügt
|
||||
|
||||
//rev2:
|
||||
- bugfixes
|
||||
|
||||
//rev1:
|
||||
- erste Veröffentlichung
|
||||
|
||||
//rev_Beta:
|
||||
- beta test
|
||||
- NTFS Unterstützung
|
||||
- GameCube Apps Unterstützung ( Ordner "gc_apps" )
|
||||
- zuletzt benutztes Gerät wird gespeichert ( SD/USB )
|
||||
- Funktion fürs alphabetische Sortieren in einer Kategorie. ( Taste 1 )
|
||||
- Verschieben von Apps mit gedrückter B Taste
|
||||
- leicht überarbeitete Gui ( Menü und Passwort )
|
||||
- Gleichzeitiges Anzeigen von Programmen auf SD und USB
|
||||
- Config speichern auf SD oder USB
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user