You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-source/src/en/config/api-exception.md
+37-12Lines changed: 37 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1226,13 +1226,13 @@ This situation basically does not exist, because `appContext` is assigned in `on
1226
1226
1227
1227
::: danger IllegalStateException
1228
1228
1229
-
YukiHookModulePrefs not allowed in Custom Hook API
1229
+
YukiHookPrefsBridge not allowed in Custom Hook API
1230
1230
1231
1231
:::
1232
1232
1233
1233
**Abnormal**
1234
1234
1235
-
`YukiHookModulePrefs` is used in Hook's own app (not Xposed Module).
1235
+
`YukiHookPrefsBridge` is used in Hook's own app (not Xposed Module).
1236
1236
1237
1237
> The following example
1238
1238
@@ -1251,7 +1251,7 @@ class MyApplication : Application() {
1251
1251
1252
1252
**Solution**
1253
1253
1254
-
You can only use `YukiHookModulePrefs` when [Use as Xposed Module Configs](../config/xposed-using), please use the native `Sp` storage in the Hook's own app.
1254
+
You can only use `YukiHookPrefsBridge` when [Use as Xposed Module Configs](../config/xposed-using), please use the native `Sp` storage in the Hook's own app.
1255
1255
1256
1256
###### exception
1257
1257
@@ -1263,7 +1263,7 @@ Cannot load the XSharedPreferences, maybe is your Hook Framework not support it
1263
1263
1264
1264
**Abnormal**
1265
1265
1266
-
Using `YukiHookModulePrefs` in (Xposed) Host environment but unable to get `XSharedPreferences` object.
1266
+
Using `YukiHookPrefsBridge` in (Xposed) Host environment but unable to get `XSharedPreferences` object.
1267
1267
1268
1268
> The following example
1269
1269
@@ -1323,7 +1323,7 @@ Xposed modulePackageName load failed, please reset and rebuild it
1323
1323
1324
1324
**Abnormal**
1325
1325
1326
-
When using `YukiHookModulePrefs` or `YukiHookDataChannel` in the Hook process, the `modulePackageName` at load time cannot be read, resulting in the package name of the own Module App cannot be determined.
1326
+
When using `YYukiHookPrefsBridge` or `YukiHookDataChannel` in the Hook process, the `modulePackageName` at load time cannot be read, resulting in the package name of the own Module App cannot be determined.
1327
1327
1328
1328
**Solution**
1329
1329
@@ -1333,13 +1333,13 @@ Please read the help document [here](../config/xposed-using#modulepackagename-pa
1333
1333
1334
1334
::: danger IllegalStateException
1335
1335
1336
-
YukiHookModulePrefs missing Context instance
1336
+
YukiHookPrefsBridge missing Context instance
1337
1337
1338
1338
:::
1339
1339
1340
1340
**Abnormal**
1341
1341
1342
-
`YukiHookModulePrefs` is used in the Module App to store data but no `Context` instance is passed in.
1342
+
`YukiHookPrefsBridge` is used in the Module App to store data but no `Context` instance is passed in.
1343
1343
1344
1344
> The following example
1345
1345
@@ -1350,14 +1350,14 @@ class MainActivity : AppCompatActivity() {
1350
1350
super.onCreate(savedInstanceState)
1351
1351
// ❗ Wrong usage
1352
1352
// Constructor has been set to private in API 1.0.88 and later
1353
-
YukiHookModulePrefs().getBoolean("test_data")
1353
+
YukiHookPrefsBridge().getBoolean("test_data")
1354
1354
}
1355
1355
}
1356
1356
```
1357
1357
1358
1358
**Solution**
1359
1359
1360
-
It is recommended to use the `modulePrefs` method to load `YukiHookModulePrefs` in `Activity`.
1360
+
It is recommended to use the `prefs(...)` method to load `YukiHookPrefsBridge` in `Activity`.
1361
1361
1362
1362
> The following example
1363
1363
@@ -1367,7 +1367,7 @@ class MainActivity : AppCompatActivity() {
1367
1367
overridefunonCreate(savedInstanceState:Bundle?) {
1368
1368
super.onCreate(savedInstanceState)
1369
1369
// ✅ Correct usage
1370
-
modulePrefs.getBoolean("test_data")
1370
+
prefs().getBoolean("test_data")
1371
1371
}
1372
1372
}
1373
1373
```
@@ -1376,17 +1376,42 @@ class MainActivity : AppCompatActivity() {
1376
1376
1377
1377
::: danger IllegalStateException
1378
1378
1379
+
The Host App's Context has not yet initialized successfully, the native function cannot be used at this time
1380
+
1381
+
:::
1382
+
1383
+
**Abnormal**
1384
+
1385
+
In the (Xposed) Host environment `PackageParam`, `YukiHookPrefsBridge` is used and the `native` method is called, but the lifecycle of the Host App is not initialized at this time.
1386
+
1387
+
> The following example
1388
+
1389
+
```kotlin
1390
+
encase {
1391
+
// This method was called
1392
+
prefs.native()
1393
+
}
1394
+
```
1395
+
1396
+
**Solution**
1397
+
1398
+
The `native` method requires an existing `Context` object to store data in, and you can use this method in listening to the Host App lifecycle state.
1399
+
1400
+
###### exception
1401
+
1402
+
::: danger IllegalStateException
1403
+
1379
1404
Key-Value type **TYPE** is not allowed
1380
1405
1381
1406
:::
1382
1407
1383
1408
**Abnormal**
1384
1409
1385
-
An unsupported storage type was passed in when using the `get` or `put` methods of `YukiHookModulePrefs` or the `wait` or `put` methods of `YukiHookDataChannel`.
1410
+
An unsupported storage type was passed in when using the `get` or `put` methods of `YukiHookPrefsBridge` or the `wait` or `put` methods of `YukiHookDataChannel`.
1386
1411
1387
1412
**Solution**
1388
1413
1389
-
The supported types of `YukiHookModulePrefs` are only `String`, `Set<String>`, `Int`, `Float`, `Long`, `Boolean`, please pass in the supported types.
1414
+
The supported types of `YukiHookPrefsBridge` are only `String`, `Set<String>`, `Int`, `Float`, `Long`, `Boolean`, please pass in the supported types.
1390
1415
1391
1416
The supported types of `YukiHookDataChannel` are the types restricted by `Intent.putExtra`, please pass in the supported types.
0 commit comments