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
* The SpaceCore SDK is a free product that is **NOT** open-source, and you are free to use it without notifying the author. It can also be used for commercial purposes. [SpaceCore SDK Download](https://github.com/FSpaceCore/SpaceCore/releases)
* The SpaceCore Demo is intended to demonstrate the usage of the SpaceCore SDK, which can be found in the code within this repository. [SpaceCore Demo Release Download](https://github.com/FSpaceCore/SpaceCore/releases)
@@ -28,14 +30,18 @@ Official website: [https://spacecore.dev](https://spacecore.dev)
28
30
| Android version |`6.0 ~ 14.0 and future versions`|
29
31
30
32
31
-
## Usages
33
+
## SDK Integration
32
34
33
35
### 0. Dependency
36
+
The version is based on the main project version, if the main project does not add dependencies, you need to add the following dependencies
34
37
35
38
```
36
39
implementation "com.tencent:mmkv-static:1.2.10"
37
40
implementation "com.google.code.gson:gson:2.9.1"
41
+
```
38
42
43
+
If the main project does not use kotlin, you need to additionally introduce
@@ -45,65 +51,189 @@ Put this initialization code within "Application#attachBaseContext".
45
51
46
52
`FCore.get().init(this);`
47
53
54
+
Please note that after calling `init()`, if the `FCore.get().isClient()` condition is true, please try not to do other initialization in the Application. If you encounter any problems, please contact technical support.
| isInstalled | Check if the App is installed in the sandbox |
68
-
| installPackageAsUser | Clone App into sandbox according to package name |
69
-
| installPackageAsUser | Clone App into sandbox via apk file |
70
-
| uninstallPackage | Uninstall an App installed in the sandbox globally |
71
-
| uninstallPackageAsUser | Uninstall an App installed in the sandbox by user |
72
-
| getInstalledApplications | Get all applications installed in the sandbox |
73
-
| getApplicationInfo | Get application info of an App in the sandbox |
74
-
| getPackageInfo | Get package info of an application in the sandbox |
75
-
| getLaunchIntentForPackage | Get LauncherIntent of an App |
76
-
| launchApk | Launch App in sandbox |
77
-
| launchIntent | Launch App via Intent |
78
-
| isRunning | Check if an App is running |
79
-
| clearPackage | Clear App data |
80
-
| stopPackage | Stop an app from running |
81
-
| stopAllPackages | Stop all running applications |
82
-
| setApplicationCallback ||
83
-
| disableFakeLocation ||
84
-
| enableFakeLocation ||
85
-
| setLocation ||
86
-
| getLocation ||
87
-
| setGlobalLocation ||
88
-
| getGlobalLocation ||
89
-
| getUsers ||
90
-
| createUser ||
91
-
| deleteUser ||
92
-
| exportAppData ||
93
-
| importAppData ||
94
-
| setPreloadProcessCount ||
95
-
| setHideRoot ||
96
-
| setHideSim ||
97
-
| setHideVPN ||
98
-
| setVisitExternalApp ||
99
-
| setDisableKill ||
100
-
| setDisableNetwork ||
101
-
| setHidePath ||
102
-
| getSpaceLanguage ||
103
-
| setSpaceLanguage ||
104
-
| getSpaceRegion ||
105
-
| setSpaceRegion ||
106
-
| getSpaceTimeZone ||
107
-
| setSpaceTimeZone ||
108
-
| getSpaceTaskDescriptionPrefix ||
79
+
**Method 1: App Clone**
80
+
81
+
This method relies on the application that is already installed on the system. If the application is uninstalled from the system, the cloned app will also disappear.
isInstalled | Check if the app is installed in the sandbox |
107
+
installPackageAsUser | Clone App into sandbox according to package name|
108
+
installPackageAsUser | Clone App into sandbox via apk file|
109
+
uninstallPackage | Uninstall an App installed in the sandbox globally |
110
+
uninstallPackageAsUser | Uninstall an App installed in the sandbox by user|
111
+
getInstalledApplications | Get all applications installed in the sandbox|
112
+
getApplicationInfo | Get application info of an App in the sandbox|
113
+
getPackageInfo | Get package info of an application in the sandbox|
114
+
getLaunchIntentForPackage | Get LauncherIntent of an App |
115
+
launchApk | Launch App in sandbox |
116
+
launchIntent | Launch App via Intent |
117
+
isRunning | Check if an App is running |
118
+
clearPackage | Clear App data |
119
+
stopPackage | Stop an app from running|
120
+
stopAllPackages | Stop all running applications|
121
+
setAutoForeground | Set auto start/close notification bar to automatically close notification bar when no process is active
122
+
123
+
### Internal Process:
124
+
125
+
METHOD | DESCRIPTION
126
+
---|---
127
+
findProcessRecord | Finding process information
128
+
addProcessMonitor | Adding sandboxed internal process listeners
129
+
removeProcessMonitor | Removing sandboxed internal process listeners
130
+
131
+
### SandBox User:
132
+
133
+
METHOD | DESCRIPTION
134
+
---|---
135
+
getUsers | Getting users in the sandbox
136
+
createUser | Create users in the sandbox
137
+
deleteUser | Delete users in the sandbox (all application information will be deleted)
138
+
139
+
### APP Data:
140
+
141
+
METHOD | DESCRIPTION
142
+
---|---
143
+
exportAppData | Export all data of a certain application
144
+
importAppData | Import all data of a certain application
145
+
146
+
### APP Rules:
147
+
148
+
METHOD | DESCRIPTION
149
+
---|---
150
+
addRule| Add a rule
151
+
setAllowSystemInteraction | Whether to allow interaction with system applications when the sandbox cannot find broadcasts, activities, etc
152
+
setHideRoot | Hide root status
153
+
setHideSim | Hide SIM card status
154
+
setHideVPN | Hide VPN status
155
+
setVisitExternalApp | Allow sandboxed applications to perceive external applications
156
+
setDisableKill | Prevent application crashes
157
+
setDisableNetwork | Disable application network
158
+
setHidePath | Hide multi-open path and storage path
159
+
getSpaceLanguage | Get the simulated language of a certain space
160
+
setSpaceLanguage | Set the simulated language of a certain space (e.g. Chinese: zh)
161
+
getSpaceRegion | Get the simulated region of a certain space
162
+
setSpaceRegion | Set the simulated region of a certain space (e.g. China: CN)
163
+
getSpaceTimeZone | Get the simulated time zone of a certain space
164
+
setSpaceTimeZone | Set the simulated time zone of a certain space (e.g. Shanghai: Asia/Shanghai)
165
+
166
+
### App Permissions:
167
+
168
+
METHOD | DESCRIPTION
169
+
---|---
170
+
getPermission | Get app permission rules
171
+
updatePermission | Update app permission rules
172
+
revokePermission | Remove app permission rules (the app will follow the actual permissions of the host APP)
173
+
174
+
175
+
### SandBox Configuration:
176
+
177
+
METHOD | DESCRIPTION
178
+
---|---
179
+
enableOptRule | Whether to enable rule-based blocking of push notifications, third-party SDKs, hot updates, ads, etc. to optimize app running speed. If an application exception occurs, please turn off
180
+
setAutoPreloadApplication | Intelligent preloading of applications, where the kernel automatically loads applications based on usage to accelerate startup speed. Default: on
181
+
preloadApplicationCount | Default number of preloaded applications: 2
182
+
setPreloadProcessCount | Set the number of preloading processes to speed up application startup. Default: 3
183
+
setBackToHome | Whether to return to the host app when the sandbox app exits
184
+
setSpaceTaskDescriptionPrefix | Set the application prefix in the recent tasks list (default: F{user ID})
185
+
setEnableLauncherView | Whether to enable splash screen
186
+
restartCoreSystem | Restart the kernel (all applications will be killed)
187
+
188
+
189
+
## Rule Configuration System
190
+
When dealing with various applications, SpaceCore supports configuring different runtime parameters and virtual machine parameters to achieve adaptation. SpaceCore supports a powerful rule configuration system that can customize exclusive rules for each application. The rule library can be dynamically updated through cloud configuration. The supported rule functions are gradually under development.
0 commit comments