Skip to content

Commit bc92305

Browse files
author
krxkli
committed
Android Version 1.0.0
1 parent 3758775 commit bc92305

File tree

329 files changed

+8803
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+8803
-9
lines changed

Diff for: .gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ build/bin
33
node_modules
44
frontend/dist
55
frontend/.idea
6-
frontend/node_modules
6+
frontend/node_modules
7+
8+
Compatibility/out
9+
backup_GoEnv.txt

Diff for: Android/.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

Diff for: Android/app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

Diff for: Android/app/build.gradle.kts

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.jetbrains.kotlin.android)
4+
}
5+
6+
android {
7+
namespace = "com.example.scut_router"
8+
compileSdk = 34
9+
10+
defaultConfig {
11+
applicationId = "com.krxkli.scut_router"
12+
minSdk = 24
13+
targetSdk = 34
14+
versionCode = 1
15+
versionName = "1.0"
16+
17+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18+
19+
// Golang 库为下列架构
20+
ndk {
21+
abiFilters.add("arm64-v8a")
22+
}
23+
}
24+
25+
buildTypes {
26+
release {
27+
isMinifyEnabled = false
28+
proguardFiles(
29+
getDefaultProguardFile("proguard-android-optimize.txt"),
30+
"proguard-rules.pro"
31+
)
32+
}
33+
}
34+
compileOptions {
35+
sourceCompatibility = JavaVersion.VERSION_1_8
36+
targetCompatibility = JavaVersion.VERSION_1_8
37+
}
38+
kotlinOptions {
39+
jvmTarget = "1.8"
40+
}
41+
externalNativeBuild {
42+
cmake {
43+
path = file("src/main/cpp/CMakeLists.txt")
44+
version = "3.22.1"
45+
}
46+
}
47+
buildFeatures {
48+
viewBinding = true
49+
}
50+
}
51+
52+
dependencies {
53+
implementation(libs.androidx.core.ktx)
54+
implementation(libs.androidx.appcompat)
55+
implementation(libs.material)
56+
implementation(libs.androidx.constraintlayout)
57+
implementation(libs.androidx.annotation)
58+
implementation(libs.androidx.lifecycle.livedata.ktx)
59+
implementation(libs.androidx.lifecycle.viewmodel.ktx)
60+
implementation(libs.androidx.preference)
61+
implementation(libs.androidx.activity)
62+
testImplementation(libs.junit)
63+
androidTestImplementation(libs.androidx.junit)
64+
androidTestImplementation(libs.androidx.espresso.core)
65+
}

Diff for: Android/app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

Diff for: Android/app/release/app-release.apk

9.1 MB
Binary file not shown.
3.11 KB
Binary file not shown.
3.05 KB
Binary file not shown.

Diff for: Android/app/release/output-metadata.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"version": 3,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "com.krxkli.scut_router",
8+
"variantName": "release",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"attributes": [],
14+
"versionCode": 1,
15+
"versionName": "1.0",
16+
"outputFile": "app-release.apk"
17+
}
18+
],
19+
"elementType": "File",
20+
"baselineProfiles": [
21+
{
22+
"minApi": 28,
23+
"maxApi": 30,
24+
"baselineProfiles": [
25+
"baselineProfiles/1/app-release.dm"
26+
]
27+
},
28+
{
29+
"minApi": 31,
30+
"maxApi": 2147483647,
31+
"baselineProfiles": [
32+
"baselineProfiles/0/app-release.dm"
33+
]
34+
}
35+
],
36+
"minSdkVersionForDexing": 24
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.example.scut_router
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.example.scut_router", appContext.packageName)
23+
}
24+
}

