-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
126 additions
and
11 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
mobile2/backend/gen/android/app/src/main/res/values/styles.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<resources> | ||
|
||
<!-- Base application theme. --> | ||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
<item name="android:windowFullscreen">true</item> | ||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"> | ||
<item name="android:windowFullscreen">true</item> | ||
<!-- Customize your theme here. --> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use derive_more::From; | ||
use serde::Deserialize; | ||
use std::{env::JoinPathsError, sync::RwLock}; | ||
use wry::application::event_loop::{EventLoop, EventLoopBuilder, EventLoopClosed, EventLoopProxy}; | ||
|
||
pub struct MobileTrojanLoop { | ||
pub looper: Option<EventLoop<String>>, | ||
pub proxy: EventLoopProxy<String>, | ||
} | ||
|
||
unsafe impl Sync for MobileTrojanLoop {} | ||
unsafe impl Send for MobileTrojanLoop {} | ||
|
||
impl MobileTrojanLoop { | ||
pub fn new() -> RwLock<Self> { | ||
let looper = EventLoopBuilder::with_user_event().build(); | ||
let proxy = looper.create_proxy(); | ||
RwLock::new(Self { | ||
looper: Some(looper), | ||
proxy, | ||
}) | ||
} | ||
} | ||
|
||
#[derive(Deserialize, Default, Debug)] | ||
pub struct IPCRequest { | ||
pub method: String, | ||
pub payload: String, | ||
} | ||
|
||
#[derive(From, Debug)] | ||
pub enum Error { | ||
#[cfg(target_os = "android")] | ||
JNI(jni::errors::Error), | ||
JSON(serde_json::Error), | ||
Lock(String), | ||
IPC(EventLoopClosed<String>), | ||
Path(JoinPathsError), | ||
IO(std::io::Error), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.