AuraSync is a project developed by StarkLab for synchronizing data with external devices.
AuraSync facilitates the communication between your application and external devices, such as the Mi Band, through XPC (Cross-Process Communication) services. This allows your application to perform various tasks, such as detecting device presence and initiating actions based on device events.
To install AuraSync, follow these steps:
-
Clone the repository to your local machine:
git clone <repository-url>
-
Navigate to the project directory:
cd AuraSync -
Install dependencies:
npm install
To use AuraSync in your project, follow these steps:
-
Import the necessary modules:
import noble from 'noble'; import { exec } from 'child_process'; const XpcConnect = require('xpc-connect');
-
Initialize the XPC connection:
const serviceName = "com.example.XPC-Calc-Engine"; const xpc = new XpcConnect(serviceName);
Replace
"com.example.XPC-Calc-Engine"with your desired XPC service name. -
Handle XPC events:
xpc.on('error', (err: Error) => { console.error("XPC Error:", err); }); xpc.on('event', (event: any) => { console.log("XPC Event:", event); });
-
Start scanning for devices:
noble.on('stateChange', (state) => state === 'poweredOn' ? noble.startScanning() : noble.stopScanning()); noble.on('discover', (peripheral) => { // Your device detection logic here });
-
Execute actions based on device events:
const wakeNova = () => { exec('caffeinate -u -t 1', (error, stdout, stderr) => { // Your action execution logic here }); };
-
Run your application:
npm start
This project is currently not licensed. It is part of StarkLab projects and is under control of StarkLab. Any use, modification, or redistribution is subject to StarkLab's policies.