Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 209 additions & 0 deletions app/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />

<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" />

<!-- ComposeMainActivity hides the overlays of other apps, so they cannot trick a tap (tapjacking). -->
<uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />

<!-- To receive data from xdrip. -->
<uses-permission android:name="com.eveningoutpost.dexdrip.permissions.RECEIVE_BG_ESTIMATE" />

<!-- To receive data from Aidex -->
<uses-permission android:name="com.microtechmd.cgms.aidex.permissions.RECEIVE_BG_ESTIMATE" />

<application
android:name="app.aaps.MainApp"
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
android:icon="${appIcon}"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="${appIconRound}"
android:supportsRtl="true"
android:theme="@style/AppTheme.Launcher">
<profileable android:shell="true" />

<!-- Samsung One UI 7+ shows the persistent notification in its own "Live Notifications"
drawer section and lock-screen "Now Bar" through a proprietary mechanism, separate
from (and not yet replaced by) Android's standard promoted-notification APIs used in
PersistentNotificationPlugin. This meta-data is required for Samsung's system UI to
consider the app eligible; see the "android.ongoingActivityNoti.*" notification
extras added in PersistentNotificationPlugin.applySamsungLiveUpdate(). -->
<meta-data
android:name="com.samsung.android.support.ongoing_activity"
android:value="true" />

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAI3JiApyMrbP2QFzZ2fYfCPsgjkRp53Dm2S1-zPQ" />

<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />

<activity
android:name="app.aaps.ComposeMainActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- Shown instead of the app when its settings cannot be opened. -->
<activity
android:name="app.aaps.settingsstore.SettingsUnreadableActivity"
android:exported="false"
android:theme="@style/AppTheme.NoActionBar" />

<!-- Powers the screen on for a background alarm without USE_FULL_SCREEN_INTENT.
Fired by AlarmManager.setAlarmClock() from AlarmNotificationManager. -->
<receiver
android:name="app.aaps.implementation.androidNotification.AlarmScreenWakeReceiver"
android:exported="false" />

<!-- "Mute" action on the background alarm notification → silences the looping alarm. -->
<receiver
android:name="app.aaps.implementation.androidNotification.AlarmMuteReceiver"
android:exported="false" />

<!-- "Time to eat" timer: its alarm (setAlarmClock) and the Stop / +5 min notification buttons. -->
<receiver
android:name="app.aaps.implementation.alerts.EatReminderReceiver"
android:exported="false" />

<!-- Receive new BG readings from other local apps -->
<receiver
android:name="app.aaps.receivers.DataReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<!-- Receiver from xDrip -->
<action android:name="com.eveningoutpost.dexdrip.BgEstimate" />
<!-- Receiver from 640g uploader -->
<action android:name="com.eveningoutpost.dexdrip.NS_EMULATOR" />
<!-- Receiver from glimp -->
<action android:name="it.ct.glicemia.ACTION_GLUCOSE_MEASURED" />
<!-- Receiver from Dexcom -->
<action android:name="com.dexcom.cgm.EXTERNAL_BROADCAST" />
<action android:name="com.dexcom.g7.EXTERNAL_BROADCAST" />
<!-- Receiver from Poctech -->
<action android:name="com.china.poctech.data" />
<!-- Receiver from Tomato -->
<action android:name="com.fanqies.tomatofn.BgEstimate" />
<!-- Receiver from GlucoRx Aidex -->
<action android:name="com.microtechmd.cgms.aidex.action.BgEstimate" />
<!-- Receiver from patched Ottai app (International) -->
<action android:name="info.nightscout.androidaps.action.OTTAI_APP" />
<!-- Receiver from patched Syai Tag app -->
<action android:name="info.nightscout.androidaps.action.SYAI_TAG_APP" />
<!-- Receiver from patched Ottai app (China) -->
<action android:name="cn.diyaps.sharing.OT_APP" />
<!-- Receiver from patched SI app -->
<action android:name="cn.diyaps.sharing.SI_APP" />
<!-- Receiver from Sibionics app, handled by the same plugin as SI app -->
<action android:name="com.diyaps.sharing.SIBIO_APP" />
<!-- Receiver from patched Sino app -->
<action android:name="cn.diyaps.sharing.SINO_APP" />
<!-- Receiver from Instara App -->
<!-- NOTE: The action name for Instara App is still called Teljane -->
<action android:name="info.nightscout.androidaps.action.Teljane_APP" />
</intent-filter>
</receiver>

<!-- Receive new SMS messages -->
<receiver
android:name="app.aaps.receivers.SmsReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>

<!-- Receive ignore 5m, 15m, 30m requests for carb notifications -->
<receiver
android:name="app.aaps.receivers.CarbSuggestionReceiver"
android:exported="false" />

<!-- Auto start -->
<receiver
android:name="app.aaps.receivers.AutoStartReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

