v6.4.0 fix updater
This commit is contained in:
BIN
.prjctmngr
Normal file
BIN
.prjctmngr
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,92 +0,0 @@
|
|||||||
EXPORTS
|
|
||||||
curl_easy_cleanup @1
|
|
||||||
curl_easy_duphandle @2
|
|
||||||
curl_easy_escape @3
|
|
||||||
curl_easy_getinfo @4
|
|
||||||
curl_easy_header @5
|
|
||||||
curl_easy_init @6
|
|
||||||
curl_easy_nextheader @7
|
|
||||||
curl_easy_option_by_id @8
|
|
||||||
curl_easy_option_by_name @9
|
|
||||||
curl_easy_option_next @10
|
|
||||||
curl_easy_pause @11
|
|
||||||
curl_easy_perform @12
|
|
||||||
curl_easy_recv @13
|
|
||||||
curl_easy_reset @14
|
|
||||||
curl_easy_send @15
|
|
||||||
curl_easy_setopt @16
|
|
||||||
curl_easy_strerror @17
|
|
||||||
curl_easy_unescape @18
|
|
||||||
curl_easy_upkeep @19
|
|
||||||
curl_escape @20
|
|
||||||
curl_formadd @21
|
|
||||||
curl_formfree @22
|
|
||||||
curl_formget @23
|
|
||||||
curl_free @24
|
|
||||||
curl_getdate @25
|
|
||||||
curl_getenv @26
|
|
||||||
curl_global_cleanup @27
|
|
||||||
curl_global_init @28
|
|
||||||
curl_global_init_mem @29
|
|
||||||
curl_global_sslset @30
|
|
||||||
curl_maprintf @31
|
|
||||||
curl_mfprintf @32
|
|
||||||
curl_mime_addpart @33
|
|
||||||
curl_mime_data @34
|
|
||||||
curl_mime_data_cb @35
|
|
||||||
curl_mime_encoder @36
|
|
||||||
curl_mime_filedata @37
|
|
||||||
curl_mime_filename @38
|
|
||||||
curl_mime_free @39
|
|
||||||
curl_mime_headers @40
|
|
||||||
curl_mime_init @41
|
|
||||||
curl_mime_name @42
|
|
||||||
curl_mime_subparts @43
|
|
||||||
curl_mime_type @44
|
|
||||||
curl_mprintf @45
|
|
||||||
curl_msnprintf @46
|
|
||||||
curl_msprintf @47
|
|
||||||
curl_multi_add_handle @48
|
|
||||||
curl_multi_assign @49
|
|
||||||
curl_multi_cleanup @50
|
|
||||||
curl_multi_fdset @51
|
|
||||||
curl_multi_info_read @52
|
|
||||||
curl_multi_init @53
|
|
||||||
curl_multi_perform @54
|
|
||||||
curl_multi_poll @55
|
|
||||||
curl_multi_remove_handle @56
|
|
||||||
curl_multi_setopt @57
|
|
||||||
curl_multi_socket @58
|
|
||||||
curl_multi_socket_action @59
|
|
||||||
curl_multi_socket_all @60
|
|
||||||
curl_multi_strerror @61
|
|
||||||
curl_multi_timeout @62
|
|
||||||
curl_multi_wait @63
|
|
||||||
curl_multi_wakeup @64
|
|
||||||
curl_mvaprintf @65
|
|
||||||
curl_mvfprintf @66
|
|
||||||
curl_mvprintf @67
|
|
||||||
curl_mvsnprintf @68
|
|
||||||
curl_mvsprintf @69
|
|
||||||
curl_pushheader_byname @70
|
|
||||||
curl_pushheader_bynum @71
|
|
||||||
curl_share_cleanup @72
|
|
||||||
curl_share_init @73
|
|
||||||
curl_share_setopt @74
|
|
||||||
curl_share_strerror @75
|
|
||||||
curl_slist_append @76
|
|
||||||
curl_slist_free_all @77
|
|
||||||
curl_strequal @78
|
|
||||||
curl_strnequal @79
|
|
||||||
curl_unescape @80
|
|
||||||
curl_url @81
|
|
||||||
curl_url_cleanup @82
|
|
||||||
curl_url_dup @83
|
|
||||||
curl_url_get @84
|
|
||||||
curl_url_set @85
|
|
||||||
curl_url_strerror @86
|
|
||||||
curl_version @87
|
|
||||||
curl_version_info @88
|
|
||||||
curl_ws_meta @89
|
|
||||||
curl_ws_recv @90
|
|
||||||
curl_ws_send @91
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -23,8 +23,8 @@ std::mutex PageManager::torAnmeldeNamenMutex;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
PageManager::PageManager(std::string sock5ProxyOnlyAddress)
|
PageManager::PageManager(std::string agent, std::string sock5ProxyOnlyAddress)
|
||||||
: sock5Proxy("socks5://" + sock5ProxyOnlyAddress)
|
: sock5Proxy("socks5://" + sock5ProxyOnlyAddress), agent(agent)
|
||||||
{
|
{
|
||||||
std::srand(std::time(0)); // Seed the random number generator
|
std::srand(std::time(0)); // Seed the random number generator
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
@@ -166,7 +166,7 @@ Reply PageManager::getServerRequest(std::string protocol, std::string Url, bool
|
|||||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); //follows redirection
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); //follows redirection
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); // Funktion zum Speichern des outputs in einem string
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); // Funktion zum Speichern des outputs in einem string
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); //Legt die Variable readbuffer fest
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); //Legt die Variable readbuffer fest
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, agent.c_str());
|
||||||
/*"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0" */
|
/*"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0" */
|
||||||
if(useCookies)
|
if(useCookies)
|
||||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, cookieFilePath.c_str());
|
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, cookieFilePath.c_str());
|
||||||
@@ -274,7 +274,6 @@ int PageManager::downLoadToFile(std::string filePath, std::string url, int rek_n
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CURL *curl_handle;
|
CURL *curl_handle;
|
||||||
FILE *pagefile;
|
FILE *pagefile;
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
@@ -307,10 +306,10 @@ int PageManager::downLoadToFile(std::string filePath, std::string url, int rek_n
|
|||||||
curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str());
|
curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str());
|
||||||
|
|
||||||
/* Switch on full protocol/debug output while testing */
|
/* Switch on full protocol/debug output while testing */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, false);
|
curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, debugMode);
|
||||||
|
|
||||||
/* disable progress meter, set to 0L to enable and disable debug output */
|
/* disable progress meter, set to 0L to enable and disable debug output */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, false);
|
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, !debugMode);
|
||||||
|
|
||||||
/* send all data to this function */
|
/* send all data to this function */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
|
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
|
||||||
@@ -338,9 +337,6 @@ int PageManager::downLoadToFile(std::string filePath, std::string url, int rek_n
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//User Agent
|
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0");
|
|
||||||
|
|
||||||
/* write the page body to this file handle */
|
/* write the page body to this file handle */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile);
|
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile);
|
||||||
|
|
||||||
@@ -349,7 +345,7 @@ int PageManager::downLoadToFile(std::string filePath, std::string url, int rek_n
|
|||||||
|
|
||||||
//Against cloudflare!
|
//Against cloudflare!
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L); //follows redirection
|
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L); //follows redirection
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, USER_AGENT);
|
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, agent.c_str());
|
||||||
|
|
||||||
int maxTimeOut = 5;
|
int maxTimeOut = 5;
|
||||||
bool failed = false;
|
bool failed = false;
|
||||||
@@ -378,6 +374,7 @@ int PageManager::downLoadToFile(std::string filePath, std::string url, int rek_n
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char *url_after;
|
char *url_after;
|
||||||
//Get Url
|
//Get Url
|
||||||
res = curl_easy_getinfo(curl_handle, CURLINFO_EFFECTIVE_URL, &url_after);
|
res = curl_easy_getinfo(curl_handle, CURLINFO_EFFECTIVE_URL, &url_after);
|
||||||
@@ -387,7 +384,7 @@ int PageManager::downLoadToFile(std::string filePath, std::string url, int rek_n
|
|||||||
return 12;
|
return 12;
|
||||||
} else if(url_after){
|
} else if(url_after){
|
||||||
|
|
||||||
if(std::string(url_after).find("/_ray/pow")) {
|
if(std::string(url_after).find("/_ray/pow") != std::string::npos) {
|
||||||
std::cout << " \33[2K\r => CLOUD FLARE PROTECTION (Try " << rek_num << "/15)..." << std::flush;
|
std::cout << " \33[2K\r => CLOUD FLARE PROTECTION (Try " << rek_num << "/15)..." << std::flush;
|
||||||
usleep(400000);
|
usleep(400000);
|
||||||
|
|
||||||
@@ -863,6 +860,13 @@ void PageManager::generateNewTorAnmeldeNamen(std::string alterName) {
|
|||||||
torAnmeldeNamenMutex.unlock();
|
torAnmeldeNamenMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PageManager::setAgent(const std::string &newAgent)
|
||||||
|
{
|
||||||
|
if(debugMode)
|
||||||
|
std::cout << " => Info: Using User Agent: " << newAgent << std::endl;
|
||||||
|
agent = newAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first, bool withWarnMsg)
|
std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first, bool withWarnMsg)
|
||||||
{
|
{
|
||||||
|
@@ -36,7 +36,7 @@ struct checkNameRply {
|
|||||||
class PageManager
|
class PageManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageManager(std::string sock5ProxyOnlyAddress = "127.0.0.1:9150");
|
PageManager(std::string agent, std::string sock5ProxyOnlyAddress = "127.0.0.1:9150");
|
||||||
~PageManager();
|
~PageManager();
|
||||||
|
|
||||||
void setProxy(std::string ip, int port);
|
void setProxy(std::string ip, int port);
|
||||||
@@ -78,6 +78,9 @@ public:
|
|||||||
static void generateNewTorAnmeldeNamen(std::string alterName);
|
static void generateNewTorAnmeldeNamen(std::string alterName);
|
||||||
|
|
||||||
std::string sock5Proxy;
|
std::string sock5Proxy;
|
||||||
|
std::string agent;
|
||||||
|
void setAgent(const std::string &newAgent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool debugMode = false;
|
bool debugMode = false;
|
||||||
};
|
};
|
||||||
|
@@ -206,6 +206,9 @@ int loadDefaulOptions(Settings &settings)
|
|||||||
ofs << "# -> Einstellung gleicht dem Parameter -d, --debug-mode:" << std::endl;
|
ofs << "# -> Einstellung gleicht dem Parameter -d, --debug-mode:" << std::endl;
|
||||||
ofs << "#DebugModus=false" << std::endl << std::endl;
|
ofs << "#DebugModus=false" << std::endl << std::endl;
|
||||||
|
|
||||||
|
ofs << "# -> Überschreibe USER AGENT, Default: " << _USER_AGENT << std::endl;
|
||||||
|
ofs << "#USER_AGENT=" << std::endl << std::endl;
|
||||||
|
|
||||||
ofs << "# -> Einstellung gleicht dem Parameter -p, --socks5-proxy:" << std::endl;
|
ofs << "# -> Einstellung gleicht dem Parameter -p, --socks5-proxy:" << std::endl;
|
||||||
ofs << "# Verwende den Port 0 um keinen Proxy zu verwenden." << std::endl;
|
ofs << "# Verwende den Port 0 um keinen Proxy zu verwenden." << std::endl;
|
||||||
ofs << "Socks5Proxy=127.0.0.1:9150" << std::endl << std::endl;
|
ofs << "Socks5Proxy=127.0.0.1:9150" << std::endl << std::endl;
|
||||||
@@ -304,6 +307,9 @@ int loadDefaulOptions(Settings &settings)
|
|||||||
if(data != settings.defaultFileVersion)
|
if(data != settings.defaultFileVersion)
|
||||||
std::cout << " => Warnung: Veraltetes Defaults-File. Löschen sie die Datei, um die neuste Version zu bekommen." << std::endl;
|
std::cout << " => Warnung: Veraltetes Defaults-File. Löschen sie die Datei, um die neuste Version zu bekommen." << std::endl;
|
||||||
|
|
||||||
|
} else if (what == "USER_AGENT") {
|
||||||
|
settings.genaueHoster=data;
|
||||||
|
|
||||||
} else if (what == "DebugModus") {
|
} else if (what == "DebugModus") {
|
||||||
if(data == "true")
|
if(data == "true")
|
||||||
settings.debugMode=true;
|
settings.debugMode=true;
|
||||||
|
@@ -22,14 +22,14 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
|
||||||
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
|
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/public.php/dav/files/tXz7SWdaPJ7TacZ/"
|
||||||
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
|
#define SecondUpdaterCloudUrlWithPath "https://snew4.m4rkus28.de/"
|
||||||
#define VERSION "6.3.4"
|
#define VERSION "6.4.0"
|
||||||
#define DEFAULT_FILE_VERSION "2.5"
|
#define DEFAULT_FILE_VERSION "2.6"
|
||||||
|
|
||||||
|
|
||||||
// user agent
|
// user agent
|
||||||
#define USER_AGENT "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0"
|
#define _USER_AGENT "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36"
|
||||||
//"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
|
//"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
|
||||||
|
|
||||||
|
|
||||||
@@ -143,6 +143,7 @@ struct Settings {
|
|||||||
|
|
||||||
std::vector<std::string> outputFilePaths;
|
std::vector<std::string> outputFilePaths;
|
||||||
|
|
||||||
|
std::string user_agent = _USER_AGENT;
|
||||||
|
|
||||||
Modus modus = Modus::EXIT;
|
Modus modus = Modus::EXIT;
|
||||||
bool colorless = false,
|
bool colorless = false,
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
ProgramManager::ProgramManager()
|
ProgramManager::ProgramManager()
|
||||||
: nextThread(0)
|
: pageManager(PageManager(_USER_AGENT)), nextThread(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,8 @@ int ProgramManager::start(Settings *settings)
|
|||||||
{
|
{
|
||||||
pageManager.setDebugMode(settings->debugMode);
|
pageManager.setDebugMode(settings->debugMode);
|
||||||
pageManager.setProxy(settings->proxy_ip, settings->proxy_port);
|
pageManager.setProxy(settings->proxy_ip, settings->proxy_port);
|
||||||
|
pageManager.setAgent(settings->user_agent);
|
||||||
|
|
||||||
if(dirExists(settings->cookieFilePath)) {
|
if(dirExists(settings->cookieFilePath)) {
|
||||||
std::cout << " => Error: Kann Cokkie-File nicht erstellen: \n '"
|
std::cout << " => Error: Kann Cokkie-File nicht erstellen: \n '"
|
||||||
<< settings->cookieFilePath << "'." << std::endl;
|
<< settings->cookieFilePath << "'." << std::endl;
|
||||||
@@ -1529,9 +1531,21 @@ int ProgramManager::updateModus(Settings *settings)
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << " => INFO: Suche nach der neusten Version..." << std::endl;
|
std::cout << " => INFO: Suche nach der neusten Version... (save to " << settings->cacheDir << "version.txt" << " )..." << std::endl;
|
||||||
std::string html = pageManager.getServerRequest("", UpdaterCloudUrlWithPath + settings->VersionFileName).html;
|
if( pageManager.downLoadToFile( settings->cacheDir + "version.txt", UpdaterCloudUrlWithPath + settings->VersionFileName) != 0) {
|
||||||
if( html == "-1" || html == "" || html.find("\n") == std::string::npos) {
|
std::cerr << " => Error: Download newst Version failed." << std::endl;
|
||||||
|
return 87;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream file(settings->cacheDir + "version.txt");
|
||||||
|
if (!file) {
|
||||||
|
std::cerr << " => Failed to open file: " << settings->cacheDir << "version.txt" << std::endl;
|
||||||
|
return 89;
|
||||||
|
}
|
||||||
|
std::string html((std::istreambuf_iterator<char>(file)),
|
||||||
|
std::istreambuf_iterator<char>());
|
||||||
|
|
||||||
|
if( html == "-1" || html.find("Interner Serverfehler") != std::string::npos || html == "" || html.find("\n") == std::string::npos) {
|
||||||
std::cerr << (" => Warnung: Verwende 2t-Link für Download!") << std::endl;
|
std::cerr << (" => Warnung: Verwende 2t-Link für Download!") << std::endl;
|
||||||
html = pageManager.getServerRequest( "", SecondUpdaterCloudUrlWithPath + settings->VersionFileName).html;
|
html = pageManager.getServerRequest( "", SecondUpdaterCloudUrlWithPath + settings->VersionFileName).html;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user