Diff for: Android/app/src/main/AndroidManifest.xml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
7+
tools:ignore="ScopedStorage" />
8+
9+
<application
10+
android:requestLegacyExternalStorage="true"
11+
android:allowBackup="true"
12+
android:dataExtractionRules="@xml/data_extraction_rules"
13+
android:fullBackupContent="@xml/backup_rules"
14+
android:icon="@mipmap/startup"
15+
android:label="@string/app_name"
16+
android:roundIcon="@mipmap/startup_round"
17+
android:supportsRtl="true"
18+
android:theme="@style/Theme.ScutRouter"
19+
tools:targetApi="31">
20+
21+
<activity
22+
android:name=".InternetActivity"
23+
android:exported="false" />
24+
<activity
25+
android:name=".ServerActivity"
26+
android:exported="false" />
27+
<activity
28+
android:name=".LoginActivity"
29+
android:exported="false" />
30+
<activity
31+
android:name=".ToolsActivity"
32+
android:exported="false" />
33+
<activity
34+
android:name=".MainActivity"
35+
android:exported="true">
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
39+
<category android:name="android.intent.category.LAUNCHER" />
40+
</intent-filter>
41+
</activity>
42+
</application>
43+
44+
</manifest>

Diff for: Android/app/src/main/about_icon-playstore.png

18.8 KB
Loading

Diff for: Android/app/src/main/account_icon-playstore.png

28.3 KB
Loading

Diff for: Android/app/src/main/avatar-playstore.png

138 KB
Loading

Diff for: Android/app/src/main/cpp/CMakeLists.txt

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# For more information about using CMake with Android Studio, read the
2+
# documentation: https://d.android.com/studio/projects/add-native-code.html.
3+
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.
4+
5+
# Sets the minimum CMake version required for this project.
6+
cmake_minimum_required(VERSION 3.22.1)
7+
8+
# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
9+
# Since this is the top level CMakeLists.txt, the project name is also accessible
10+
# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
11+
# build script scope).
12+
project("scut_router")
13+
14+
15+
# Creates and names a library, sets it as either STATIC
16+
# or SHARED, and provides the relative paths to its source code.
17+
# You can define multiple libraries, and CMake builds them for you.
18+
# Gradle automatically packages shared libraries with your APK.
19+
#
20+
# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
21+
# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
22+
# is preferred for the same purpose.
23+
#
24+
# In order to load a library into your app from Java/Kotlin, you must call
25+
# System.loadLibrary() and pass the name of the library defined here;
26+
# for GameActivity/NativeActivity derived applications, the same library name must be
27+
# used in the AndroidManifest.xml file.
28+
add_library(${CMAKE_PROJECT_NAME} SHARED
29+
# List C/C++ source files with relative paths to this CMakeLists.txt.
30+
native-lib.cpp)
31+
32+
33+
# 注意加上 ${CMAKE_SOURCE_DIR} 环境变量,否则会找不到头文件
34+
set(HEADER_PATH ${CMAKE_SOURCE_DIR}/../../../../../Compatibility/out/)
35+
include_directories(${HEADER_PATH}) # 包含 libSSHCommand.h
36+
37+
# 将库添加到 jniLibs 目录下,保证会自动拷贝到 apk 包
38+
set(Compatibility_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/arm64-v8a)
39+
add_library(Compatibility SHARED IMPORTED)
40+
set_property(TARGET Compatibility PROPERTY IMPORTED_NO_SONAME 1)
41+
set_target_properties(Compatibility PROPERTIES IMPORTED_LOCATION ${Compatibility_DIR}/libSSHCommand.so)
42+
include_directories(${Compatibility_DIR})
43+
44+
45+
# Specifies libraries CMake should link to your target library. You
46+
# can link libraries from various origins, such as libraries defined in this
47+
# build script, prebuilt third-party libraries, or Android system libraries.
48+
target_link_libraries(${CMAKE_PROJECT_NAME}
49+
# List libraries link to the target library
50+
Compatibility
51+
android
52+
log)

Diff for: Android/app/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cache-v2

Whitespace-only changes.

Diff for: Android/app/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1

Whitespace-only changes.

Diff for: Android/app/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/codemodel-v2

Whitespace-only changes.

Diff for: Android/app/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/toolchains-v1

Whitespace-only changes.

0 commit comments

Comments
 (0)