Fix Android ARM64 build integration and verify first test APK
This commit is contained in:
1 parent
3d2e76eddd
commit
2ec8f9ad85
14 files changed
+253091
-15
No files matched your search
@@ -2,3 +2,4 @@
|
||||
native/patches/** text eol=lf
|
||||
xtask/src/*.rs text eol=lf
|
||||
.gitea/*.sh text eol=lf
|
||||
platform/android/gradlew text eol=lf
|
||||
@@ -2,6 +2,13 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Built the first full Skia/WebRTC Android ARM64 test APK in authorized WSL2. Verified APK v2 signing,
|
||||
16-KiB alignment, native ISA/imports, resources and exported WebRTC JNI symbols; no device run claimed.
|
||||
- Fixed Android build integration: use the complete NDK r28c rather than Chromium's sysroot-only subset,
|
||||
copy the matching WebRTC jar to Cargo's actual output directory, retain JNI exports in the final cdylib,
|
||||
pin Gradle launcher LF/build-tools36, and use the public AppOps permission-change observer.
|
||||
Corrected the pinned Slint NonNull pointer conversion in Android accessibility.
|
||||
|
||||
- Implemented Android call-scoped audio recovery: focus/route changes revoke microphone authorization,
|
||||
restore receive-only playback when permitted, and reject stale lease/revision callbacks. Communication
|
||||
mode and Android 12+ communication-device notifications follow the active foreground call.
|
||||
|
||||
Generated
+1
@@ -7562,6 +7562,7 @@ dependencies = [
|
||||
"usvg",
|
||||
"uuid",
|
||||
"webrtc-sys",
|
||||
"webrtc-sys-build",
|
||||
"windows-sys 0.61.2",
|
||||
"zbus",
|
||||
"zeroize",
|
||||
|
||||
@@ -150,6 +150,8 @@ This is the same Linux source-build route, not a separately tested WSL product c
|
||||
export ANDROID_HOME="$ANDROID_SDK_ROOT"
|
||||
export ANDROID_NDK_ROOT="$ANDROID_SDK_ROOT/ndk/28.2.13676358"
|
||||
export ANDROID_NDK_HOME="$ANDROID_NDK_ROOT"
|
||||
export ANDROID_NDK="$ANDROID_NDK_ROOT" # rust-skia uses this alias
|
||||
export ANDROID_JAR="$ANDROID_SDK_ROOT/platforms/android-36/android.jar" # compile API, distinct from native minimum API26
|
||||
export SKIA_GN_COMMAND="$SKIA_SOURCE_DIR/bin/gn"
|
||||
export SKIA_NINJA_COMMAND="$(command -v ninja)"
|
||||
export PATH="$JAVA_HOME/bin:$LLVM_HOME/bin:$ANDROID_SDK_ROOT/build-tools/36.0.0:$PATH"
|
||||
@@ -218,8 +220,9 @@ it requires the separate signing/store or APK-generation process. These bundles
|
||||
The harness supports isolated offline smoke; a normal launch without smoke extras uses the ordinary
|
||||
runtime and must be confined to an authorized disposable test installation. It is not production
|
||||
feature/device acceptance. Neither configuration nor installation proves live voice, official-client
|
||||
interoperability, Bluetooth/background behavior or full mobile parity. The read-only runner inventory
|
||||
passed; no successful Android build, generated APK/AAB, device install or mobile acceptance is claimed.
|
||||
interoperability, Bluetooth/background behavior or full mobile parity. The first local WSL2 ARM64
|
||||
harness build and APK signature/16-KiB/JNI/package verification passed on 2026-11-11 after the build
|
||||
integration fixes recorded in `docs/mobile-port-progress.md`. Phone execution remains unverified.
|
||||
|
||||
**iOS still requires macOS and Xcode/Apple SDKs**, either locally or on separately provisioned macOS
|
||||
CI, plus appropriate signing/provisioning for devices. Windows editing does not make iOS buildable
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
# Мобильный порт: передача состояния
|
||||
|
||||
Обновлено: **2026-11-11**. Принятая Windows-база **`05e8d34bcf0e24a44f76e65220293c45b6821798`** опубликована в `origin/main` с тегом **`desktop-baseline-0.1.7-20261111`**. Активная мобильная ветка — **`feature/mobile-port`**; Android implementation подготовлена поверх `cb1d682dfb307ec41d73434ab40de5de0b30410e` к разрешённому владельцем commit/push. Получатель должен сверить полный SHA переданной ревизии, содержащей этот handoff и Android-код, с `git rev-parse HEAD`; прежний `cb1d682` не является ревизией готовой передачи. Следующий этап — Linux-сборка на WSL2 другого разработчика. На этом ПК WSL не возвращать. CI/provisioning и iOS отложены. Rust/Slint — единственный host; APK/device proof отсутствует. История ниже не заменяет текущий статус.
|
||||
Updated **2026-11-11**. Windows baseline remains `05e8d34bcf0e24a44f76e65220293c45b6821798`; active branch is `feature/mobile-port`. The owner explicitly authorized using existing WSL Ubuntu for Android builds (server1 container only as fallback), then committing/pushing fixes and publishing a separate Android APK tag/release. This supersedes the older no-local-WSL and no-release decisions below. Source base: `3d2e76eddd281e6801bb5fc591d2443a957568b7`, with the build fixes described here; the delivered build-info includes the exact source patch rather than claiming an unchanged base revision.
|
||||
|
||||
## First Android APK build
|
||||
|
||||
- Existing WSL Ubuntu24.04 x64, `/home/user/src/TeamsPeach`; full pinned Android WebRTC source build and Rust/Slint ARM64 release library succeeded. JDK21, Rust1.96, SDK36/build-tools36.0.0, full NDK28.2.13676358, LLVM18 and matching Skia m153-0.101.2 sources; one Cargo/Ninja job. No server1 container was needed.
|
||||
- Fixed actual first-build failures: Chromium DEPS NDK is sysroot-only (Cargo needs complete NDK); Skia uses `ANDROID_NDK`, Slint Java compilation needs explicit SDK36 `ANDROID_JAR` despite native API26; vendored jar destination used the wrong target root; accessibility cast needs NonNull::as_ptr; Gradle launcher CRLF and implicit build-tools35; permission observer used non-public PackageManager API; WebRTC JNI linker arguments must be emitted by the final cdylib build script.
|
||||
- `xtask package` and `verify-package` passed for `TeamsPeach-0.1.7-android-arm64-harness-test.apk`, 121385639 bytes, SHA256 `ab0c4119b4a8abfebbb31ed185459da8b1ef6c57c86324ad7862014aa1085d1b`. APK v2 test signature, ARM64, 16-KiB ZIP/ELF alignment and JNI exports verified. Android8/API26 minimum. Install with `adb install -t`; not a production signing identity.
|
||||
- Delivery: `C:/Users/Admin/Desktop/TeamsPeach-Android-0.1.7/`, APK plus build-info, exact build-fixes.patch and dependency/build/package verification receipts. Private test keystore is not included. WSL caches retained for incremental builds. Phone runtime/UI/voice/background acceptance has NOT run; no device installed, microphone activated, server connected or Windows installation modified.
|
||||
- Publication requested as a separate Android prerelease, not a `v*` desktop tag or desktop updater manifest. Record successful push/release only after remote acknowledgement; authorization failures are not publication.
|
||||
|
||||
## Текущий этап: реализация Android, CI отложен
|
||||
|
||||
|
||||
@@ -98,3 +98,4 @@ i-slint-backend-android-activity = { version = "=1.18.1", default-features = fal
|
||||
[build-dependencies]
|
||||
slint-build.workspace = true
|
||||
cc = "1"
|
||||
webrtc-sys-build = "=0.3.21"
|
||||
@@ -3,6 +3,11 @@ fn main() {
|
||||
build_platform();
|
||||
slint_build::compile("ui/app.slint").expect("compile native interface");
|
||||
if std::env::var_os("CARGO_FEATURE_WEBRTC").is_some() {
|
||||
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("android") {
|
||||
// Link arguments from the webrtc-sys rlib do not propagate into this cdylib.
|
||||
assert!(std::env::var_os("LK_CUSTOM_WEBRTC").is_some(), "Android requires verified source-built WebRTC");
|
||||
webrtc_sys_build::configure_jni_symbols().expect("export matching WebRTC JNI entrypoints");
|
||||
}
|
||||
build_camera();
|
||||
build_mobile_capture();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -27,7 +27,7 @@ fn flag(item:&ItemRc,property:P)->bool{item.accessible_string_property(property)
|
||||
fn class(role:AccessibleRole)->&'static str{match role{AccessibleRole::Button=>"android.widget.Button",AccessibleRole::Checkbox=>"android.widget.CheckBox",AccessibleRole::Switch=>"android.widget.Switch",AccessibleRole::RadioButton=>"android.widget.RadioButton",AccessibleRole::TextInput=>"android.widget.EditText",AccessibleRole::Slider|AccessibleRole::Spinbox=>"android.widget.SeekBar",AccessibleRole::List|AccessibleRole::Tree=>"android.widget.ListView",AccessibleRole::Image=>"android.widget.ImageView",AccessibleRole::Text=>"android.widget.TextView",AccessibleRole::Combobox=>"android.widget.Spinner",AccessibleRole::ProgressIndicator=>"android.widget.ProgressBar",_=>"android.view.View"}}
|
||||
impl State {
|
||||
fn id(&mut self,item:&ItemRc)->Option<i32>{
|
||||
let key=(ItemTreeRef::as_ptr(ItemTreeRc::borrow(item.item_tree())) as usize,item.index());
|
||||
let key=(ItemTreeRef::as_ptr(ItemTreeRc::borrow(item.item_tree())).as_ptr() as usize,item.index());
|
||||
if let Some(entry)=self.items.get(&key){if entry.weak.upgrade().is_some_and(|old|old==*item){return Some(entry.id);}}
|
||||
let id=self.next;self.next=self.next.checked_add(1)?;
|
||||
self.items.insert(key,Item{weak:item.downgrade(),id});Some(id)
|
||||
|
||||
Vendored
+1
-1
@@ -26,7 +26,7 @@
|
||||
{
|
||||
"path": "build.rs",
|
||||
"upstream_sha256": "4e9936c0d9dde5f74cd9c0557947e8d47ed7569a7bc0c6bc386f6f36b444ea91",
|
||||
"modified_sha256": "0a5af9c3aac43e079778f6d33d556f3ccb990fd03f92ac5f9f27958189a19fe3"
|
||||
"modified_sha256": "a50b5cf92b547d51d91ce0a80d9f6e03c139b0d6b019e3a2900affc0f58bd5ee"
|
||||
},
|
||||
{
|
||||
"path": "include/livekit/peer_connection_factory.h",
|
||||
|
||||
+4
-6
@@ -442,12 +442,10 @@ fn copy_libwebrtc_jar(webrtc_dir: &PathBuf) {
|
||||
}
|
||||
|
||||
fn get_output_path() -> PathBuf {
|
||||
let manifest_dir_string = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let build_type = env::var("PROFILE").unwrap();
|
||||
let build_target = env::var("TARGET").unwrap();
|
||||
let path =
|
||||
Path::new(&manifest_dir_string).join("../target").join(build_target).join(build_type);
|
||||
return PathBuf::from(path);
|
||||
// OUT_DIR is <actual target-dir>/<target>/<profile>/build/<crate>/out.
|
||||
// It respects workspaces and CARGO_TARGET_DIR, unlike a path relative to this vendored crate.
|
||||
let out = PathBuf::from(env::var_os("OUT_DIR").expect("Cargo OUT_DIR"));
|
||||
out.ancestors().nth(3).expect("Cargo profile output directory").to_owned()
|
||||
}
|
||||
|
||||
fn configure_darwin_sysroot(builder: &mut cc::Build) {
|
||||
|
||||
@@ -20,6 +20,7 @@ require(abi in listOf("arm64-v8a", "x86_64")) { "Only ARM64 production and x64 e
|
||||
android {
|
||||
namespace = "dev.teamspeach.mobile"
|
||||
compileSdk = 36
|
||||
buildToolsVersion = "36.0.0"
|
||||
ndkVersion = "28.2.13676358"
|
||||
buildFeatures { buildConfig = true }
|
||||
signingConfigs.getByName("debug").storeFile = debugKey.get().asFile
|
||||
|
||||
@@ -39,8 +39,9 @@ public final class PlatformBridge {
|
||||
if (Build.VERSION.SDK_INT >= 33) value.registerReceiver(receiver, screen, Context.RECEIVER_NOT_EXPORTED); else value.registerReceiver(receiver, screen);
|
||||
value.getSystemService(AccessibilityManager.class).addAccessibilityStateChangeListener(enabled -> { TeamsPeachActivity current=activity.get();if(current!=null)current.reportConfiguration(); });
|
||||
final boolean[] previousPermissions = { granted(0), granted(1), granted(2) };
|
||||
value.getPackageManager().addOnPermissionsChangeListener(uid -> {
|
||||
if (uid != android.os.Process.myUid()) return;
|
||||
AppOpsManager ops = value.getSystemService(AppOpsManager.class);
|
||||
AppOpsManager.OnOpChangedListener permissionChanged = (op, packageName) -> MAIN.post(() -> {
|
||||
if (packageName != null && !packageName.equals(value.getPackageName())) return;
|
||||
for (int permission = 0; permission < 3; permission++) {
|
||||
boolean allowed = granted(permission);
|
||||
nativePermission(0, permission, allowed);
|
||||
@@ -51,6 +52,8 @@ public final class PlatformBridge {
|
||||
previousPermissions[permission] = allowed;
|
||||
}
|
||||
});
|
||||
ops.startWatchingMode(AppOpsManager.OPSTR_RECORD_AUDIO, value.getPackageName(), permissionChanged);
|
||||
ops.startWatchingMode(AppOpsManager.OPSTR_CAMERA, value.getPackageName(), permissionChanged);
|
||||
}
|
||||
static boolean post(Runnable work) {
|
||||
if (pending.incrementAndGet() > 32) { pending.decrementAndGet(); return false; }
|
||||
|
||||
@@ -273,8 +273,11 @@ pub(crate) fn build(root: &Path, options: &Options) -> Result<(), String> {
|
||||
}
|
||||
}
|
||||
"android" => {
|
||||
// Use the very same DEPS-pinned NDK for Rust CXX and the archive.
|
||||
let ndk = source.join("third_party/android_toolchain/ndk");
|
||||
// Chromium's DEPS NDK contains only sysroot/debugger files, not clang drivers.
|
||||
// Cargo/Skia/CXX need the complete SDK-installed NDK required by Android packaging.
|
||||
let ndk = PathBuf::from(environment.get("ANDROID_NDK_ROOT").or_else(||environment.get("ANDROID_NDK_HOME")).ok_or("Android Cargo build requires the full installed NDK")?);
|
||||
let properties=read_text(&ndk.join("source.properties"))?;
|
||||
if !properties.lines().any(|line|line.split_once('=').is_some_and(|(key,value)|key.trim()=="Pkg.Revision"&&value.trim()=="28.2.13676358")){return Err("Android Cargo build requires NDK 28.2.13676358, matching Gradle".into());}
|
||||
let bin = ndk.join("toolchains/llvm/prebuilt/linux-x86_64/bin");
|
||||
let clang = bin.join(format!("{}26-clang", target.triple));
|
||||
let clangxx = bin.join(format!("{}26-clang++", target.triple));
|
||||
|
||||
Reference in new issue
Block a user