Skip to content

Commit fb899c4

Browse files
committed
Add GitHub Action to build debug APK
1 parent 3acecfe commit fb899c4

File tree

13 files changed

+63
-18
lines changed

13 files changed

+63
-18
lines changed

.github/workflows/apk-debug.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: android-apk-debug
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-debug:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: "temurin"
19+
java-version: "17"
20+
21+
- name: Set up Android SDK
22+
uses: android-actions/setup-android@v3
23+
24+
- name: Make gradlew executable
25+
run: chmod +x ./gradlew
26+
27+
- name: Build debug APK
28+
run: ./gradlew :apprts:assembleDebug --no-daemon --stacktrace
29+
30+
- name: Upload debug APK artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: rfidtools-debug-apk
34+
path: apprts/build/outputs/apk/debug/*.apk

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
google()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:7.1.2'
8+
classpath 'com.android.tools.build:gradle:7.4.2'
99
classpath('com.github.dcendents:android-maven-gradle-plugin:1.5')
1010
}
1111
}
@@ -16,4 +16,4 @@ allprojects {
1616
google()
1717
maven { url 'https://jitpack.io' }
1818
}
19-
}
19+
}

gradle.properties

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
99
org.gradle.daemon=true
10-
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10+
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
11+
org.gradle.java.home=/root/.local/share/mise/installs/java/17.0.2
12+
systemProp.http.proxyHost=proxy
13+
systemProp.http.proxyPort=8080
14+
systemProp.https.proxyHost=proxy
15+
systemProp.https.proxyPort=8080
1116
org.gradle.parallel=true
1217
org.gradle.configureondemand=true
1318
android.useAndroidX=true
14-
android.enableJetifier=true
19+
android.enableJetifier=true

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip

gradlew

100644100755
File mode changed.

libflasher/src/main/cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.4.1)
55
add_definitions("-D__ANDROID_NDK__")
66

77
#添加预编译宏定义参数,此次的作用是开启配置文件的引入!
8-
add_definitions(-DANDROID -D "getlocaledecpoint()='.'")
8+
add_definitions(-DANDROID -Dgetlocaledecpoint='.')
99

1010
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O3 -fvisibility=hidden -w")
1111

@@ -40,4 +40,4 @@ target_include_directories(pm3_flasher PRIVATE
4040
${PM3_ROOT}/client/uart)
4141

4242
#添加动态库链接!
43-
target_link_libraries(pm3_flasher android log z)
43+
target_link_libraries(pm3_flasher android log z)

libflasher/src/main/cpp/client/tools.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <tools.h>
88
#include "stdbool.h"
99

10+
JavaVM *g_JavaVM = NULL;
11+
1012
//当前线程是否添加的标志位
1113
static bool g_IsAttach;
1214

@@ -102,4 +104,4 @@ void recovery_getopt_opt() {
102104
opterr = 1;
103105
optopt = 0;
104106
optarg = NULL;
105-
}
107+
}

libflasher/src/main/cpp/client/tools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__)
2020

2121
//全局的环境变量定义
22-
JavaVM *g_JavaVM;
22+
extern JavaVM *g_JavaVM;
2323

2424
//线程环境指针获取函数
2525
JNIEnv *getJniEnv();
@@ -41,4 +41,4 @@ void free_command_line(CMD *);
4141
//重置getopt函数
4242
void recovery_getopt_opt();
4343

44-
#endif //DXL_TOOLS_H
44+
#endif //DXL_TOOLS_H

libflasher/src/main/cpp/client/util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
# define FILE_PATH_SIZE 1000
2222
#endif
2323

24-
uint8_t g_debugMode;
25-
uint8_t g_printAndLog;
24+
extern uint8_t g_debugMode;
25+
extern uint8_t g_printAndLog;
2626
#define PRINTANDLOG_PRINT 1
2727
#define PRINTANDLOG_LOG 2
2828

libmfkey/src/main/cpp/tools.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <tools.h>
88
#include "stdbool.h"
99

10+
JavaVM *g_JavaVM = NULL;
11+
1012
//当前线程是否添加的标志位
1113
static bool g_IsAttach;
1214

@@ -102,4 +104,4 @@ void recovery_getopt_opt() {
102104
opterr = 1;
103105
optopt = 0;
104106
optarg = NULL;
105-
}
107+
}

0 commit comments

Comments
 (0)