android-native: SDL3 APK build for the native client
build-android-native.sh downloads SDL 3.4.16 (sha256-checked), builds libSDL3.so and libmain.so (native_render + port_platform + embedded Python) at API 24, and wraps them in the SDLActivity shell under android-native/ (package org.metin2port.client). push-android-client.sh copies the 40250 Client directory into the app's files/ with run-as (--locale XX selects locale_XX.cfg). port_logic links with --no-dependent-libraries on ELF targets so the verbatim `#pragma comment(lib, ...)` lines do not break lld. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0b701d88c3
commit
fd051cc3ed
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-feature android:name="android.hardware.vulkan.version" android:version="0x400003" android:required="true" />
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application android:label="@string/app_name"
|
||||
android:allowBackup="false"
|
||||
android:extractNativeLibs="true"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:hardwareAccelerated="true"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:alwaysRetainTaskState="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
|
||||
android:preferMinimalPostProcessing="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.metin2port.client;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
/**
|
||||
* Runs native_render's main() (libmain.so). Command-line arguments come from the launch intent,
|
||||
* e.g. adb shell am start -n org.metin2port.client/.MainActivity \
|
||||
* --es args "--live-server 192.168.21.203:11000:13000 --login-screen"
|
||||
* Without arguments the client runs against the in-process fake server once Client/ is in files/.
|
||||
*/
|
||||
public class MainActivity extends SDLActivity {
|
||||
@Override
|
||||
protected String[] getLibraries() {
|
||||
return new String[] { "SDL3", "main" };
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getArguments() {
|
||||
Intent intent = getIntent();
|
||||
String args = intent != null ? intent.getStringExtra("args") : null;
|
||||
if (args == null || args.trim().isEmpty())
|
||||
return new String[0];
|
||||
return args.trim().split("\\s+");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Metin2</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user