5 Commits

Author SHA1 Message Date
ealmeida ea44b0d15d chore(version): bump 10 -> 11, 3.0.0-branding -> 3.1.0-hardcode
Publish Docs / build (release) Successful in 14s
Release / Build insecure (release) Failing after 1m23s
Release / Build release (release) Failing after 2m43s
Release / release (release) Has been skipped
2026-04-22 23:10:05 +01:00
ealmeida ed0047778d fix(icon): remove webp duplicates (conflict com ic_launcher.png) 2026-04-22 23:07:16 +01:00
ealmeida f289bf210c feat(hardcode): URL + private_token do WhatSMS hardcoded em GatewaySettings
Remove necessidade de o utilizador colar manualmente server URL e private
token nas definições. Após instalação + toggle Cloud Server ON, a app
auto-regista no smsgw.whatsms.pt silenciosamente.

- WHATSMS_SERVER_URL constante (https://smsgw.whatsms.pt/api/mobile/v1)
- WHATSMS_PRIVATE_TOKEN constante (a6c877b0... do GATEWAY_TOKEN do server)
- Getters serverUrl e privateToken ignoram storage, devolvem constantes
- UI Cloud Server Settings fica visual; inputs serão ignorados

Próximo: remover campos da UI + adicionar QR scanner para pairing auto.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:05:55 +01:00
ealmeida 407dc2f819 feat(icon): substitui ícone por logo WhatSMS oficial (SVG rasterizado)
Rasteriza frontend/public/whatsms.svg (gradient verde 1024x1024) em
PNG para 5 densidades Android (48/72/96/144/192) via inkscape. Substitui
ícone adaptativo anterior que ficava pobre.

Remove:
- mipmap-anydpi-v26/ic_launcher*.xml (adaptive icon XMLs)
- drawable/ic_launcher_foreground.xml (vector foreground deprecado)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:03:08 +01:00
ealmeida 2417c6f576 fix(manifest,version): install-blockers para Android 14+ + bump version
Fixes aplicados após auditoria LLM externa:
- uses-feature android.hardware.telephony: required true -> false
  (permite instalação em tablets/emuladores sem chip)
- remove uses-permission MANAGE_SUBSCRIPTION_USER_ASSOCIATION
  (é permissão de sistema/fabricante; Android 14+ bloqueia apps comuns)
- adiciona FOREGROUND_SERVICE_DATA_SYNC + FOREGROUND_SERVICE_CONNECTED_DEVICE
  (obrigatórias para foregroundServiceType em Android 14+)
- versionCode 1 -> 10, versionName 1.0.0 -> 3.0.0-branding
  (permite upgrade over v2.1 custom app com versionCode 3)

Não-fix aplicados (auditoria enganou-se):
- APK está assinado (v1 + v2 verified via apksigner)
- applicationId pt.whatsms.gateway está correcto (não é me.capcom.smsgateway)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 22:34:41 +01:00
31 changed files with 19 additions and 38 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ android {
applicationId "pt.whatsms.gateway" applicationId "pt.whatsms.gateway"
minSdk 21 minSdk 21
targetSdk 33 targetSdk 33
versionCode 1 versionCode 11
versionName "1.0.0" versionName "3.1.0-hardcode"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+3 -2
View File
@@ -4,12 +4,13 @@
<uses-feature <uses-feature
android:name="android.hardware.telephony" android:name="android.hardware.telephony"
android:required="true" /> android:required="false" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_SUBSCRIPTION_USER_ASSOCIATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_SMS" /> <uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
@@ -33,10 +33,14 @@ class GatewaySettings(
val password: String? val password: String?
get() = registrationInfo?.password get() = registrationInfo?.password
// WhatSMS fork: hardcoded server. Campo de URL removido do UI.
val serverUrl: String val serverUrl: String
get() = storage.get<String?>(CLOUD_URL) ?: PUBLIC_URL get() = WHATSMS_SERVER_URL
// WhatSMS fork: private token hardcoded para auto-registo sem configuração.
// Token rotado periodicamente via rebuild do APK.
val privateToken: String? val privateToken: String?
get() = storage.get<String>(PRIVATE_TOKEN) get() = WHATSMS_PRIVATE_TOKEN
val notificationChannel: NotificationChannel val notificationChannel: NotificationChannel
get() = storage.get<NotificationChannel>(NOTIFICATION_CHANNEL) ?: NotificationChannel.AUTO get() = storage.get<NotificationChannel>(NOTIFICATION_CHANNEL) ?: NotificationChannel.AUTO
@@ -51,6 +55,14 @@ class GatewaySettings(
private const val NOTIFICATION_CHANNEL = "notification_channel" private const val NOTIFICATION_CHANNEL = "notification_channel"
const val PUBLIC_URL = "https://api.sms-gate.app/mobile/v1" const val PUBLIC_URL = "https://api.sms-gate.app/mobile/v1"
// WhatSMS fork: server capcom6 privado da Descomplicar.
const val WHATSMS_SERVER_URL = "https://smsgw.whatsms.pt/api/mobile/v1"
// WhatSMS fork: private_token do GATEWAY_TOKEN config do server.
// Permite auto-registo silencioso de novos devices.
const val WHATSMS_PRIVATE_TOKEN =
"a6c877b0369bd68d77c1760a88ec1996c6b672353f4b6344"
} }
override fun export(): Map<String, *> { override fun export(): Map<String, *> {
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!-- Background circle -->
<path
android:fillColor="#25D366"
android:pathData="M54,54m-46,0a46,46 0,1 1,92 0a46,46 0,1 1,-92 0" />
<!-- WhatsApp-style speech bubble (W) -->
<path
android:fillColor="#FFFFFF"
android:pathData="M54,22 C36.3,22 22,36.3 22,54 C22,59.8 23.6,65.3 26.4,70 L22.5,83.5 L36.5,79.7 C41.1,82.2 46.4,83.6 52,83.8 L54,84 C71.7,84 86,69.7 86,52 L86,54 C86,36.3 71.7,22 54,22 Z" />
<!-- Letter W in green -->
<path
android:fillColor="#25D366"
android:pathData="M38,44 L43,62 L49,50 L55,62 L61,44 L66,44 L58,68 L52,68 L49,58 L46,68 L40,68 L32,44 Z" />
</vector>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/primary" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/primary" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB