diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d01cdec..a0d6729 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,9 @@ jobs: zip pmt-static-armeabi-v7a.zip pmt_static echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV echo "BUILD=${{ github.workspace }}/pmt" >> $GITHUB_ENV + cd .. + echo -e "Read [Wiki - About Release Types](https://github.com/ShawkTeam/pmt-renovated/wiki/About-Release-Types) for getting more information.\n\n### Changes\n" > release.txt + git log --since="2025-08-21" --pretty=format:" * %ad | [%s](https://github.com/ShawkTeam/pmt-renovated/commit/%H)" --date=short | sed 's/ -.*//' | grep -v cleanup >> release.txt working-directory: ${{ github.workspace }} - name: Upload To GitHub Releases @@ -60,4 +63,4 @@ jobs: ${{ env.BUILD }}/build_armeabi-v7a/*.zip name: Partition Manager Tool Release ${{ env.BUILD_DATE }} tag_name: ${{ env.BUILD_DATE }} - body: "Read [Wiki - About Release Types](https://github.com/ShawkTeam/pmt-renovated/wiki/About-Release-Types) for getting more information." + body_path: ${{ env.BUILD }}/release.txt diff --git a/src/FunctionManager.cpp b/src/FunctionManager.cpp index 3aeca39..322d047 100644 --- a/src/FunctionManager.cpp +++ b/src/FunctionManager.cpp @@ -15,12 +15,12 @@ */ #include +#include #include #include #include #include #include -#include namespace PartitionManager { std::vector splitIfHasDelim(const std::string &s, const char delim, @@ -96,9 +96,11 @@ bool basic_function_manager::hasFlagOnUsedFunction(const int flag) const { for (const auto &func : _functions) { if (func->isUsed()) { std::for_each(func->flags.begin(), func->flags.end(), [&](const int x) { - LOGN(PMTF, INFO) << "Used flag " << x << " on " << func->name() << std::endl; + LOGN(PMTF, INFO) << "Used flag " << x << " on " << func->name() + << std::endl; }); - return std::find(func->flags.begin(), func->flags.end(), flag) != func->flags.end(); + return std::find(func->flags.begin(), func->flags.end(), flag) != + func->flags.end(); } } return false; diff --git a/src/PartitionManager.cpp b/src/PartitionManager.cpp index 7b96dcd..ec320d4 100644 --- a/src/PartitionManager.cpp +++ b/src/PartitionManager.cpp @@ -47,13 +47,13 @@ __attribute__((constructor)) void init() { } static void sigHandler(const int sig) { - if (sig == SIGINT) println("\n%sInterrupted.%s", YELLOW, STYLE_RESET); + if (sig == SIGINT) println("\n%sInterrupted.%s", YELLOW, STYLE_RESET); if (sig == SIGABRT) println("\n%sAborted.%s", RED, STYLE_RESET); exit(sig); } static int write(void *cookie, const char *buf, const int size) { - auto *real = static_cast(cookie); + auto *real = static_cast(cookie); if (!VARS.quietProcess) { const int ret = fwrite(buf, 1, static_cast(size), real); fflush(real); @@ -163,9 +163,8 @@ int Main(int argc, char **argv) { if (!Helper::hasSuperUser() && !FuncManager.hasFlagOnUsedFunction(NO_SU)) { if (!(FuncManager.hasFlagOnUsedFunction(ADB_SUFFICIENT) && - Helper::hasAdbPermissions())) { - throw Error( - "This function is requires super-user privileges!"); + Helper::hasAdbPermissions())) { + throw Error("This function is requires super-user privileges!"); } } diff --git a/src/functions/CleanLogFunction.cpp b/src/functions/CleanLogFunction.cpp index 3d68110..7ccd957 100644 --- a/src/functions/CleanLogFunction.cpp +++ b/src/functions/CleanLogFunction.cpp @@ -22,7 +22,8 @@ Copyright 2025 Yağız Zengin namespace PartitionManager { INIT { - LOGN(CFUN, INFO) << "Initializing variables of clean log function." << std::endl; + LOGN(CFUN, INFO) << "Initializing variables of clean log function." + << std::endl; flags = {FunctionFlags::NO_MAP_CHECK, FunctionFlags::NO_SU}; cmd = _app.add_subcommand("clean-logs", "Clean PMT logs."); return true; diff --git a/src/functions/InfoFunction.cpp b/src/functions/InfoFunction.cpp index 59d203f..881cb5f 100644 --- a/src/functions/InfoFunction.cpp +++ b/src/functions/InfoFunction.cpp @@ -42,17 +42,12 @@ INIT { "Print info(s) as JSON body. The body of each partition will " "be written separately") ->default_val(false); - cmd->add_flag("--as-byte", asByte, - "View sizes as byte.") - ->default_val(true); - cmd->add_flag("--as-kilobyte", asKiloBytes, - "View sizes as kilobyte.") + cmd->add_flag("--as-byte", asByte, "View sizes as byte.")->default_val(true); + cmd->add_flag("--as-kilobyte", asKiloBytes, "View sizes as kilobyte.") ->default_val(false); - cmd->add_flag("--as-megabyte", asMega, - "View sizes as megabyte.") + cmd->add_flag("--as-megabyte", asMega, "View sizes as megabyte.") ->default_val(false); - cmd->add_flag("--as-gigabyte", asGiga, - "View sizes as gigabyte.") + cmd->add_flag("--as-gigabyte", asGiga, "View sizes as gigabyte.") ->default_val(false); cmd->add_option("--json-partition-name", jNamePartition, "Specify partition name element for JSON body") @@ -90,10 +85,13 @@ RUN { } if (jsonFormat) - jParts.push_back({partition, {std::stoull(Helper::convertTo(props.size, multiple)), props.isLogical}}); + jParts.push_back({partition, + {std::stoull(Helper::convertTo(props.size, multiple)), + props.isLogical}}); else - println("partition=%s size=%s isLogical=%s", - partition.data(), Helper::convertTo(props.size, multiple).data(), props.isLogical ? "true" : "false"); + println("partition=%s size=%s isLogical=%s", partition.data(), + Helper::convertTo(props.size, multiple).data(), + props.isLogical ? "true" : "false"); return true; }; diff --git a/srclib/libhelper/include/libhelper/lib.hpp b/srclib/libhelper/include/libhelper/lib.hpp index 73894c1..3831a63 100644 --- a/srclib/libhelper/include/libhelper/lib.hpp +++ b/srclib/libhelper/include/libhelper/lib.hpp @@ -20,12 +20,12 @@ #include #include #include +#include #include #include #include #include #include -#include #define KB(x) (static_cast(x) * 1024) // KB(8) = 8192 (8 * 1024) #define MB(x) (KB(x) * 1024) // MB(4) = 4194304 (KB(4) * 1024) @@ -96,9 +96,8 @@ private: public: ~garbageCollector(); - template - void delAfterProgress(T *_ptr) { - _cleaners.push_back([_ptr] { delete[] _ptr; }); + template void delAfterProgress(T *_ptr) { + _cleaners.push_back([_ptr] { delete[] _ptr; }); } void delFileAfterProgress(const std::string &_path); @@ -115,13 +114,11 @@ void set(std::string_view name, std::string_view file); void setProgramName(std::string_view name); void setLogFile(std::string_view file); -template -void setPrinting() { +template void setPrinting() { if (state == 1 || state == 0) PRINT = state; else PRINT = NO; } -template -void setLoggingState() { +template void setLoggingState() { if (state == 1 || state == 0) DISABLE = state; else DISABLE = NO; } @@ -352,8 +349,7 @@ std::string convertTo(uint64_t size, const std::string &multiple); /** * Convert input size to input multiple */ -template -std::string convertTo(const std::string &multiple) { +template std::string convertTo(const std::string &multiple) { if (multiple == "KB") return std::to_string(TO_KB(size)); if (multiple == "MB") return std::to_string(TO_MB(size)); if (multiple == "GB") return std::to_string(TO_GB(size)); diff --git a/srclib/libhelper/src/Classes.cpp b/srclib/libhelper/src/Classes.cpp index 0094d13..02f9aee 100644 --- a/srclib/libhelper/src/Classes.cpp +++ b/srclib/libhelper/src/Classes.cpp @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/srclib/libhelper/src/Utilities.cpp b/srclib/libhelper/src/Utilities.cpp index 581d96c..0a5f2f8 100644 --- a/srclib/libhelper/src/Utilities.cpp +++ b/srclib/libhelper/src/Utilities.cpp @@ -25,6 +25,7 @@ #else #include #endif +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/srclib/libpartition_map/include/libpartition_map/lib.hpp b/srclib/libpartition_map/include/libpartition_map/lib.hpp index a702a1f..b4bc9b9 100644 --- a/srclib/libpartition_map/include/libpartition_map/lib.hpp +++ b/srclib/libpartition_map/include/libpartition_map/lib.hpp @@ -87,7 +87,7 @@ public: explicit operator bool() const; Info operator[](int index) const; - BasicInf operator[](const std::string_view& name) const; + BasicInf operator[](const std::string_view &name) const; operator std::vector() const; operator int() const; @@ -363,7 +363,7 @@ public: /** * Get BasicInfo structure with given index */ - BasicInf operator[](const std::string_view& name) const; + BasicInf operator[](const std::string_view &name) const; /** * Get map contents as vector (PartitionManager::Info type). diff --git a/srclib/libpartition_map/src/PartitionMap.cpp b/srclib/libpartition_map/src/PartitionMap.cpp index 20fa8cc..29eae5b 100644 --- a/srclib/libpartition_map/src/PartitionMap.cpp +++ b/srclib/libpartition_map/src/PartitionMap.cpp @@ -136,8 +136,7 @@ basic_partition_map_builder::basic_partition_map_builder() { LOGN(MAP, ERROR) << "Cannot build map by any default search entry." << std::endl; - LOGN(MAP, INFO) << "default constructor ended work." - << std::endl; + LOGN(MAP, INFO) << "default constructor ended work." << std::endl; _insert_logicals(_build_map("/dev/block/mapper", true)); _map_builded = true; } @@ -420,7 +419,8 @@ Info basic_partition_map_builder::operator[](const int index) const { return _current_map[index]; } -BasicInf basic_partition_map_builder::operator[](const std::string_view& name) const { +BasicInf +basic_partition_map_builder::operator[](const std::string_view &name) const { return _current_map[name]; } diff --git a/srclib/libpartition_map/src/Type.cpp b/srclib/libpartition_map/src/Type.cpp index 6cc5921..d893846 100644 --- a/srclib/libpartition_map/src/Type.cpp +++ b/srclib/libpartition_map/src/Type.cpp @@ -184,9 +184,7 @@ std::string basic_partition_map::find_(const std::string &name) const { size_t basic_partition_map::size() const { return _count; } -bool basic_partition_map::empty() const { - return _count == 0; -} +bool basic_partition_map::empty() const { return _count == 0; } void basic_partition_map::clear() { LOGN(MAP, INFO) << "map clean requested. Cleaning..." << std::endl; @@ -228,20 +226,16 @@ bool basic_partition_map::operator!=(const basic_partition_map &other) const { return !(*this == other); } -basic_partition_map::operator bool() const{ - return _count > 0; -} +basic_partition_map::operator bool() const { return _count > 0; } -bool basic_partition_map::operator!() const{ - return _count == 0; -} +bool basic_partition_map::operator!() const { return _count == 0; } Info basic_partition_map::operator[](const int index) const { if (_count == 0 || index >= _count) return {}; return _data[index]; } -BasicInf basic_partition_map::operator[](const std::string_view& name) const { +BasicInf basic_partition_map::operator[](const std::string_view &name) const { if (_count == 0) return {}; if (const int i = _index_of(name); name == _data[i].name)