Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
834ecf5
_
Justonice2019 Sep 11, 2025
9f1f889
feat: 兼容安卓8.1, 增加记事本栏目, 可通过网页登录ns
Justonice2019 Sep 11, 2025
ecda089
fix: 编译报错
Justonice2019 Sep 11, 2025
13b249c
feat: 增加记事本栏目, 可通过网页登录ns
Justonice2019 Sep 11, 2025
0da0918
fix: 编译报错, 去除代码git未提交导致编译报错
Justonice2019 Sep 12, 2025
2346819
feat: 增加记事本栏目, 可通过网页登录ns
Justonice2019 Sep 12, 2025
891ea9d
feat: 增加记事本栏目, 可通过网页登录ns
Justonice2019 Sep 12, 2025
328ca53
feat: 增加记事本栏目, 可通过网页登录ns
Justonice2019 Oct 23, 2025
f2680c6
feat: 调整记事本导航栏, 默认展开配置生成器
Justonice2019 Dec 6, 2025
a36971e
fix: 去除背景定位提醒的弹窗
Justonice2019 Dec 6, 2025
3397b1f
feat: 让ns连接可以支持http协议
Justonice2019 Dec 8, 2025
f472965
feat: 开始编写远程打药逻辑
Justonice2019 Jan 13, 2026
4067384
feat: 开始编写远程打药逻辑
Justonice2019 Jan 13, 2026
d6fa948
feat: 完善餐食详情
Justonice2019 Jan 18, 2026
b1bacca
feat:
Justonice2019 Jan 19, 2026
9e63e53
feat: 开始编写远程打药逻辑
Justonice2019 Jan 19, 2026
7a1bccc
feat: 开始编写远程打药逻辑
Justonice2019 Jan 19, 2026
fdfc8f6
feat: 开始编写远程打药逻辑
Justonice2019 Jan 20, 2026
324d9e8
feat: 开始编写远程打药逻辑有报错的
Justonice2019 Jan 20, 2026
8c486f4
_
Justonice2019 Jan 21, 2026
4471dd3
feat: 完成http更新远程treatment状态
Justonice2019 Jan 21, 2026
d7005b3
feat: 初步完成远程打药功能
Justonice2019 Jan 21, 2026
c2b236d
feat: 基本完成所有的网络远程打药并添加了谷歌密码校验器校验
Justonice2019 Jan 21, 2026
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
36 changes: 36 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 笔记
````
engineering_mode
````

## 如何支持此项目?
软件遵循GPL V3协议,是完全开源免费的,但开发者写代码、维护需要投入大量时间精力。
大家的支持是项目得以延续的动力。
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ android {

}

useLibrary("org.apache.http.legacy")
// useLibrary("org.apache.http.legacy")

