fix(android): resolve updater compile errors for mobile build
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
0fe5fbfdcf
commit
c3bd3c346a
1 file changed
+6
-5
@@ -8,7 +8,7 @@ mod android_impl {
|
||||
use serde::Deserialize;
|
||||
use tauri::{AppHandle, Emitter};
|
||||
|
||||
use crate::commands::settings::{
|
||||
use crate::commands::{
|
||||
fetch_latest_beta_release, parse_latest_beta_from_atom, AppUpdateMetadata,
|
||||
};
|
||||
use crate::net;
|
||||
@@ -39,7 +39,7 @@ mod android_impl {
|
||||
|
||||
fn device_arch() -> Result<&'static str, String> {
|
||||
crate::android::jni::android::with_android_env(|env, _context| {
|
||||
let abis = env
|
||||
let abis_obj = env
|
||||
.call_static_method(
|
||||
"android/os/Build",
|
||||
"SUPPORTED_ABIS",
|
||||
@@ -48,14 +48,15 @@ mod android_impl {
|
||||
)
|
||||
.and_then(|value| value.l())
|
||||
.map_err(|e| format!("read SUPPORTED_ABIS: {e}"))?;
|
||||
let abis_array = jni::objects::JObjectArray::from(abis_obj);
|
||||
let len = env
|
||||
.get_array_length(&jni::objects::JObjectArray::from(abis))
|
||||
.get_array_length(&abis_array)
|
||||
.map_err(|e| format!("SUPPORTED_ABIS length: {e}"))?;
|
||||
if len == 0 {
|
||||
return Err("SUPPORTED_ABIS is empty".to_string());
|
||||
}
|
||||
let first = env
|
||||
.get_object_array_element(&jni::objects::JObjectArray::from(abis), 0)
|
||||
.get_object_array_element(&abis_array, 0)
|
||||
.map_err(|e| format!("SUPPORTED_ABIS[0]: {e}"))?;
|
||||
let abi = env
|
||||
.get_string(&jni::objects::JString::from(first))
|
||||
@@ -261,7 +262,7 @@ mod android_impl {
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn parse_beta_atom(body: &str) -> Option<crate::commands::settings::LatestBetaRelease> {
|
||||
pub fn parse_beta_atom(body: &str) -> Option<crate::commands::LatestBetaRelease> {
|
||||
parse_latest_beta_from_atom(body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user