android: complete the Gradle project and add build.sh

Move support/android to a top-level android/ and make it build:
Gradle 8.12 wrapper + AGP 8.7.3, compileSdk/targetSdk 35, SDL3 3.4.16
and FreeType 2.13.3 built once into build/android-deps (SDL Java sources
copied from the same release), libSDL3.so staged as a jniLib, 16 KB page
alignment, RelWithDebInfo native code for debug APKs, placeholder adaptive
icon. build.sh installs and launches the APK when a phone is attached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-12 18:47:18 +09:00
co-authored by Claude Opus 5.5
parent 043881f032
commit 3ce5fc1a6c
18 changed files with 616 additions and 96 deletions
-23
View File
@@ -1,23 +0,0 @@
# AVA2 Android Client Build & Packaging Guide
This directory contains the standard Android Gradle and NDK packaging setup for the AVA2 cross-platform Metin2 client.
## Requirements
- Android SDK (API 34)
- Android NDK (r25c or newer)
- CMake 3.22.1+
- Gradle 8.2+
## Architecture
- Native Target: `libmain.so` (arm64-v8a)
- Host Environment: SDL3 `SDLActivity` + Embedded CPython 2.7.18 + Metal/Vulkan/GLES3 backend
- Assets: Packed Metin2 assets in `app/src/main/assets/`
## Build Command
```bash
# Configure and build APK
cd support/android
./gradlew assembleDebug
# or Release
./gradlew assembleRelease
```
-61
View File
@@ -1,61 +0,0 @@
plugins {
id 'com.android.application'
}
android {
namespace 'com.metin2.ava2'
compileSdk 34
defaultConfig {
applicationId "com.metin2.ava2"
minSdk 26
targetSdk 34
versionCode 1
versionName "1.0.0"
ndk {
abiFilters 'arm64-v8a'
}
externalNativeBuild {
cmake {
arguments "-DAVA2_BUILD_HOST=ON", "-DAVA2_EMBED_PYTHON=ON", "-DANDROID_STL=c++_shared"
cppFlags "-std=c++20"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
jniDebuggable true
}
}
externalNativeBuild {
cmake {
path file('../../../CMakeLists.txt')
version '3.22.1+'
}
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets']
}
}
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
}
dependencies {
// SDL3 native runtime
}
@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.metin2.ava2"
android:versionCode="1"
android:versionName="1.0.0">
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
<uses-feature android:name="android.hardware.vulkan.level" android:required="false" android:version="1" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:label="AVA2"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:hardwareAccelerated="true">
<activity
android:name="org.libsdl.app.SDLActivity"
android:label="AVA2"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:screenOrientation="sensorLandscape"
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Native library to load -->
<meta-data android:name="android.app.lib_name" android:value="main" />
</activity>
</application>
</manifest>
-16
View File
@@ -1,16 +0,0 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "AVA2"
include ':app'