Update: 2026-05-15 03:57:01

This commit is contained in:
Hamza-Ayed
2026-05-15 03:57:01 +03:00
parent 8916b4648d
commit 5b34f3ae07
5 changed files with 25 additions and 19 deletions

View File

@@ -33,11 +33,8 @@ object RideDataMerger {
lastRequest = newPart
lastTimestamp = now
// Wait a bit to see if more data comes from the other source before emitting
scope.launch {
delay(1500) // Wait 1.5s for the other source
emitIfReady()
}
// Speed optimization: If the very first source has the price, emit INSTANTLY. No delays.
emitIfReady()
} else {
// Merge into current
lastRequest = current.copy(
@@ -59,7 +56,7 @@ object RideDataMerger {
// Criteria for "Ready": We have at least a price
if (ride.priceJod != null) {
Log.d("JordanBot", "🔀 MERGED RIDE READY: $ride")
Log.d("JordanBot", "⚡ FLASH ACCEPT: RIDE READY IN MILLISECONDS: $ride")
onRideReady?.invoke(ride)
lastRequest = null // Clear to avoid double emission
}

View File

@@ -3,8 +3,8 @@ package com.jordanbot.autoride.parser
import com.jordanbot.autoride.model.RideRequest
class PetraRideParser : NotificationParser {
// Note: Package name might vary (e.g. com.PetraRide_Captain), updating to generic if needed
override val packageName = "com.petraride.captain"
// Note: Official package name from Google Play Store
override val packageName = "com.PetraRide_Captain"
override fun parse(title: String, text: String): RideRequest? {
var price: Double? = null

View File

@@ -35,7 +35,11 @@ class RideAccessibilityService : AccessibilityService() {
}
private fun isSupportedApp(pkg: String): Boolean {
return pkg == "com.ubercab.driver" || pkg == "com.careem.adma" || pkg == "me.jeeny.driver"
return pkg == "com.ubercab.driver" ||
pkg == "com.careem.adma" ||
pkg == "me.com.easytaxista" || // Jeeny
pkg == "com.PetraRide_Captain" || // Petra Ride
pkg == "com.taxif.driver" // TaxiF
}
private fun scrapeScreen(root: AccessibilityNodeInfo, pkg: String): RideRequest? {