made update checking more variable
This commit is contained in:
parent
95b3e9d02c
commit
b970de23a5
@ -8,5 +8,7 @@
|
|||||||
#define INVALID_KEY 1
|
#define INVALID_KEY 1
|
||||||
|
|
||||||
#define VERSION "v1.1"
|
#define VERSION "v1.1"
|
||||||
|
#define VERSIONS_URL "https://raw.githubusercontent.com/ENDev-WHY2/WHY2-Encryption-System/c/versions.json"
|
||||||
|
#define VERSIONS_NAME "versions.json"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,10 +19,10 @@ encryptText(char *text, char *keyNew)
|
|||||||
|
|
||||||
//CURL VARIABLES
|
//CURL VARIABLES
|
||||||
CURL *curl = curl_easy_init();
|
CURL *curl = curl_easy_init();
|
||||||
FILE *fileBuffer = fopen("versions.json", "w");
|
FILE *fileBuffer = fopen(VERSIONS_NAME, "w");
|
||||||
|
|
||||||
//GET versions.json
|
//GET versions.json
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "https://raw.githubusercontent.com/ENDev-WHY2/WHY2-Encryption-System/c/versions.json");
|
curl_easy_setopt(curl, CURLOPT_URL, VERSIONS_URL);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fileBuffer);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fileBuffer);
|
||||||
|
|
||||||
//DOWNLOAD versions.json
|
//DOWNLOAD versions.json
|
||||||
@ -33,7 +33,7 @@ encryptText(char *text, char *keyNew)
|
|||||||
fclose(fileBuffer);
|
fclose(fileBuffer);
|
||||||
|
|
||||||
//JSON VARIABLES
|
//JSON VARIABLES
|
||||||
FILE *jsonFile = fopen("versions.json", "r");
|
FILE *jsonFile = fopen(VERSIONS_NAME, "r");
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
char lineBuffer[64];
|
char lineBuffer[64];
|
||||||
struct json_object *parsedJson;
|
struct json_object *parsedJson;
|
||||||
@ -169,4 +169,4 @@ encryptText(char *text, char *keyNew)
|
|||||||
free(key);
|
free(key);
|
||||||
|
|
||||||
return returningText;
|
return returningText;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user