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
// 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? {

View File

@@ -29,8 +29,8 @@ $platformInput = $input['platform'] ?? 'Unknown';
$platformMap = [
'com.ubercab.driver' => 'Uber',
'com.careem.adma' => 'Careem',
'me.jeeny.driver' => 'Jeeny',
'com.petraride.driver' => 'Petra Ride',
'me.com.easytaxista' => 'Jeeny',
'com.PetraRide_Captain' => 'Petra Ride',
'com.taxif.driver' => 'TaxiF'
];

View File

@@ -3,20 +3,25 @@
# Make sure device is connected
adb devices
echo "إرسال إشعار أوبر تجريبي..."
echo "إرسال إشعارات تجريبية..."
# Uber mock notification
adb shell cmd notification post -t "Uber" -S "bigtext" "1.50 JOD" "Pick up: Abdoun, 2 min, 0.5 km. Drop-off: 7th Circle. 1.50 JOD. Cash" com.ubercab.driver
adb shell cmd notification post -t "Uber" -S "bigtext" "New Ride" "السعر: 2.50 JOD. الوقت: 5 min." com.ubercab.driver
sleep 2
echo "إرسال إشعار كريم تجريبي..."
# Careem mock notification
adb shell cmd notification post -t "Careem" -S "bigtext" "New Ride" "Pickup in 3 mins. Expected fare JOD 2.00" com.careem.adma
adb shell cmd notification post -t "Careem" -S "bigtext" "طلب جديد" "سعر الرحلة 3.0 دينار أردني. يبعد 8 دقائق." com.careem.adma
sleep 2
echo "إرسال إشعار جيني تجريبي..."
# Jeeny mock notification
adb shell cmd notification post -t "Jeeny" -S "bigtext" "طلب جديد" "السعر: 1.20 دينار. المسافة: 1 كم" me.jeeny.driver
adb shell cmd notification post -t "Jeeny" -S "bigtext" "طلب جديد" "السعر: 1.20 دينار. المسافة: 1 كم" me.com.easytaxista
sleep 2
# Petra Ride mock notification
adb shell cmd notification post -t "Petra Ride" -S "bigtext" "تنبيه" "1.00 JOD" com.PetraRide_Captain
sleep 2
# TaxiF mock notification
adb shell cmd notification post -t "TaxiF" -S "bigtext" "رحلة جديدة" "السعر: 2 JOD" com.taxif.driver
echo "تم إرسال الإشعارات التجريبية."