[ROKID] CXR-M SDK Changelog: 1.0.4 -> 1.0.8
![[ROKID] CXR-M SDK Changelog: 1.0.4 -> 1.0.8](/iris-and-jupiter.webp)
1. Breaking Changes
These are changes to existing method signatures and interfaces that will require updates in the targeting library.
1.1. CXRServiceBridge.StatusListener — Connection Callbacks (Internal Bridge Only)
⚠️ Kotlin migration note:
This section describes changes to CXRServiceBridge.StatusListener, which is the low-level internal bridge interface.
The public-facing BluetoothStatusCallback interface is unchanged between 1.0.4 and 1.0.8 — onConnected() still takes no parameters.
If you implement BluetoothStatusCallback, no changes are needed for the connection callbacks.
The startBTPairing and getClassicMacAddress methods listed in this changelog do not exist on the public CxrApi class.
| Method | 1.0.4 | 1.0.8 |
|---|---|---|
onConnected | (String str, int i) | (String str, String str2, int i) — added MAC address parameter |
onConnecting | did not exist | (String str, String str2, int i) — new callback |
iOS device type constants split:
- 1.0.4:
DEVICE_TYPE_IOS = 2 - 1.0.8:
DEVICE_TYPE_IOS_GATT = 2,DEVICE_TYPE_IOS_MFI = 3
1.2. AudioStreamListener — All Methods Changed
| Method | 1.0.4 | 1.0.8 |
|---|---|---|
onStartAudioStream | (int codec, String cmd) | (int streamId, int codec, String cmd) — added stream ID |
onAudioStream | (byte[] data, int offset, int size) | (int streamId, byte[] data, int offset, int size) — added stream ID |
onAudioStreamFinish | did not exist | (int streamId) — new method |
1.3. ArtcListener.onArtcFrame — Signature Changed
| 1.0.4 | 1.0.8 |
|---|---|
onArtcFrame(byte[] data) | onArtcFrame(byte[] data, long timestamp) — added timestamp |
1.4. CxrApi.openAudioRecord — Signature Changed
| 1.0.4 | 1.0.8 |
|---|---|
openAudioRecord(int codec, String cmd) | openAudioRecord(int codec, int mode, String intent, int denoiseMode) |
| — | openAudioRecord(int codec, int mode, String intent) — overload, defaults denoiseMode=2 |
🔍 Note:
The Caps-based flexible parameter was replaced with explicit typed parameters (mode, denoiseMode). Internally, openAudioRecord now calls a native method directly instead of building a Caps message.
1.5. WifiController.init — Signature Changed
| 1.0.4 | 1.0.8 |
|---|---|
init(Context, String deviceName, Callback) | init(Context, String deviceName, String macAddress, Callback) — added MAC address |
1.6. WifiP2PStatusCallback — New Method
| Method | 1.0.4 | 1.0.8 |
|---|---|---|
onP2pDeviceAvailable | did not exist | (String name, String address, String info) — new callback |
1.7. CxrController Architecture — Singleton → Instance for BluetoothController
CxrController no longer uses BluetoothController.getInstance(). Instead, it holds a private BluetoothController instance field initialized in the constructor. All internal calls changed from BluetoothController.getInstance().method() to this.bluetoothController.method(). The CxrController is still a singleton, so there’s effectively one BluetoothController in practice.
1.8. CXRSocketProtocol — Thread Safety & Auth
request()andsend()are nowsynchronized(were not in 1.0.4)changeRokidAccount()is nowsynchronizedwith null-check guardnativeDestroy()cleanup is now wrapped insynchronizedblock- New
setAuthPtr(long)method — sets an auth pointer used bynativeHandleReadPacket nativeHandleReadPacketsignature changed: added auth pointer as first parameter- Return code
101fromnativeHandleReadPacketnow resets the auth pointer to0
2. New Features
2.1. Audio Streaming API (Smartphone → Glasses)
A complete new API for pushing audio data from the smartphone to the glasses. This enables TTS playback, audio notifications, and other phone-to-glasses audio use cases.
New methods on CxrApi:
| Method | Signature | Purpose |
|---|---|---|
startPlayAudio | boolean startPlayAudio(int sampleRate, int channelCount, float volume, int mode) | Start audio playback on glasses |
openAudioStream | void openAudioStream(int codec, int mode, String intent, Caps caps) | Open an outgoing audio stream |
writeAudioStream | void writeAudioStream(int streamId, byte[] data, int offset, int size) | Write PCM/encoded data to stream |
⚠️ Kotlin migration note:
finishAudioStream(int) and cancelAudioStream(int) exist only as native methods on CXRSocketProtocol (internal).
They are not exposed on the public CxrApi class. Audio stream completion is reported via the AudioStreamListener.onAudioStreamFinish(int streamId) callback instead.
New native methods in CXRSocketProtocol (internal, not on CxrApi):
nativeStartAudioStream(long handle, int codec, int mode, String intent, Caps caps)nativeWriteAudioStream(long handle, int streamId, byte[] data, int offset, int size)nativeFinishAudioStream(long handle, int streamId)nativeCancelAudioStream(long handle, int streamId)nativeOpenAudioRecord(long handle, int codec, int mode, String intent, int denoiseMode)
2.2. Real-Time Camera Streaming
New MediaStreamListener interface for receiving live camera frames from glasses:
| Method | Signature | Purpose |
|---|---|---|
onCameraOpened() | void onCameraOpened() | Camera successfully started |
onCameraClosed() | void onCameraClosed() | Camera stopped |
onCameraError() | void onCameraError() | Camera error occurred |
onCameraFrame(byte[] data, long timestamp) | Frame data + timestamp | Raw frame data (YUV/JPEG) per frame |
New CxrApi methods for camera control:
| Method | Signature | Purpose |
|---|---|---|
setMediaStreamListener | void setMediaStreamListener(MediaStreamListener) | Register the listener |
openCameraVideo | CxrStatus openCameraVideo(int width, int height, int rotate, int encoderMode) | Open camera stream. Max 1280px. Hardcoded 10fps. |
closeCameraVideo | CxrStatus closeCameraVideo() | Close camera stream |
isGlassCameraInUse | boolean isGlassCameraInUse() | Checks if camera is in use by recording/AI/payment |
🔍 Note:
onARTCFrame in the inner callback class now dispatches to MediaStreamListener.onCameraFrame() instead of ArtcListener.onArtcFrame().
2.3. Glass Status Monitoring
New GlassStatusUpdateListener interface:
| Method | Signature | Purpose |
|---|---|---|
onWearingStatusUpdated(String status) | Wearing state change | Detects if user put on / removed glasses |
onGlassGlobalTtsStatusUpdated(String status) | TTS state change | Global TTS enabled/disabled state |
CxrApi setter: setGlassStatusUpdateListener(GlassStatusUpdateListener)
2.4. Bluetooth Peripheral Management
New classes and API for managing Bluetooth peripherals connected to the glasses (headphones, keyboards, etc.):
New classes:
BluetoothPeriphInfo— Data class with fields:address(String),bondState(int),name(String),type(int),connectState(boolean). Uses Gson@SerializedNameannotations.PeriphDeviceCallback— Interface:onBluetoothPeriphList(CxrStatus, List<BluetoothPeriphInfo>)
New CxrApi methods:
| Method | Signature | Purpose |
|---|---|---|
wordTips_startBtPeriphScan | CxrStatus wordTips_startBtPeriphScan() | Start BT peripheral scanning on glasses |
wordTips_StopBtPeriphScan | CxrStatus wordTips_StopBtPeriphScan() | Stop BT peripheral scanning |
wordTips_setBtPeriph | CxrStatus wordTips_setBtPeriph(String name, String addr, int type, int bondState) | Pair/connect a BT peripheral |
wordTips_removeBtPeriph | CxrStatus wordTips_removeBtPeriph(String name, String addr, int type, int bondState) | Remove a BT peripheral |
wordTips_getBoundBtPeriphs | CxrStatus wordTips_getBoundBtPeriphs(PeriphDeviceCallback) | Query all bound peripherals |
2.5. WiFi Hotspot Support
New classes:
WifiHotStatusCallback— Interface:onWifiHotAvailable(String ssid, String password, String ip, int type)
New CxrApi methods:
| Method | Signature | Purpose |
|---|---|---|
initWifiHot | CxrStatus initWifiHot(WifiHotStatusCallback) | Initialize WiFi hotspot sync mode |
deinitWifiHot | CxrStatus deinitWifiHot() | Deinitialize WiFi hotspot sync |
2.6. WiFi Network Scanning
| Method | Signature | Purpose |
|---|---|---|
startGetWifiList | CxrStatus startGetWifiList(WifiListCallback) | Start scanning WiFi networks visible to glasses |
stopGetWifiList | CxrStatus stopGetWifiList(boolean onlyStopScan) | Stop WiFi scanning |
2.7. Settings Management
New methods to push settings to the glasses, all sending “Settings_Update” on the “Settings” channel:
| Method | Settings Key |
|---|---|
setMsgNotificationSoundEnabled(String) | settings_msg_notification_sound_enabled |
setMsgNotificationDisplayDuration(String) | settings_msg_notification_display_duration |
setAppIsOverseas(String) | settings_app_is_overseas |
setScheduleTtsEnabled(String) | settings_schedule_tts_enabled |
setVoiceCtrl(String) | settings_voice_control |
setLongPressFun(String) | settings_interaction_longPressFun |
setWearingSensitivity(String) | settings_wearing_sensitivity |
2.8. Schedule/Memo Sync
| Method | Signature | Purpose |
|---|---|---|
syncSchedule | CxrStatus syncSchedule(List<ScheduleInfo>, int type) | Sync schedules (type=0) or memos (type!=0) |
addSchedule | CxrStatus addSchedule(ScheduleInfo) | Add a single schedule |
removeSchedule | CxrStatus removeSchedule(ScheduleInfo) | Remove a single schedule |
2.9. App Management Extensions
| Method | Signature | Purpose |
|---|---|---|
stopApp | CxrStatus stopApp(String packageName, ApkStatusCallback) | Stop a running app on glasses |
isGlassAppInstalled | CxrStatus isGlassAppInstalled(String packageName, ApkStatusCallback) | Query if app is installed |
2.10. Translation Language Configuration
| Method | Signature | Purpose |
|---|---|---|
setTranslationLanguage | CxrStatus setTranslationLanguage(String from, String to, String modeInfo) | Set translation source/target language |
2.11. Factory Reset
| Method | Signature | Purpose |
|---|---|---|
notifyGlassRecovery | CxrStatus notifyGlassRecovery() | Sends “Sys_RestoreFactory” — factory reset glasses |
⚠️ Important:
This is a destructive operation with no confirmation prompt from the SDK side. Make sure to implement your own confirmation UI before calling this method.
2.12. Misc New Methods
| Method | Signature | Purpose |
|---|---|---|
sendExitEvent(boolean) | CxrStatus sendExitEvent(boolean isPlaySound) | Exit with control over exit sound |
notifyTtsAudioFinished(boolean) | CxrStatus notifyTtsAudioFinished(boolean flag) | TTS finished notification with boolean param |
initWifiP2P2 | CxrStatus initWifiP2P2(boolean connect, WifiP2PStatusCallback) | WiFi P2P init with connection control flag |
appLaunch | native void appLaunch() | New native method on CXRServiceBridge (internal) |
⚠️ Kotlin migration note:
getClassicMacAddress() does not exist on the public CxrApi class (verified via javap).
It was listed in the original changelog but cannot be called from consuming code.
2.13. File Sync Refactoring
startSync and syncSingleFile were refactored to delegate to new methods that accept an explicit address parameter:
| New Method | Signature |
|---|---|
startSync2 | boolean startSync2(String path, CxrMediaType[] types, String address, SyncStatusCallback) |
syncSingleFile2 | boolean syncSingleFile2(String path, CxrMediaType type, String file, String address, SyncStatusCallback) |
🔍 Note:
The original methods still exist but now delegate to these, using the internal WiFi P2P address.
3. Modified Behavior
3.1. WifiController — Significantly Overhauled
The WiFi P2P connection logic was substantially improved for reliability:
| Aspect | 1.0.4 | 1.0.8 |
|---|---|---|
| Device matching | By device name | By MAC address |
| Max retries | 3 | 10 |
| Connection timeout | 15 seconds | 30 seconds |
| Retry delay | 1 second | 2 seconds |
| Discovery mechanism | Single discoverPeers call | Periodic discovery with retry logic (up to 10 attempts) |
| BUSY error handling | None | Retries after 2s delay on error code 2 |
| Network state check | isConnected() | isConnectedOrConnecting() |
| Unknown network state | Triggers deinit | Early return (skip deinit) |
| Broadcast receiver | 3 actions | 4 actions (added THIS_DEVICE_CHANGED) |
| Target not found in peers | Silent return | Continue discovering with m42e() |
3.2. SceneStatusInfo — New Field
Added mixRecordRunning (boolean) field with getter/setter, indicating whether a combined audio+video recording is active. Used by the new isGlassCameraInUse() method.
3.3. CxrApi onValueUpdate — Expanded
The onValueUpdate handler grew from 2976 to 3901 instructions (~31% larger), reflecting all the new message types being handled (peripherals, WiFi list, glass status, camera, settings, schedules, etc.).
3.4. CxrApi deinitWifiP2P — Reset Flag
Now resets the WiFi P2P connection control flag (this.m = true) on deinit.
4. Native Library Changes
4.1. Removed: libcxr-sock-rfcomm-jni.so
The dedicated RFCOMM Bluetooth socket library was completely removed from both architectures. Its functionality was merged into libcxr-sock-proto-jni.so.
4.2. Size Changes
| Library | arm64-v8a 1.0.4 | arm64-v8a 1.0.8 | Change |
|---|---|---|---|
libcxr-sock-proto-jni.so | 207 KB | 614 KB | +196% (3x) |
libcxr-bridge-jni.so | 111 KB | 112 KB | +1.1% |
libcxr-sock-rfcomm-jni.so | 52 KB | — | Removed |
libcaps.so | 107 KB | 107 KB | Unchanged |
libflora-cli.so | 157 KB | 157 KB | Unchanged |
libmutils.so | 417 KB | 417 KB | Unchanged |
classes.jar | 120 KB | 133 KB | +10.5% |
🔍 Note:
The overall AAR size increased by ~34% (arm64) due to the massive growth of libcxr-sock-proto-jni.so, which absorbed RFCOMM functionality plus the new audio streaming and auth native code.
5. Unchanged Files
The following files had zero functional changes (only JADX decompiler renumbering artifacts):
Constants.java— identicalAudioController.java— identicalFileController.java— identical (including inner classesC0023a/C0024a,C0024b/C0025b)Caps.java— identicalLogUtil.java— identicalValueUtil.java— identical (all enums preserved)CheckUtil.java— identicalMd5Util.java— identicalGlassInfo.java— identicalIconInfo.java— identicalRKAppInfo.java— identicalRKWifiInfo.java— identicalScheduleInfo.java— identicalRetrofitClient.java— identicalRetrofitService.java— identicalFileData.java— identicalFileListResponse.java— identicalBaseNetworkResponse.java— identicalHeaderInterceptor.java— identical- All existing callbacks (except
WifiP2PStatusCallback) — identical - All existing listeners (except
AudioStreamListener,ArtcListener) — identical BuildConfig.java(cxr package) — identical- Obfuscated helper classes (
C0000a,C0001a,C0002a) — identical