diff --git a/app/.env.example b/app/.env.example index e145657..4102f9d 100644 --- a/app/.env.example +++ b/app/.env.example @@ -112,3 +112,13 @@ DEWEMOJI_EXTENSION_VERIFY_ENABLED=true DEWEMOJI_GOOGLE_PROJECT_ID= DEWEMOJI_GOOGLE_SERVER_KEY= DEWEMOJI_EXTENSION_IDS= + +DEWEMOJI_APK_RELEASE_ENABLED=false +DEWEMOJI_APK_PUBLIC_BASE_URL=https://dewemoji.com/downloads +DEWEMOJI_R2_PUBLIC_BASE_URL= +DEWEMOJI_R2_APK_LATEST_KEY=apk/dewemoji-latest.apk +DEWEMOJI_R2_APK_VERSION_KEY=apk/version.json +DEWEMOJI_APK_APP_ID=com.dewemoji.app +DEWEMOJI_APK_CHANNEL=stable +DEWEMOJI_APK_MIN_SUPPORTED_VERSION_CODE=1 +DEWEMOJI_APK_ASSETLINKS_SHA256= diff --git a/app/app/Http/Controllers/Api/V1/EmojiApiController.php b/app/app/Http/Controllers/Api/V1/EmojiApiController.php index abc090d..e0a6439 100644 --- a/app/app/Http/Controllers/Api/V1/EmojiApiController.php +++ b/app/app/Http/Controllers/Api/V1/EmojiApiController.php @@ -110,9 +110,9 @@ class EmojiApiController extends Controller $page = max((int) $request->query('page', 1), 1); $defaultLimit = max((int) config('dewemoji.pagination.default_limit', 20), 1); - $maxLimit = $tier === self::TIER_PRO - ? max((int) config('dewemoji.pagination.pro_max_limit', 50), 1) - : max((int) config('dewemoji.pagination.free_max_limit', 20), 1); + // Search result pagination is now feature-parity for all users. + // Keyword/glossary limits are enforced elsewhere (user_keywords quota logic). + $maxLimit = max((int) config('dewemoji.pagination.max_limit', 50), 1); $limit = min(max((int) $request->query('limit', $defaultLimit), 1), $maxLimit); $filtered = $this->filterItems($items, $q, $category, $subSlug); diff --git a/app/app/Http/Controllers/Web/SiteController.php b/app/app/Http/Controllers/Web/SiteController.php index 722491d..5cdf8a0 100644 --- a/app/app/Http/Controllers/Web/SiteController.php +++ b/app/app/Http/Controllers/Web/SiteController.php @@ -301,6 +301,43 @@ class SiteController extends Controller ]); } + public function assetLinks(): JsonResponse + { + $appId = trim((string) config('dewemoji.apk_release.app_id', '')); + $rawFingerprints = (array) config('dewemoji.apk_release.assetlinks.fingerprints', []); + $fingerprints = []; + foreach ($rawFingerprints as $fingerprint) { + $normalized = $this->normalizeApkCertFingerprint((string) $fingerprint); + if ($normalized !== '') { + $fingerprints[] = $normalized; + } + } + $fingerprints = array_values(array_unique($fingerprints)); + + if ($appId === '' || $fingerprints === []) { + return response()->json([], 200, [ + 'Cache-Control' => 'no-store, no-cache, must-revalidate', + 'Pragma' => 'no-cache', + ]); + } + + return response()->json([ + [ + 'relation' => [ + 'delegate_permission/common.handle_all_urls', + ], + 'target' => [ + 'namespace' => 'android_app', + 'package_name' => $appId, + 'sha256_cert_fingerprints' => $fingerprints, + ], + ], + ], 200, [ + 'Cache-Control' => 'no-store, no-cache, must-revalidate', + 'Pragma' => 'no-cache', + ]); + } + public function privacy(): View { return view('site.privacy'); @@ -514,6 +551,24 @@ class SiteController extends Controller return rtrim($base, '/').'/'.ltrim($objectKey, '/'); } + private function normalizeApkCertFingerprint(string $value): string + { + $clean = strtoupper(trim($value)); + if ($clean === '') { + return ''; + } + + if (preg_match('/^[0-9A-F]{64}$/', $clean) === 1) { + return implode(':', str_split($clean, 2)); + } + + if (preg_match('/^[0-9A-F]{2}(?::[0-9A-F]{2}){31}$/', $clean) === 1) { + return $clean; + } + + return ''; + } + /** * @param array $emoji */ diff --git a/app/config/dewemoji.php b/app/config/dewemoji.php index b95e5cd..3c191ac 100644 --- a/app/config/dewemoji.php +++ b/app/config/dewemoji.php @@ -135,5 +135,8 @@ return [ 'latest_apk' => (string) env('DEWEMOJI_R2_APK_LATEST_KEY', 'apk/dewemoji-latest.apk'), 'version_json' => (string) env('DEWEMOJI_R2_APK_VERSION_KEY', 'apk/version.json'), ], + 'assetlinks' => [ + 'fingerprints' => array_values(array_filter(array_map('trim', explode(',', (string) env('DEWEMOJI_APK_ASSETLINKS_SHA256', ''))))), + ], ], ]; diff --git a/app/resources/views/site/emoji-detail.blade.php b/app/resources/views/site/emoji-detail.blade.php index ec3bc73..e9e2cf6 100644 --- a/app/resources/views/site/emoji-detail.blade.php +++ b/app/resources/views/site/emoji-detail.blade.php @@ -111,8 +111,12 @@
{{ $symbol }}
-
- +
@@ -150,18 +154,12 @@
{{ $subcategory }} +

{{ $name }}

{{ $description }}

-
- -
- @if($supportsTone)
Skin tone
@@ -287,7 +285,7 @@
-
+
Copied! @@ -331,8 +329,15 @@ @push('scripts')