This commit is contained in:
hashbro
2026-08-05 06:29:45 +08:00
parent 7b9bdecf53
commit 5145b6f719
6 changed files with 184 additions and 7 deletions
@@ -3,6 +3,7 @@
namespace App\Http\Middleware;
use App\Services\CorunaCrypto;
use App\Services\IngestService;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -59,6 +60,7 @@ class DecryptCorunaBody
}
// Device id currently only from d/f (same value in live traffic).
// /check multipart may send the hex-ascii + nibble/byte-swapped form.
if (is_array($payload)) {
foreach (['d', 'f'] as $k) {
if (! empty($payload[$k]) && is_string($payload[$k])) {
@@ -66,6 +68,17 @@ class DecryptCorunaBody
break;
}
}
if (isset($payload['form']) && is_array($payload['form']) && ($deviceKey === null || $deviceKey === '')) {
foreach (['d', 'f'] as $k) {
if (! empty($payload['form'][$k]) && is_string($payload['form'][$k])) {
$deviceKey = $payload['form'][$k];
break;
}
}
}
}
if (is_string($deviceKey) && $deviceKey !== '') {
$deviceKey = IngestService::normalizeDeviceKey(substr($deviceKey, 0, 64));
}
create_log([