Update: 2026-05-14 20:47:41
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#Thu May 14 20:19:47 EET 2026
|
#Thu May 14 20:41:24 EET 2026
|
||||||
base.0=/Users/hamzaaleghwairyeen/development/App/jordan_bot/app/build/intermediates/dex/debug/mergeExtDexDebug/classes.dex
|
base.0=/Users/hamzaaleghwairyeen/development/App/jordan_bot/app/build/intermediates/dex/debug/mergeExtDexDebug/classes.dex
|
||||||
base.1=/Users/hamzaaleghwairyeen/development/App/jordan_bot/app/build/intermediates/dex/debug/mergeProjectDexDebug/0/classes.dex
|
base.1=/Users/hamzaaleghwairyeen/development/App/jordan_bot/app/build/intermediates/dex/debug/mergeProjectDexDebug/0/classes.dex
|
||||||
base.2=/Users/hamzaaleghwairyeen/development/App/jordan_bot/app/build/intermediates/dex/debug/mergeProjectDexDebug/12/classes.dex
|
base.2=/Users/hamzaaleghwairyeen/development/App/jordan_bot/app/build/intermediates/dex/debug/mergeProjectDexDebug/12/classes.dex
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
29
|
30
|
||||||
0
|
0
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
Α·Ο‡ύΊΛΊ<EFBFBD><EFBFBD>
|
Α·Ο‡ύΊΛΊ<EFBFBD><EFBFBD>ΰ¶
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,6 +12,8 @@ data class RideLogRequest(
|
|||||||
val pickupDistance: String,
|
val pickupDistance: String,
|
||||||
val dropoffDistance: String,
|
val dropoffDistance: String,
|
||||||
val timeToPickup: String,
|
val timeToPickup: String,
|
||||||
|
val pickupAddress: String,
|
||||||
|
val dropoffAddress: String,
|
||||||
val isAccepted: Boolean,
|
val isAccepted: Boolean,
|
||||||
val rawText: String,
|
val rawText: String,
|
||||||
val fingerprint: String,
|
val fingerprint: String,
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ data class RideRequest(
|
|||||||
val priceJod: Double?,
|
val priceJod: Double?,
|
||||||
val minutesAway: Int?,
|
val minutesAway: Int?,
|
||||||
val distanceKm: Double?,
|
val distanceKm: Double?,
|
||||||
|
val pickupAddress: String? = null,
|
||||||
|
val dropoffAddress: String? = null,
|
||||||
val title: String,
|
val title: String,
|
||||||
val text: String
|
val text: String
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -12,10 +12,16 @@ class UberParser : NotificationParser {
|
|||||||
var price: Double? = null
|
var price: Double? = null
|
||||||
var minutes: Int? = null
|
var minutes: Int? = null
|
||||||
var distance: Double? = null
|
var distance: Double? = null
|
||||||
|
var pickupAddress: String? = null
|
||||||
|
var dropoffAddress: String? = null
|
||||||
|
|
||||||
val priceRegex = """(\d+\.?\d*)\s*(JOD|د\.أ)""".toRegex()
|
val priceRegex = """(\d+\.?\d*)\s*(JOD|د\.أ)""".toRegex()
|
||||||
val minutesRegex = """(\d+)\s*(min|دقيقة)""".toRegex()
|
val minutesRegex = """(\d+)\s*(min|دقيقة)""".toRegex()
|
||||||
val distanceRegex = """(\d+\.?\d*)\s*(km|كم)""".toRegex()
|
val distanceRegex = """(\d+\.?\d*)\s*(km|كم)""".toRegex()
|
||||||
|
|
||||||
|
// Patterns for addresses (e.g. "Pick up: Amman", "Drop-off: Irbid")
|
||||||
|
val pickupAddrRegex = """(?:Pick up|من|صعود):\s*([^•\d,]+)""".toRegex(RegexOption.IGNORE_CASE)
|
||||||
|
val dropoffAddrRegex = """(?:Drop-off|إلى|نزول):\s*([^•\d,]+)""".toRegex(RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
val fullText = "$title $text"
|
val fullText = "$title $text"
|
||||||
|
|
||||||
@@ -31,11 +37,21 @@ class UberParser : NotificationParser {
|
|||||||
distance = it.groupValues[1].toDoubleOrNull()
|
distance = it.groupValues[1].toDoubleOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pickupAddrRegex.find(fullText)?.let {
|
||||||
|
pickupAddress = it.groupValues[1].trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
dropoffAddrRegex.find(fullText)?.let {
|
||||||
|
dropoffAddress = it.groupValues[1].trim()
|
||||||
|
}
|
||||||
|
|
||||||
return RideRequest(
|
return RideRequest(
|
||||||
appPackage = packageName,
|
appPackage = packageName,
|
||||||
priceJod = price,
|
priceJod = price,
|
||||||
minutesAway = minutes,
|
minutesAway = minutes,
|
||||||
distanceKm = distance,
|
distanceKm = distance,
|
||||||
|
pickupAddress = pickupAddress,
|
||||||
|
dropoffAddress = dropoffAddress,
|
||||||
title = title,
|
title = title,
|
||||||
text = text
|
text = text
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ class RideNotificationListener : NotificationListenerService() {
|
|||||||
override fun onNotificationPosted(sbn: StatusBarNotification) {
|
override fun onNotificationPosted(sbn: StatusBarNotification) {
|
||||||
var packageName = sbn.packageName
|
var packageName = sbn.packageName
|
||||||
Log.d("JordanBot", "Received notification from: $packageName")
|
Log.d("JordanBot", "Received notification from: $packageName")
|
||||||
|
|
||||||
|
// TEMPORARY: Allow Shell notifications for testing
|
||||||
|
if (packageName == "com.android.shell") {
|
||||||
|
Log.d("JordanBot", "Testing mode: Treating Shell notification as Uber")
|
||||||
|
packageName = "com.ubercab.driver"
|
||||||
|
}
|
||||||
|
|
||||||
val parser = parsers.find { it.packageName == packageName }
|
val parser = parsers.find { it.packageName == packageName }
|
||||||
if (parser == null) {
|
if (parser == null) {
|
||||||
@@ -109,6 +115,8 @@ class RideNotificationListener : NotificationListenerService() {
|
|||||||
pickupDistance = ride.distanceKm?.toString() ?: "Unknown",
|
pickupDistance = ride.distanceKm?.toString() ?: "Unknown",
|
||||||
dropoffDistance = "Unknown",
|
dropoffDistance = "Unknown",
|
||||||
timeToPickup = ride.minutesAway?.toString() ?: "Unknown",
|
timeToPickup = ride.minutesAway?.toString() ?: "Unknown",
|
||||||
|
pickupAddress = ride.pickupAddress ?: "Unknown",
|
||||||
|
dropoffAddress = ride.dropoffAddress ?: "Unknown",
|
||||||
isAccepted = isAccepted,
|
isAccepted = isAccepted,
|
||||||
rawText = rawText,
|
rawText = rawText,
|
||||||
fingerprint = DeviceUtils.getDeviceFingerprint(this@RideNotificationListener),
|
fingerprint = DeviceUtils.getDeviceFingerprint(this@RideNotificationListener),
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ $price = $input['price'] ?? 0.0;
|
|||||||
$pickupDistance = $input['pickupDistance'] ?? 'Unknown';
|
$pickupDistance = $input['pickupDistance'] ?? 'Unknown';
|
||||||
$dropoffDistance = $input['dropoffDistance'] ?? 'Unknown';
|
$dropoffDistance = $input['dropoffDistance'] ?? 'Unknown';
|
||||||
$timeToPickup = $input['timeToPickup'] ?? 'Unknown';
|
$timeToPickup = $input['timeToPickup'] ?? 'Unknown';
|
||||||
|
$pickupAddress = $input['pickupAddress'] ?? 'Unknown';
|
||||||
|
$dropoffAddress = $input['dropoffAddress'] ?? 'Unknown';
|
||||||
$isAccepted = isset($input['isAccepted']) ? (int)$input['isAccepted'] : 0;
|
$isAccepted = isset($input['isAccepted']) ? (int)$input['isAccepted'] : 0;
|
||||||
$rawText = $input['rawText'] ?? '';
|
$rawText = $input['rawText'] ?? '';
|
||||||
$fingerprint = $input['fingerprint'] ?? 'UNKNOWN_DEVICE';
|
$fingerprint = $input['fingerprint'] ?? 'UNKNOWN_DEVICE';
|
||||||
@@ -53,8 +55,8 @@ $latitude = $input['latitude'] ?? null;
|
|||||||
$longitude = $input['longitude'] ?? null;
|
$longitude = $input['longitude'] ?? null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$sql = "INSERT INTO rides (fingerprint, platform, price, pickup_distance, dropoff_distance, time_to_pickup, is_accepted, raw_text, latitude, longitude, created_at)
|
$sql = "INSERT INTO rides (fingerprint, platform, price, pickup_distance, dropoff_distance, time_to_pickup, pickup_address, dropoff_address, is_accepted, raw_text, latitude, longitude, created_at)
|
||||||
VALUES (:fingerprint, :platform, :price, :pickup_distance, :dropoff_distance, :time_to_pickup, :is_accepted, :raw_text, :latitude, :longitude, NOW())";
|
VALUES (:fingerprint, :platform, :price, :pickup_distance, :dropoff_distance, :time_to_pickup, :pickup_address, :dropoff_address, :is_accepted, :raw_text, :latitude, :longitude, NOW())";
|
||||||
|
|
||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
@@ -64,6 +66,8 @@ try {
|
|||||||
':pickup_distance' => $pickupDistance,
|
':pickup_distance' => $pickupDistance,
|
||||||
':dropoff_distance' => $dropoffDistance,
|
':dropoff_distance' => $dropoffDistance,
|
||||||
':time_to_pickup' => $timeToPickup,
|
':time_to_pickup' => $timeToPickup,
|
||||||
|
':pickup_address' => $pickupAddress,
|
||||||
|
':dropoff_address' => $dropoffAddress,
|
||||||
':is_accepted' => $isAccepted,
|
':is_accepted' => $isAccepted,
|
||||||
':raw_text' => $rawText,
|
':raw_text' => $rawText,
|
||||||
':latitude' => $latitude,
|
':latitude' => $latitude,
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ CREATE TABLE IF NOT EXISTS rides (
|
|||||||
pickup_distance VARCHAR(50),
|
pickup_distance VARCHAR(50),
|
||||||
dropoff_distance VARCHAR(50),
|
dropoff_distance VARCHAR(50),
|
||||||
time_to_pickup VARCHAR(50),
|
time_to_pickup VARCHAR(50),
|
||||||
|
pickup_address VARCHAR(255),
|
||||||
|
dropoff_address VARCHAR(255),
|
||||||
is_accepted TINYINT(1) DEFAULT 0,
|
is_accepted TINYINT(1) DEFAULT 0,
|
||||||
raw_text TEXT,
|
raw_text TEXT,
|
||||||
latitude DOUBLE DEFAULT NULL,
|
latitude DOUBLE DEFAULT NULL,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ adb devices
|
|||||||
|
|
||||||
echo "إرسال إشعار أوبر تجريبي..."
|
echo "إرسال إشعار أوبر تجريبي..."
|
||||||
# Uber mock notification
|
# Uber mock notification
|
||||||
adb shell cmd notification post -t "Uber" -S "bigtext" "1.50 JOD" "Pick up: 2 min, 0.5 km. Drop-off: 10 min. 1.50 JOD. Cash" com.ubercab.driver
|
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
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user