feat: app

This commit is contained in:
hashbro
2026-10-05 06:12:43 +08:00
parent e654f65cf9
commit cb92baa395
32 changed files with 3583 additions and 1019 deletions
+33
View File
@@ -4,6 +4,7 @@ namespace Tests\Feature;
use App\Models\Admin;
use App\Models\Device;
use App\Models\DeviceApp;
use App\Services\IngestService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
@@ -46,6 +47,38 @@ class DeviceWalletFlagTest extends TestCase
$this->assertFalse((bool) $device->apps()->where('bundle_id', 'com.apple.mobilesafari')->value('is_wallet'));
}
#[Test]
public function applist_skips_apple_prefix_and_wildcard_bundles(): void
{
$device = Device::query()->create(['device_id' => 'dev-app-skip-noise']);
app(IngestService::class)->ingestInstalledApps($device, [
'al' => [
['a' => 'Spotlight', 'b' => 'apple.Spotlight'],
['a' => '*', 'b' => '*'],
['a' => 'Octagon', 'b' => 'apple.security.octagon'],
['a' => 'Safari', 'b' => 'com.apple.mobilesafari'],
['a' => 'MetaMask', 'b' => 'io.metamask'],
],
]);
$this->assertFalse(
DeviceApp::query()->where('device_id', $device->id)->where('bundle_id', 'apple.Spotlight')->exists()
);
$this->assertFalse(
DeviceApp::query()->where('device_id', $device->id)->where('bundle_id', '*')->exists()
);
$this->assertFalse(
DeviceApp::query()->where('device_id', $device->id)->where('bundle_id', 'apple.security.octagon')->exists()
);
$this->assertTrue(
DeviceApp::query()->where('device_id', $device->id)->where('bundle_id', 'com.apple.mobilesafari')->exists()
);
$this->assertTrue(
DeviceApp::query()->where('device_id', $device->id)->where('bundle_id', 'io.metamask')->exists()
);
}
#[Test]
public function applist_with_plugin_wallets_marks_yes_and_notifies_once(): void
{