diff --git a/.github/workflows/apk-debug.yml b/.github/workflows/apk-debug.yml new file mode 100644 index 00000000..a8f45187 --- /dev/null +++ b/.github/workflows/apk-debug.yml @@ -0,0 +1,34 @@ +name: android-apk-debug + +on: + push: + branches: [ master ] + workflow_dispatch: + +jobs: + build-debug: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "17" + + - name: Set up Android SDK + uses: android-actions/setup-android@v3 + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Build debug APK + run: ./gradlew :apprts:assembleDebug --no-daemon --stacktrace + + - name: Upload debug APK artifact + uses: actions/upload-artifact@v4 + with: + name: rfidtools-debug-apk + path: apprts/build/outputs/apk/debug/*.apk diff --git a/build.gradle b/build.gradle index 4fa0823c..9e6a0b0d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.4.2' classpath('com.github.dcendents:android-maven-gradle-plugin:1.5') } } @@ -16,4 +16,4 @@ allprojects { google() maven { url 'https://jitpack.io' } } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index 25cc80a9..8a12c825 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,8 +7,13 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.daemon=true -org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=JKS -Djdk.internal.platform.disableContainerSupport=true -XX:-UseContainerSupport +org.gradle.java.home=/root/.local/share/mise/installs/java/17.0.2 +systemProp.http.proxyHost=proxy +systemProp.http.proxyPort=8080 +systemProp.https.proxyHost=proxy +systemProp.https.proxyPort=8080 org.gradle.parallel=true org.gradle.configureondemand=true android.useAndroidX=true -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f045c83a..3d1115d0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/libflasher/src/main/cpp/CMakeLists.txt b/libflasher/src/main/cpp/CMakeLists.txt index e71080e8..3444cc87 100644 --- a/libflasher/src/main/cpp/CMakeLists.txt +++ b/libflasher/src/main/cpp/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.4.1) add_definitions("-D__ANDROID_NDK__") #添加预编译宏定义参数,此次的作用是开启配置文件的引入! -add_definitions(-DANDROID -D "getlocaledecpoint()='.'") +add_definitions(-DANDROID -Dgetlocaledecpoint='.') set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O3 -fvisibility=hidden -w") @@ -40,4 +40,4 @@ target_include_directories(pm3_flasher PRIVATE ${PM3_ROOT}/client/uart) #添加动态库链接! -target_link_libraries(pm3_flasher android log z) \ No newline at end of file +target_link_libraries(pm3_flasher android log z) diff --git a/libflasher/src/main/cpp/client/tools.c b/libflasher/src/main/cpp/client/tools.c index 67585bc1..83f846e9 100644 --- a/libflasher/src/main/cpp/client/tools.c +++ b/libflasher/src/main/cpp/client/tools.c @@ -7,6 +7,8 @@ #include #include "stdbool.h" +JavaVM *g_JavaVM = NULL; + //当前线程是否添加的标志位 static bool g_IsAttach; @@ -102,4 +104,4 @@ void recovery_getopt_opt() { opterr = 1; optopt = 0; optarg = NULL; -} \ No newline at end of file +} diff --git a/libflasher/src/main/cpp/client/tools.h b/libflasher/src/main/cpp/client/tools.h index c52a414e..472ab36a 100644 --- a/libflasher/src/main/cpp/client/tools.h +++ b/libflasher/src/main/cpp/client/tools.h @@ -19,7 +19,7 @@ #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__) //全局的环境变量定义 -JavaVM *g_JavaVM; +extern JavaVM *g_JavaVM; //线程环境指针获取函数 JNIEnv *getJniEnv(); @@ -41,4 +41,4 @@ void free_command_line(CMD *); //重置getopt函数 void recovery_getopt_opt(); -#endif //DXL_TOOLS_H \ No newline at end of file +#endif //DXL_TOOLS_H diff --git a/libflasher/src/main/cpp/client/util.h b/libflasher/src/main/cpp/client/util.h index 21db9198..dd327613 100644 --- a/libflasher/src/main/cpp/client/util.h +++ b/libflasher/src/main/cpp/client/util.h @@ -21,8 +21,8 @@ # define FILE_PATH_SIZE 1000 #endif -uint8_t g_debugMode; -uint8_t g_printAndLog; +extern uint8_t g_debugMode; +extern uint8_t g_printAndLog; #define PRINTANDLOG_PRINT 1 #define PRINTANDLOG_LOG 2 diff --git a/libmfkey/src/main/cpp/tools.c b/libmfkey/src/main/cpp/tools.c index 67585bc1..83f846e9 100644 --- a/libmfkey/src/main/cpp/tools.c +++ b/libmfkey/src/main/cpp/tools.c @@ -7,6 +7,8 @@ #include #include "stdbool.h" +JavaVM *g_JavaVM = NULL; + //当前线程是否添加的标志位 static bool g_IsAttach; @@ -102,4 +104,4 @@ void recovery_getopt_opt() { opterr = 1; optopt = 0; optarg = NULL; -} \ No newline at end of file +} diff --git a/libmfkey/src/main/cpp/tools.h b/libmfkey/src/main/cpp/tools.h index c9274f59..538760ed 100644 --- a/libmfkey/src/main/cpp/tools.h +++ b/libmfkey/src/main/cpp/tools.h @@ -19,7 +19,7 @@ #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__) //全局的环境变量定义 -JavaVM *g_JavaVM; +extern JavaVM *g_JavaVM; //线程环境指针获取函数 JNIEnv *getJniEnv(); @@ -41,4 +41,4 @@ void free_command_line(CMD *); //重置getopt函数 void recovery_getopt_opt(); -#endif //DXL_TOOLS_H \ No newline at end of file +#endif //DXL_TOOLS_H diff --git a/libnfc/src/main/cpp/libnfc/include/tools.h b/libnfc/src/main/cpp/libnfc/include/tools.h index c52a414e..472ab36a 100644 --- a/libnfc/src/main/cpp/libnfc/include/tools.h +++ b/libnfc/src/main/cpp/libnfc/include/tools.h @@ -19,7 +19,7 @@ #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__) //全局的环境变量定义 -JavaVM *g_JavaVM; +extern JavaVM *g_JavaVM; //线程环境指针获取函数 JNIEnv *getJniEnv(); @@ -41,4 +41,4 @@ void free_command_line(CMD *); //重置getopt函数 void recovery_getopt_opt(); -#endif //DXL_TOOLS_H \ No newline at end of file +#endif //DXL_TOOLS_H diff --git a/libnfc/src/main/cpp/libnfc/tools.c b/libnfc/src/main/cpp/libnfc/tools.c index f816bdfe..2046cecb 100644 --- a/libnfc/src/main/cpp/libnfc/tools.c +++ b/libnfc/src/main/cpp/libnfc/tools.c @@ -7,6 +7,8 @@ #include #include "stdbool.h" +JavaVM *g_JavaVM = NULL; + //当前线程是否添加的标志位 static bool g_IsAttach; @@ -102,4 +104,4 @@ void recovery_getopt_opt() { opterr = 1; optopt = 0; optarg = NULL; -} \ No newline at end of file +}