Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xposed-modules-repo/com.qqlittleice.ironbridge
Ironbridge
https://github.com/xposed-modules-repo/com.qqlittleice.ironbridge
Last synced: about 12 hours ago
JSON representation
Ironbridge
- Host: GitHub
- URL: https://github.com/xposed-modules-repo/com.qqlittleice.ironbridge
- Owner: Xposed-Modules-Repo
- Created: 2022-07-30T15:45:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-30T15:55:51.000Z (over 2 years ago)
- Last Synced: 2023-03-04T17:08:14.463Z (over 1 year ago)
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ironbridge Api
Ironbridge Api is used to interact with the Ironbridge Xposed module.
## Features
+ Connect to the public bridge, send and receive content
+ ~~Connect to the custom bridge, send and receive content~~ (TODO)## Quick Start
### 1. Install Ironbridge Xposed module
### 2. Connect to the public bridge
```java
// Java
Ironbridge bridge = IronBridge.getPublicBridge();
// attention: bridge may be null if the public bridge is not available
// always check if bridge is null after calling getPublicBridge()
if (bridge != null) {
// do something
}
``````kotlin
// Kotlin
val bridge = IronBridge.getPublicBridge()
// attention: bridge may be null if the public bridge is not available
// always check if bridge is null after calling getPublicBridge()
bridge?.let {
// do something
}
```### 3. Send content to the bridge
```java
// Java
bridge.sendBoolean(
"main", // the channel
"a boolean value", // the key
true // the value
);
// ......
``````kotlin
// Kotlin
bridge.sendBoolean(
"main", // the channel
"a boolean value", // the key
true // the value
)
// ......
```#### current supported types:
+ String
+ int
+ long
+ float
+ double
+ boolean
+ List
- String
- Integer
- Long
- Float
- Double
- Boolean
+ Array
- int
- long
- float
- double
- boolean
+ Parcelable (Make sure all clients have the same class)
+ Serializable (Make sure all clients have the same class)
+ IBinder
### 4. Receive content from the bridge
```java
// Java
ironbridge.addListener(new BridgeListener.Stub() {
@Override
public void onReceivedString(String key, String value) {
// do something
}
// ......@Override
public String getChannel() {
// return the channel name that the channel you want to listen
return "main";
}
});
``````kotlin
// Kotlin
bridge?.addListener(object: BridgeListener.Stub() {
override fun onReceivedString(key: String?, value: String?) {
// do something
}// ......
override fun getChannel(): String {
// return the channel name that the channel you want to listen
return "main"
}
})
```