Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add android GUI client #33

Merged
merged 30 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d3fcdc7
feat: add gomobile bindings for Android GUI
peanut996 Nov 19, 2024
bf91fa3
fix time duration
peanut996 Nov 19, 2024
19e96de
feat: add android project and update gitignore
peanut996 Nov 19, 2024
9eb8d88
chore: add gradle wrapper
peanut996 Nov 19, 2024
b47a09d
complete Android project init.
peanut996 Nov 19, 2024
4a6e813
add src file.
peanut996 Nov 19, 2024
83d9252
fix public key.
peanut996 Nov 19, 2024
c424002
update workflow
peanut996 Nov 19, 2024
70d2499
fix pipeline
peanut996 Nov 19, 2024
848d3d0
change test config.
peanut996 Nov 20, 2024
67e110e
remove gomobile
peanut996 Nov 20, 2024
c423562
use raw kotlin to build code.
peanut996 Nov 20, 2024
7dc740c
use raw kotlin to test
peanut996 Nov 20, 2024
96013b8
fix max scan point.
peanut996 Dec 20, 2024
a5ff157
add ipPortTextView
peanut996 Dec 20, 2024
f141c8a
get all result from channel.
peanut996 Dec 20, 2024
66a2e21
change max scan count to 100.
peanut996 Dec 20, 2024
cdb0eff
feat: add Android CI/CD workflow
peanut996 Dec 20, 2024
b6c837a
add workflow file.
peanut996 Dec 20, 2024
11ed998
update workflow
peanut996 Dec 20, 2024
57a1df7
fix ci
peanut996 Dec 20, 2024
32ff69f
fix ci
peanut996 Dec 20, 2024
021224b
fix ci
peanut996 Dec 20, 2024
43507ef
fix ci
peanut996 Dec 20, 2024
bb514eb
fix ci
peanut996 Dec 20, 2024
425ec64
fix ci
peanut996 Dec 20, 2024
f809fe0
fix ci trigger scope
peanut996 Dec 20, 2024
00b4638
revert unused changes
peanut996 Dec 20, 2024
c748d1f
fix ci
peanut996 Dec 20, 2024
02bfd4f
fix ci
peanut996 Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CloudflareWarpSpeedTest Android CI/CD

on:
push:
branches: [ "*", "*/*" ]
tags:
- 'v*'
pull_request:
branches: [ "*", "*/*" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x android/gradlew

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
sdk-platform: '34'
build-tools: '34.0.0'

- name: Build with Gradle
working-directory: ./android
run: ./gradlew build

- name: Run Tests
working-directory: ./android
run: ./gradlew test

- name: Run Lint
working-directory: ./android
run: ./gradlew lint

- name: Upload Build Reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: android/app/build/reports

- name: Build Release APK
if: startsWith(github.ref, 'refs/tags/v')
working-directory: ./android
run: ./gradlew assembleRelease

- name: Sign Release APK
if: startsWith(github.ref, 'refs/tags/v')
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.SIGNED_RELEASE_FILE }}
draft: true
prerelease: true

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Go Build and Test

on:
push:
branches: [ "*" ]
branches: [ "*", "*/*" ]
pull_request:
branches: [ "*" ]
branches: [ "*", "*/*" ]

jobs:
build-and-test:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Release for multiple platforms
on:
release:
types: [created]
push:
tags:
- 'v*'

permissions:
contents: write
Expand Down
38 changes: 37 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
dist
Releases
CloudflareWarpSpeedTest
# CloudflareWarpSpeedTest
*.exe
*.csv
.idea
.vscode

# Go build artifacts
*.o
*.a
*.so

# Android build artifacts
*.aar
*.apk
*.aab
*.dex
*.class
android/app/build/
android/.gradle/
android/local.properties
android/.idea/
android/app/release/
android/app/debug/
android/captures/
android/app/libs/
android/build/

# Keep Gradle Wrapper
!android/gradle/wrapper/gradle-wrapper.jar
!android/gradle/wrapper/gradle-wrapper.properties
!android/gradlew
!android/gradlew.bat

# macOS system files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes

# IDE files
55 changes: 55 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.peanut996.cloudflarewarpspeedtest'
compileSdk 34

defaultConfig {
applicationId "com.peanut996.cloudflarewarpspeedtest"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

buildFeatures {
viewBinding true
}
buildToolsVersion '34.0.0'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
23 changes: 23 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.CloudflareWarpSpeedTest">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Loading
Loading