File tree Expand file tree Collapse file tree 8 files changed +26
-2
lines changed
java/io/github/vvb2060/ims Expand file tree Collapse file tree 8 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ TurboIMS is a tool that allows you to enable or disable IMS features like Voice
3535- ** Customizable IMS Features** :
3636 - ** Carrier Name** : Override the carrier name displayed on your device.
3737 - ** Country ISO** : Force modify operator country code (Requires Android 14+).
38+ - ** IMS User Agent** : Override the IMS User Agent string.
3839 - ** VoLTE (Voice over LTE)** : Enable high-definition voice calls over 4G.
3940 - ** VoWiFi (Wi-Fi Calling)** : Make calls over Wi-Fi networks, with options for Wi-Fi only mode.
4041 - ** VT (Video Calling)** : Enable IMS-based video calls.
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ TurboIMS 是一个允许您在 Google Pixel 手机上启用或禁用 VoLTE(高
3535- ** 可定制的 IMS 功能** :
3636 - ** 运营商名称** : 覆盖设备上显示的运营商名称。
3737 - ** 运营商国家码 (Country ISO)** : 强制修改运营商国家码 (需 Android 14+)。
38+ - ** IMS User Agent** : 自定义 IMS User Agent 字符串。
3839 - ** VoLTE (高清语音通话)** : 开启 4G 高清语音通话。
3940 - ** VoWiFi (Wi-Fi 通话)** : 通过 Wi-Fi 网络拨打电话,并可选择仅 Wi-Fi 模式。
4041 - ** VT (视频通话)** : 开启基于 IMS 的视频通话。
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ val appVersionName: String = libs.versions.app.version.get()
2626
2727kotlin {
2828 compilerOptions {
29+ jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget .JVM_21 )
2930 optIn.add(" androidx.compose.material3.ExperimentalMaterial3Api" )
3031 optIn.add(" androidx.compose.material3.ExperimentalMaterial3ExpressiveApi" )
3132 }
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ enum class Feature(
2121 R .string.country_iso_desc,
2222 " " ,
2323 ),
24+ IMS_USER_AGENT (
25+ FeatureValueType .STRING ,
26+ R .string.ims_user_agent,
27+ R .string.ims_user_agent_desc,
28+ " " ,
29+ ),
2430 VOLTE (
2531 FeatureValueType .BOOLEAN ,
2632 R .string.volte,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class ImsModifier : Instrumentation() {
3131 fun buildBundle (
3232 carrierName : String? ,
3333 countryISO : String? ,
34+ imsUserAgent : String? ,
3435 enableVoLTE : Boolean ,
3536 enableVoWiFi : Boolean ,
3637 enableVT : Boolean ,
@@ -42,20 +43,27 @@ class ImsModifier : Instrumentation() {
4243 ): Bundle {
4344 val bundle = Bundle ()
4445 // 运营商名称
45- if (carrierName?.isNotBlank() ? : false ) {
46+ if (carrierName?.isNotBlank() == true ) {
4647 bundle.putBoolean(CarrierConfigManager .KEY_CARRIER_NAME_OVERRIDE_BOOL , true )
4748 bundle.putString(CarrierConfigManager .KEY_CARRIER_NAME_STRING , carrierName)
4849 bundle.putString(CarrierConfigManager .KEY_CARRIER_CONFIG_VERSION_STRING , " :3" )
4950 }
5051 // 运营商国家码
5152 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .UPSIDE_DOWN_CAKE ) {
52- if (countryISO?.isNotBlank() ? : false ) {
53+ if (countryISO?.isNotBlank() == true ) {
5354 bundle.putString(
5455 CarrierConfigManager .KEY_SIM_COUNTRY_ISO_OVERRIDE_STRING ,
5556 countryISO
5657 )
5758 }
5859 }
60+ // IMS User Agent
61+ if (imsUserAgent?.isNotBlank() == true ) {
62+ bundle.putString(
63+ CarrierConfigManager .Ims .KEY_IMS_USER_AGENT_STRING ,
64+ imsUserAgent
65+ )
66+ }
5967
6068 // VoLTE 配置
6169 if (enableVoLTE) {
Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ class MainViewModel(private val application: Application) : AndroidViewModel(app
148148 if (selectedSim.subId == - 1 ) null else map[Feature .CARRIER_NAME ]?.data as String?
149149 val countryISO =
150150 if (selectedSim.subId == - 1 ) null else map[Feature .COUNTRY_ISO ]?.data as String?
151+ val imsUserAgent =
152+ if (selectedSim.subId == - 1 ) null else map[Feature .IMS_USER_AGENT ]?.data as String?
151153 val enableVoLTE = (map[Feature .VOLTE ]?.data ? : true ) as Boolean
152154 val enableVoWiFi = (map[Feature .VOWIFI ]?.data ? : true ) as Boolean
153155 val enableVT = (map[Feature .VT ]?.data ? : true ) as Boolean
@@ -160,6 +162,7 @@ class MainViewModel(private val application: Application) : AndroidViewModel(app
160162 val bundle = ImsModifier .buildBundle(
161163 carrierName,
162164 countryISO,
165+ imsUserAgent,
163166 enableVoLTE,
164167 enableVoWiFi,
165168 enableVT,
Original file line number Diff line number Diff line change 2828 <string name =" carrier_name_desc" >自定义运营商显示的名称,为空则不修改</string >
2929 <string name =" country_iso" >运营商国家码</string >
3030 <string name =" country_iso_desc" >自定义运营商国家码,为空则不修改</string >
31+ <string name =" ims_user_agent" >IMS User Agent</string >
32+ <string name =" ims_user_agent_desc" >自定义 IMS User Agent 字符串,为空则不修改</string >
3133 <string name =" volte" >VoLTE(4G 语音)</string >
3234 <string name =" volte_desc" >启用 4G 高清语音通话</string >
3335 <string name =" vowifi" >VoWiFi(WiFi 通话)</string >
Original file line number Diff line number Diff line change 2828 <string name =" carrier_name_desc" >Customize carrier name</string >
2929 <string name =" country_iso" >Country ISO</string >
3030 <string name =" country_iso_desc" >Customize country ISO code</string >
31+ <string name =" ims_user_agent" >IMS User Agent</string >
32+ <string name =" ims_user_agent_desc" >Customize IMS User Agent string</string >
3133 <string name =" volte" >VoLTE (4G Voice)</string >
3234 <string name =" volte_desc" >Enable 4G HD voice calls</string >
3335 <string name =" vowifi" >VoWiFi (WiFi Calling)</string >
You can’t perform that action at this time.
0 commit comments