<!-- Moved here from :plugins:main together with the class. The service field injects, and a
members injector is generated code, which a multiplatform module cannot produce. -->
<service
android:name="app.aaps.persistentNotification.DummyService"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="Keeps AndroidAPS alive for continuous automated insulin delivery (artificial pancreas loop)." />
</service>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>

<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<!-- WorkManager on-demand initialization: remove the default initializer so MainApp's
Configuration.Provider (with MetroWorkerFactory) is used instead. -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>

</application>

</manifest>
14 changes: 14 additions & 0 deletions app/main/assets/definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Latest versions": "",
"30": "3.3.2.0",
"31": "3.3.2.0",
"32": "3.3.2.0",
"33": "3.3.2.0",
"34": "3.3.2.0",
"35": "3.3.2.0",
"36": "3.3.2.0",
"37": "3.3.2.0",
"38": "3.3.2.0",
"Expire dates": "",
"3.3.0.0": "2025-05-30"
}
38 changes: 38 additions & 0 deletions app/main/assets/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<configuration>
<!-- Create a file appender for a log in the application's data directory -->
<property name="EXT_FILES_DIR" scope="context" value="${EXT_DIR:-/sdcard}" />
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${EXT_FILES_DIR}/AndroidAPS.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover. Make sure the path matches the one in the file element or else
the rollover logs are placed in the working directory. -->
<fileNamePattern>${EXT_FILES_DIR}/AndroidAPS._%d{yyyy-MM-dd}_%d{HH-mm-ss, aux}_.%i.zip
</fileNamePattern>

<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days' worth of history -->
<maxHistory>120</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %.-1level/%logger: %msg%n</pattern>
</encoder>
</appender>

<appender name="logcat" class="ch.qos.logback.classic.android.LogcatAppender">
<tagEncoder>
<pattern>%logger{0}</pattern>
</tagEncoder>
<encoder>
<pattern>[%thread]: %msg%n</pattern>
</encoder>
</appender>

<!-- Write INFO (and higher-level) messages to the log file -->
<root level="DEBUG">
<appender-ref ref="file" />
<appender-ref ref="logcat" />
</root>
</configuration>
14 changes: 14 additions & 0 deletions app/main/assets/revoked_certs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Demo certificate
51:6D:12:67:4C:27:F4:9B:9F:E5:42:9B:01:B3:98:E4:66:2B:85:B7:A8:DD:70:32:B7:6A:D7:97:9A:0D:97:10
#Leaked
55:5D:70:C9:BE:10:41:7E:4B:01:A9:C4:C6:44:4A:F8:69:71:35:25:ED:95:23:16:C7:15:E8:EB:C6:08:FC:B1
# àqΣnΖ`ZϼγwÛ/τàΒϳ9Φ'$ΑϵžλUΛ`ÆÌΣЃA
E0:71:A3:6E:96:60:5A:FC:B3:77:DB:2F:C4:E0:92:F3:39:A6:27:24:91:F5:7E:BB:55:9B:60:C6:CC:A3:03:41
# 2ΙšÄΠΒϨÒÇeЄtЄЗž-*Ж*ZcHijЊÄœ<|x"Ε
32:99:61:C4:A0:92:E8:D2:C7:65:04:74:04:17:7E:2D:2A:16:2A:5A:63:48:69:6A:0A:C4:53:3C:7C:78:22:95
# mςRr¡ЇζΛLφK&ĐΨ5CnЎϴPDñЍŒkϼ{ΨδwВb
6D:C2:52:72:A1:07:B6:9B:4C:C6:4B:26:10:A8:35:43:6E:0E:F4:50:44:F1:0D:52:6B:FC:7B:A8:B4:77:12:62
# èΩQ\kné8EΔËZKòΓϳ^ΙÈμXÄ~Éìϰηmô΢ЉЋ
E8:A9:51:5C:6B:6E:E9:38:45:94:CB:5A:4B:F2:93:F3:5E:99:C8:BC:58:C4:7E:C9:EC:F0:B7:6D:F4:A2:09:0B
# gsЂ?ν°ćЅϯk0ϸÇ$rЁ3ΥЕϹϿΘt4βΛmÄ|I´І
67:73:02:3F:BD:B0:07:05:EF:6B:30:F8:C7:24:72:01:33:A5:15:F9:FF:98:74:34:B2:9B:6D:C4:7C:49:B4:06
12 changes: 12 additions & 0 deletions app/main/kotlin/app/aaps/AppLanguage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package app.aaps

import app.aaps.core.interfaces.resources.LanguageTag

/**
* The language Android should show AAPS in, as a BCP 47 tag, or null for the phone's language.
*
* [stored] is the AAPS language setting (`StringKey.GeneralLanguage`), with its old values fixed up by
* [LanguageTag]. Simple mode always follows the phone.
*/
internal fun appLanguageTag(stored: String, simpleMode: Boolean): String? =
if (simpleMode) null else LanguageTag.of(stored)
Loading