mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-08-20 15:44:27 -05:00
Add default keys for file Optimize CCs
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE -DCMAKE_PREPARE_WINDOWS_DRIVERS=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE -DCMAKE_PREPARE_WINDOWS_DRIVERS=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE -DCMAKE_PREPARE_WINDOWS_DRIVERS=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE -DCMAKE_PREPARE_WINDOWS_DRIVERS=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE -DCMAKE_PREPARE_WINDOWS_DRIVERS=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE -DCMAKE_PREPARE_WINDOWS_DRIVERS=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled
This commit is contained in:
@@ -58,6 +58,7 @@ void ActualConsoleOutText(std::string out_string);
|
||||
std::string get_base_path(bool for_presets, bool do_existence_check=true);
|
||||
std::string get_base_path_keys();
|
||||
std::string get_base_path_device_specific_configs();
|
||||
std::string get_optimize_keys_file_path(bool is_new_device);
|
||||
std::string LayoutNameGenerator(int index);
|
||||
std::string LayoutPathGenerator(int index);
|
||||
std::string load_layout_name(int index, bool &success);
|
||||
|
||||
@@ -81,6 +81,7 @@ echo "${HOME}/${KIOSK_SINGLE_EXECUTION_SCRIPT}" >> ${HOME}/.bashrc
|
||||
# Copy the real program...
|
||||
sudo rm -f ${BASE_TARGET_DIR}/${PROGRAM_NAME}_script.sh
|
||||
sudo cp -Rf ${BASE_SOURCE_DIR}/files/main_files/* ${BASE_TARGET_DIR}/
|
||||
sudo cp -f ${BASE_SOURCE_DIR}/instructions.txt ${BASE_TARGET_DIR}/
|
||||
if [ $(getconf LONG_BIT) -eq 32 ]; then
|
||||
$(cd ${HOME} ; rm -f ${PROGRAM_NAME}_link ; ln -s ${BASE_TARGET_DIR}/${PROGRAM_NAME}_versions/${PROGRAM_NAME}_32 ${PROGRAM_NAME}_link)
|
||||
else
|
||||
|
||||
@@ -1317,18 +1317,8 @@ bool cyop_is_key_for_device(CaptureDevice* device, std::string key) {
|
||||
return check_key_matches_device_id(device->device_id, key, (const cyop_device_usb_device*)device->descriptor);
|
||||
}
|
||||
|
||||
static std::string get_keys_file_path(bool is_new_device) {
|
||||
std::string path = get_base_path_keys();
|
||||
|
||||
if(is_new_device)
|
||||
path += "optimize_new_3ds.txt";
|
||||
else
|
||||
path += "optimize_old_3ds.txt";
|
||||
return path;
|
||||
}
|
||||
|
||||
static std::string read_key_for_device_id_from_file(uint64_t device_id, bool is_new_device) {
|
||||
std::ifstream file(get_keys_file_path(is_new_device));
|
||||
std::ifstream file(get_optimize_keys_file_path(is_new_device));
|
||||
std::string line;
|
||||
std::string out_key = "";
|
||||
|
||||
@@ -1363,7 +1353,7 @@ static void add_key_for_device_id_to_file(uint64_t device_id, std::string key, b
|
||||
if(read_key_for_device_id_from_file(device_id, is_new_device) == key)
|
||||
return;
|
||||
|
||||
std::ofstream file(get_keys_file_path(is_new_device), std::ios_base::app | std::ios_base::out);
|
||||
std::ofstream file(get_optimize_keys_file_path(is_new_device), std::ios_base::app | std::ios_base::out);
|
||||
file << key << std::endl;
|
||||
file.close();
|
||||
}
|
||||
|
||||
@@ -926,6 +926,30 @@ static bool create_folder(const std::string path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool create_file(const std::string path, std::string base_content) {
|
||||
try {
|
||||
#if (!defined(_MSC_VER)) || (_MSC_VER > 1916)
|
||||
bool file_exists = std::filesystem::exists(path);
|
||||
#else
|
||||
bool file_exists = std::experimental::filesystem::exists(path);
|
||||
#endif
|
||||
if(file_exists)
|
||||
return true;
|
||||
std::ofstream file(path, std::ios_base::app | std::ios_base::out);
|
||||
if(!file.good()) {
|
||||
ActualConsoleOutTextError("Error creating file " + path);
|
||||
return false;
|
||||
}
|
||||
file << base_content << std::endl;
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
catch(...) {
|
||||
ActualConsoleOutTextError("Error creating file " + path);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool create_out_folder() {
|
||||
bool success = create_folder(get_base_path(false, false));
|
||||
if(!success)
|
||||
@@ -933,6 +957,8 @@ static bool create_out_folder() {
|
||||
create_folder(get_base_path(true));
|
||||
create_folder(get_base_path_keys());
|
||||
create_folder(get_base_path_device_specific_configs());
|
||||
create_file(get_optimize_keys_file_path(true), "THIS-ISAN-EXAM-PLE0-KEY0\nONE0-LINE-FOR0-ONE0-KEY0");
|
||||
create_file(get_optimize_keys_file_path(false), "THIS-ISAN-EXAM-PLE0-KEY0\nONE0-LINE-FOR0-ONE0-KEY0");
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
@@ -410,6 +410,16 @@ std::string get_base_path_device_specific_configs() {
|
||||
return get_base_path(false) + "device_specific_configs/";
|
||||
}
|
||||
|
||||
std::string get_optimize_keys_file_path(bool is_new_device) {
|
||||
std::string path = get_base_path_keys();
|
||||
|
||||
if(is_new_device)
|
||||
path += "optimize_new_3ds.txt";
|
||||
else
|
||||
path += "optimize_old_3ds.txt";
|
||||
return path;
|
||||
}
|
||||
|
||||
std::string LayoutPathGenerator(int index) {
|
||||
return get_base_path(index != STARTUP_FILE_INDEX);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user