diff --git a/.gitignore b/.gitignore
index 7b071798..be7205c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,8 @@ inner.rs
/test
/log*
/build_event_debug.sh
+
+
+# OHOS
+
+phira/dist/
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index 4f8d510d..63698cdb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2618,6 +2618,12 @@ dependencies = [
"napi-sys-ohos",
]
+[[package]]
+name = "ohos-audio-sys"
+version = "0.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "892313a2851bbb13c11ba075768ef0d0a9a6a8ae53e54641c9c56eda726dc87f"
+
[[package]]
name = "ohos-display-binding"
version = "0.0.1"
@@ -2905,6 +2911,8 @@ dependencies = [
"lyon",
"macroquad",
"nalgebra",
+ "napi-derive-ohos",
+ "napi-ohos",
"ndk-context",
"ndk-sys 0.2.2",
"objc",
@@ -3740,11 +3748,12 @@ dependencies = [
[[package]]
name = "sasa"
version = "0.1.0"
-source = "git+https://github.com/Mivik/sasa?rev=fcbe721#fcbe7218144a13bc4a595ae7e0527caaf272b0ea"
+source = "git+https://github.com/Mivik/sasa?rev=5c110595bd0a1f0d299602c4ab85fe3e349addc7#5c110595bd0a1f0d299602c4ab85fe3e349addc7"
dependencies = [
"anyhow",
"cpal",
"oboe",
+ "ohos-audio-sys",
"ringbuf",
"symphonia",
"thiserror 2.0.18",
diff --git a/Cargo.toml b/Cargo.toml
index ed11541e..1d1d4466 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -54,7 +54,7 @@ phira-mp-common = { git = "https://github.com/TeamFlos/phira-mp", rev = "6967475
prpr = { path = "prpr", default-features = false }
prpr-avc = { path = "prpr-avc" }
prpr-l10n = { path = "prpr-l10n" }
-sasa = { git = "https://github.com/Mivik/sasa", rev = "fcbe721", default-features = false }
+sasa = { git = "https://github.com/Mivik/sasa", rev = "5c110595bd0a1f0d299602c4ab85fe3e349addc7", default-features = false }
[profile.release]
opt-level = 2
diff --git a/phira/Cargo.toml b/phira/Cargo.toml
index f42cd7d2..00d27cdf 100644
--- a/phira/Cargo.toml
+++ b/phira/Cargo.toml
@@ -80,7 +80,15 @@ ndk-sys = "0.2"
ndk-context = "0.1"
sasa = { workspace = true, default-features = false, features = ["oboe"] }
-[target.'cfg(not(target_os = "android"))'.dependencies]
+[target.'cfg(target_env = "ohos")'.dependencies]
+sasa = { workspace = true, default-features = false, features = ["ohos"] }
+napi-derive-ohos = { version = "1.1.3" }
+napi-ohos = { version = "1.1.3", default-features = false, features = [
+ "napi8",
+ "async",
+] }
+
+[target.'cfg(not(any(target_os = "android", target_env = "ohos")))'.dependencies]
sasa = { workspace = true, default-features = true }
[target.'cfg(target_os = "ios")'.dependencies]
diff --git a/phira/src/images.rs b/phira/src/images.rs
index 355341f6..1e8cbc79 100644
--- a/phira/src/images.rs
+++ b/phira/src/images.rs
@@ -31,7 +31,17 @@ impl Images {
image::load_from_memory(&tokio::fs::read(path).await.context("Failed to read image")?)?
} else {
let image = task.await?;
- image.save_with_format(path, image::ImageFormat::Jpeg).context("Failed to save image")?;
+ #[cfg(not(target_env = "ohos"))]
+ {
+ image.save_with_format(path, image::ImageFormat::Jpeg).context("Failed to save image")?;
+ }
+ #[cfg(target_env = "ohos")]
+ {
+ let rgb_image = DynamicImage::ImageRgb8(image.to_rgb8());
+ rgb_image
+ .save_with_format(path, image::ImageFormat::Jpeg)
+ .context("Failed to save image")?;
+ }
image
})
}
diff --git a/phira/src/lib.rs b/phira/src/lib.rs
index f18be3ee..2be9898b 100644
--- a/phira/src/lib.rs
+++ b/phira/src/lib.rs
@@ -45,6 +45,9 @@ static DATA_PATH: Mutex