Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Apr 23, 2023
1 parent cc5b023 commit ce1e198
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ titles/8000000000001071/Cookie.dat
titles/8000000000001071/dataco.txt
titles/8000000000001071/VisitedLink.dat
titles/8000000000001071/WebStorage.dat
source/DBY.h
Binary file modified out/RipJKAnimeNX.nro
Binary file not shown.
29 changes: 13 additions & 16 deletions source/Networking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,6 @@ int progress_func_str(void* ptr, double TotalToDownload, double NowDownloaded,do
namespace Net {
//string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36";
string UserAgent = "Mozilla/5.0 (Nintendo Switch; WebApplet) AppleWebKit/609.4 (KHTML, like Gecko) NF/6.0.2.22.5 NintendoBrowser/5.1.0.23519";
/*
bool init(){
//this is to ge the user agent of browser WIP
bool change = false;
string UserAgentSet = "UserAgent"+DInfo["Firmware"].get<string>();
if (isset(BD,UserAgentSet)) {
UserAgent = BD[UserAgentSet].get<string>();
} else {
string id = DInfo["DeviceID"].get<string>();
WebBrowserCall("https://????/?set="+id,false);
BD[UserAgentSet] = GET("https://????/?get="+id);
change = true;
}
return change;
}
*/
int DebugNet = 1; //0 no debug , 1 some debug, 2 All debug

//Simplification
Expand Down Expand Up @@ -320,6 +304,19 @@ bool DOWNLOAD(string url,string path,bool progress){
return allok;
}

bool Bypass(){
#if __has_include("Debug.h")
//just for tests
#include "DBY.h"
#else
//just open the browser
WebBrowserCall("https://jkanime.net",false);
#endif
GetCookies();
return change;
}


bool HasConnection(){
NifmInternetConnectionType connectionType;
NifmInternetConnectionStatus connectionStatus;
Expand Down
1 change: 1 addition & 0 deletions source/Networking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ using json = nlohmann::json;

namespace Net {
bool HasConnection();
bool Bypass();
json REQUEST(string url,string POSTFIEL="",bool HEADR=false,bool Verify=false);
bool DOWNLOAD(string url,string path,bool progress = true);

Expand Down
1 change: 1 addition & 0 deletions source/extra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ string CDNURL = "cdn.jkdesu.com";
bool ClFlock = false;
bool Mromfs=true;
bool ThemeNeedUpdate=false;
bool reloadmain = false;

//Screen dimension constants
const int SCREEN_WIDTH = 1280, SCREEN_HEIGHT = 720;
Expand Down
8 changes: 5 additions & 3 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,12 +927,13 @@ int main(int argc, char **argv)
//clock cicle 15s
if (inTimeN(15000)) {
isConnected=Net::HasConnection();

}
if (ClFlock){
//CloudFlare protege este sitio asi q lo abrimos en en navegador
WebBrowserCall("https://jkanime.net/",false);
GetCookies();
Net::Bypass();
ClFlock = false;
reloadmain = true;
}
if (!isConnected) {
gTextTexture.loadFromRenderedText(GOD.digi_16, "Sin Internet", {255,0,0});
Expand All @@ -956,7 +957,8 @@ int main(int argc, char **argv)
if (Frames>1000) Frames=0;
if (Frames>0) Frames++;
//Update tik
if (inTimeN(1260000)) {
if (inTimeN(1260000) || reloadmain) {
reloadmain = false;
if (Net::HasConnection()) {
if(!isChained) {
cout << "Reloading Animes" << endl;
Expand Down
1 change: 1 addition & 0 deletions source/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ extern string CDNURL;
extern bool ClFlock;
extern bool Mromfs;
extern bool ThemeNeedUpdate;
extern bool reloadmain;
//Screen dimension constants
extern const int SCREEN_WIDTH, SCREEN_HEIGHT;

Expand Down

0 comments on commit ce1e198

Please sign in to comment.