//Deleting it causes a binding error
buildFeatures {
Expand Down Expand Up @@ -281,7 +281,7 @@ println("-------------------")
if (!gitAvailable()) {
throw GradleException("GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it")
}
if (isMaster() && !allCommitted()) {
throw GradleException("There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update")
}
// if (isMaster() && !allCommitted()) {
// throw GradleException("There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update")
// }

11 changes: 8 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- 添加uses-sdk配置 -->
<uses-sdk android:minSdkVersion="26"
tools:overrideLibrary="app.aaps.pump.eopatch.core,app.aaps.shared.impl,app.aaps.core.interfaces,app.aaps.core.ui,app.aaps.core.main,app.aaps.database,app.aaps.plugins.main,app.aaps.plugins.aps,app.aaps.plugins.pump,app.aaps.plugins.sms,app.aaps.plugins.constraints,app.aaps.plugins.general,app.aaps.plugins.source,app.aaps.implementation,com.joanzapata.iconify" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
Expand Down Expand Up @@ -40,7 +43,9 @@
android:restoreAnyVersion="true"
android:roundIcon="${appIconRound}"
android:supportsRtl="true"
android:theme="@style/AppTheme.Launcher">
android:theme="@style/AppTheme.Launcher"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true">

<meta-data
android:name="com.google.android.gms.version"
Expand Down
30 changes: 29 additions & 1 deletion app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import java.util.Calendar
import java.util.GregorianCalendar
import javax.inject.Inject
import kotlin.math.min
import android.graphics.Point
import android.os.Build

class HistoryBrowseActivity : TranslatedDaggerAppCompatActivity() {

Expand Down Expand Up @@ -128,7 +130,33 @@ class HistoryBrowseActivity : TranslatedDaggerAppCompatActivity() {
.show(supportFragmentManager, "history_date_picker")
}

windowManager.currentWindowMetrics
// windowManager.currentWindowMetrics
// 如果需要屏幕尺寸,使用兼容性代码
val screenWidth: Int
val screenHeight: Int

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Android 11 (API 30+) 使用currentWindowMetrics
val wm = windowManager.currentWindowMetrics
screenWidth = wm.bounds.width()
screenHeight = wm.bounds.height()
} else {
// Android 10及以下使用defaultDisplay
val display = windowManager.defaultDisplay
val size = Point()
display.getSize(size)
screenWidth = size.x
screenHeight = size.y
}

axisWidth = when {
resources.displayMetrics.densityDpi <= 120 -> 3
resources.displayMetrics.densityDpi <= 160 -> 10
resources.displayMetrics.densityDpi <= 320 -> 35
resources.displayMetrics.densityDpi <= 420 -> 50
resources.displayMetrics.densityDpi <= 560 -> 70
else -> 80
}

axisWidth = when {
resources.displayMetrics.densityDpi <= 120 -> 3
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/kotlin/app/aaps/di/PluginsListModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import app.aaps.plugins.main.general.persistentNotification.PersistentNotificati
import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin
import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin
import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
import app.aaps.plugins.main.profile.NotePlugin
import app.aaps.plugins.main.profile.ProfilePlugin
import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin
import app.aaps.plugins.sensitivity.SensitivityOref1Plugin
Expand Down Expand Up @@ -501,4 +502,11 @@ abstract class PluginsListModule {

@Qualifier
annotation class Unfinished

@Binds
@AllConfigs
@IntoMap
@IntKey(6) // 使用一个未使用的key值
abstract fun bindNotePlugin(plugin: NotePlugin): PluginBase

}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ object Versions {
const val ndkVersion = "21.1.6352462"

const val compileSdk = 35
const val minSdk = 30
const val minSdk = 26
const val targetSdk = 30
const val wearMinSdk = 28
const val wearMinSdk = 26
const val wearTargetSdk = 29

val javaVersion = JavaVersion.VERSION_21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface ConfigBuilder {
pluginViewHolders: ArrayList<PluginViewHolderInterface>,
activity: FragmentActivity,
parent: LinearLayout,
showExpanded: Boolean = false
showExpanded: Boolean = true
)

fun interface PluginViewHolderInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ data class NSBolus(
override var app: String? = null,
val insulin: Double,
val type: BolusType,
val isBasalInsulin: Boolean

val isBasalInsulin: Boolean,
) : NSTreatment {

enum class BolusType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ data class NSBolusWizard(
override val pumpSerial: String?,
override var app: String? = null,
val bolusCalculatorResult: String?,
val glucose: Double?
val glucose: Double?,
) : NSTreatment
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ data class NSCarbs(
override val pumpSerial: String?,
override var app: String? = null,
val carbs: Double,
val duration: Long?
val duration: Long?,
) : NSTreatment
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ data class NSEffectiveProfileSwitch(
val originalTimeshift: Long,
val originalPercentage: Int,
val originalDuration: Long,
val originalEnd: Long

val originalEnd: Long,
) : NSTreatment
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ data class NSExtendedBolus(
val duration: Long,
val enteredinsulin: Double,
val isEmulatingTempBasal: Boolean?,
val rate: Double?
val rate: Double?,
) : NSTreatment
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app.aaps.core.nssdk.localmodel.treatment

import app.aaps.core.nssdk.localmodel.entry.NsUnits


interface NSTreatment {
var date: Long?
val device: String?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package app.aaps.core.nssdk.localmodel.treatment

import com.google.gson.annotations.SerializedName

@Suppress("unused")
enum class RemoteEventType(val text: String) {
@SerializedName("Meal Bolus") MEAL_BOLUS("Meal Bolus"),
// @SerializedName("Site Change") CANNULA_CHANGE("Site Change"),
// @SerializedName("Insulin Change") INSULIN_CHANGE("Insulin Change"),
// @SerializedName("Pump Battery Change") PUMP_BATTERY_CHANGE("Pump Battery Change"),
// @SerializedName("Sensor Change") SENSOR_CHANGE("Sensor Change"),
// @SerializedName("Sensor Start") SENSOR_STARTED("Sensor Start"),
// @SerializedName("Sensor Stop") SENSOR_STOPPED("Sensor Stop"),
// @SerializedName("BG Check") FINGER_STICK_BG_VALUE("BG Check"),
// @SerializedName("Exercise") EXERCISE("Exercise"),
// @SerializedName("Announcement") ANNOUNCEMENT("Announcement"),
// @SerializedName("SettingsExport") SETTINGS_EXPORT("Settings Export"),
// @SerializedName("Question") QUESTION("Question"),
// @SerializedName("Note") NOTE("Note"),
// @SerializedName("OpenAPS Offline") APS_OFFLINE("OpenAPS Offline"),
// @SerializedName("D.A.D. Alert") DAD_ALERT("D.A.D. Alert"),
// @SerializedName("Mbg") NS_MBG("Mbg"),
//
// // Used but not as a Therapy Event (use constants only)
// @SerializedName("Carb Correction") CARBS_CORRECTION("Carb Correction"),
// @SerializedName("Bolus Wizard") BOLUS_WIZARD("Bolus Wizard"),
// @SerializedName("Correction Bolus") CORRECTION_BOLUS("Correction Bolus"),
//
// @SerializedName("Combo Bolus") COMBO_BOLUS("Combo Bolus"),
// @SerializedName("Temporary Target") TEMPORARY_TARGET("Temporary Target"),
// @SerializedName("Temporary Target Cancel") TEMPORARY_TARGET_CANCEL("Temporary Target Cancel"),
// @SerializedName("Profile Switch") PROFILE_SWITCH("Profile Switch"),
// @SerializedName("Snack Bolus") SNACK_BOLUS("Snack Bolus"),
// @SerializedName("Temp Basal") TEMPORARY_BASAL("Temp Basal"),
// @SerializedName("Temp Basal Start") TEMPORARY_BASAL_START("Temp Basal Start"),
// @SerializedName("Temp Basal End") TEMPORARY_BASAL_END("Temp Basal End"),
//
// @SerializedName("") ERROR(""),
@SerializedName("<none>") NONE("<none>");

companion object {
fun fromString(text: String?) = entries.firstOrNull { it.text == text } ?: NONE
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package app.aaps.core.nssdk.localmodel.treatment

import app.aaps.core.nssdk.localmodel.entry.NsUnits

data class RemoteNSBolus(
val _remoteEventType: RemoteEventType?,
val _phoneNumber: String?,
val _insulin: Double?,
var _status: String?,
var _verifyCode: String?,
override var date: Long?,
override val device: String? = null,
override val identifier: String?,
override val units: NsUnits? = null,
override val srvModified: Long? = null,
override val srvCreated: Long? = null,
override var utcOffset: Long?,
override val subject: String? = null,
override var isReadOnly: Boolean = false,
override val isValid: Boolean,
override val eventType: EventType,
override val notes: String?,
override val pumpId: Long?,
override val endId: Long?,
override val pumpType: String?,
override val pumpSerial: String?,
override var app: String? = null,
val insulin: Double?,
val type: BolusType,
val isBasalInsulin: Boolean,
) : NSTreatment {

enum class BolusType {
NORMAL,
SMB,
PRIMING;

companion object {

fun fromString(name: String?) = entries.firstOrNull { it.name == name } ?: NORMAL
}
}
}
Loading
Loading