manager: Update zakosign binary with support for arm32 architecture

This commit is contained in:
ShirkNeko
2025-08-14 13:07:58 +08:00
parent 57fcf86579
commit 11a628f536
5 changed files with 11 additions and 9 deletions

View File

@@ -16,9 +16,11 @@ find_library(log-lib log)
if(ANDROID_ABI STREQUAL "arm64-v8a")
set(zakosign-lib ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libzakosign.so)
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
set(zakosign-lib ${CMAKE_SOURCE_DIR}/../jniLibs/armeabi-v7a/libzakosign.so)
endif()
if(ANDROID_ABI STREQUAL "arm64-v8a")
if(ANDROID_ABI STREQUAL "arm64-v8a" OR ANDROID_ABI STREQUAL "armeabi-v7a")
target_link_libraries(zako ${log-lib} ${zakosign-lib})
else()
target_link_libraries(zako ${log-lib})

View File

@@ -415,7 +415,7 @@ NativeBridgeNP(getManagersList, jobject) {
}
NativeBridge(verifyModuleSignature, jboolean, jstring modulePath) {
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
if (!modulePath) {
LogDebug("verifyModuleSignature: modulePath is null");
return false;
@@ -428,7 +428,7 @@ NativeBridge(verifyModuleSignature, jboolean, jstring modulePath) {
LogDebug("verifyModuleSignature: path=%s, result=%d", cModulePath, result);
return result;
#else
LogDebug("verifyModuleSignature: not supported on non-arm64 architecture");
LogDebug("verifyModuleSignature: not supported on non-ARM architecture");
return false;
#endif
}

View File

@@ -11,15 +11,15 @@
#include "prelude.h"
#include "ksu.h"
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
// Zako extern declarations
#define ZAKO_ESV_IMPORTANT_ERROR 1 << 31
extern int zako_sys_file_open(const char* path);
extern uint32_t zako_file_verify_esig(int fd, uint32_t flags);
extern const char* zako_esign_verrcidx2str(uint8_t index);
extern const char* zako_file_verrcidx2str(uint8_t index);
#endif // __aarch64__ || _M_ARM64
#endif // __aarch64__ || _M_ARM64 || __arm__ || _M_ARM
#define KERNEL_SU_OPTION 0xDEADBEEF
@@ -195,7 +195,7 @@ bool get_managers_list(struct manager_list_info* info) {
}
bool verify_module_signature(const char* input) {
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
if (input == NULL) {
LogDebug("verify_module_signature: input path is null");
return false;
@@ -231,7 +231,7 @@ bool verify_module_signature(const char* input) {
}
/* Convert error bit field index into human readable string */
const char* message = zako_esign_verrcidx2str((uint8_t)i);
const char* message = zako_file_verrcidx2str((uint8_t)i);
// Error message: message
if (message != NULL) {
LogDebug("verify_module_signature: Error bit %zu: %s", i, message);
@@ -246,7 +246,7 @@ bool verify_module_signature(const char* input) {
input, results, (results == 0) ? "true" : "false");
return results == 0;
#else
LogDebug("verify_module_signature: not supported on non-arm64 architecture, path=%s", input ? input : "null");
LogDebug("verify_module_signature: not supported on non-ARM architecture, path=%s", input ? input : "null");
return false;
#endif
}