mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-21 02:45:07 +00:00
Cleanup
This commit is contained in:
parent
4210a1ee37
commit
16b986a76a
@ -174,8 +174,6 @@ bool install(const std::string& path) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "1");
|
|
||||||
|
|
||||||
target_path_lock.lock();
|
target_path_lock.lock();
|
||||||
const std::string renamed_target_path = std::format("{}/{}", app_parent_path, manifest.appId);
|
const std::string renamed_target_path = std::format("{}/{}", app_parent_path, manifest.appId);
|
||||||
if (file::isDirectory(renamed_target_path)) {
|
if (file::isDirectory(renamed_target_path)) {
|
||||||
@ -187,7 +185,6 @@ bool install(const std::string& path) {
|
|||||||
}
|
}
|
||||||
target_path_lock.unlock();
|
target_path_lock.unlock();
|
||||||
|
|
||||||
TT_LOG_I(TAG, "2");
|
|
||||||
target_path_lock.lock();
|
target_path_lock.lock();
|
||||||
if (rename(app_target_path.c_str(), renamed_target_path.c_str()) != 0) {
|
if (rename(app_target_path.c_str(), renamed_target_path.c_str()) != 0) {
|
||||||
TT_LOG_E(TAG, "Failed to rename \"%s\" to \"%s\"", app_target_path.c_str(), manifest.appId.c_str());
|
TT_LOG_E(TAG, "Failed to rename \"%s\" to \"%s\"", app_target_path.c_str(), manifest.appId.c_str());
|
||||||
@ -198,10 +195,8 @@ bool install(const std::string& path) {
|
|||||||
|
|
||||||
manifest.appLocation = Location::external(renamed_target_path);
|
manifest.appLocation = Location::external(renamed_target_path);
|
||||||
|
|
||||||
TT_LOG_I(TAG, "3");
|
|
||||||
addApp(manifest);
|
addApp(manifest);
|
||||||
|
|
||||||
TT_LOG_I(TAG, "4");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,55 +64,45 @@ bool parseManifest(const std::map<std::string, std::string>& map, AppManifest& m
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "a");
|
|
||||||
|
|
||||||
if (!isValidManifestVersion(manifest.manifestVersion)) {
|
if (!isValidManifestVersion(manifest.manifestVersion)) {
|
||||||
TT_LOG_E(TAG, "Invalid version");
|
TT_LOG_E(TAG, "Invalid version");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "b");
|
|
||||||
// [app]
|
// [app]
|
||||||
|
|
||||||
if (!getValueFromManifest(map, "[app]id", manifest.appId)) {
|
if (!getValueFromManifest(map, "[app]id", manifest.appId)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "c");
|
|
||||||
if (!isValidId(manifest.appId)) {
|
if (!isValidId(manifest.appId)) {
|
||||||
TT_LOG_E(TAG, "Invalid app id");
|
TT_LOG_E(TAG, "Invalid app id");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "d");
|
|
||||||
if (!getValueFromManifest(map, "[app]name", manifest.appName)) {
|
if (!getValueFromManifest(map, "[app]name", manifest.appName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "e");
|
|
||||||
if (!isValidName(manifest.appName)) {
|
if (!isValidName(manifest.appName)) {
|
||||||
TT_LOG_I(TAG, "Invalid app name");
|
TT_LOG_I(TAG, "Invalid app name");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "f");
|
|
||||||
if (!getValueFromManifest(map, "[app]versionName", manifest.appVersionName)) {
|
if (!getValueFromManifest(map, "[app]versionName", manifest.appVersionName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "g");
|
|
||||||
if (!isValidAppVersionName(manifest.appVersionName)) {
|
if (!isValidAppVersionName(manifest.appVersionName)) {
|
||||||
TT_LOG_E(TAG, "Invalid app version name");
|
TT_LOG_E(TAG, "Invalid app version name");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "h");
|
|
||||||
std::string version_code_string;
|
std::string version_code_string;
|
||||||
if (!getValueFromManifest(map, "[app]versionCode", version_code_string)) {
|
if (!getValueFromManifest(map, "[app]versionCode", version_code_string)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "i");
|
|
||||||
if (!isValidAppVersionCode(version_code_string)) {
|
if (!isValidAppVersionCode(version_code_string)) {
|
||||||
TT_LOG_E(TAG, "Invalid app version code");
|
TT_LOG_E(TAG, "Invalid app version code");
|
||||||
return false;
|
return false;
|
||||||
@ -122,17 +112,14 @@ bool parseManifest(const std::map<std::string, std::string>& map, AppManifest& m
|
|||||||
|
|
||||||
// [target]
|
// [target]
|
||||||
|
|
||||||
TT_LOG_I(TAG, "j");
|
|
||||||
if (!getValueFromManifest(map, "[target]sdk", manifest.targetSdk)) {
|
if (!getValueFromManifest(map, "[target]sdk", manifest.targetSdk)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TT_LOG_I(TAG, "k");
|
|
||||||
|
|
||||||
if (!getValueFromManifest(map, "[target]platforms", manifest.targetPlatforms)) {
|
if (!getValueFromManifest(map, "[target]platforms", manifest.targetPlatforms)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TT_LOG_I(TAG, "l");
|
|
||||||
// Defaults
|
// Defaults
|
||||||
|
|
||||||
manifest.appCategory = Category::User;
|
manifest.appCategory = Category::User;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user