Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MobileManager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wang Xu
MobileManager
Commits
49e43af6
Commit
49e43af6
authored
Mar 23, 2020
by
Baoxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复闪屏问题
parent
e63f89cc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
144 additions
and
94 deletions
+144
-94
AndroidManifest.xml
Launcher3/AndroidManifest.xml
+40
-43
colors.xml
Launcher3/res/values/colors.xml
+1
-0
styles.xml
Launcher3/res/values/styles.xml
+29
-0
Launcher.java
Launcher3/src/com/android/launcher3/Launcher.java
+8
-1
PwdPinSetPwdActivity.java
.../android/launcher3/function/pwd/PwdPinSetPwdActivity.java
+2
-5
BlankActivity.java
...er3/src/com/android/launcher3/settings/BlankActivity.java
+14
-0
SwitchOutMdm.kt
...ain/java/com/secspace/lib/common/function/SwitchOutMdm.kt
+49
-44
privacypolicydialog_layout.xml
...common/src/main/res/layout/privacypolicydialog_layout.xml
+1
-1
No files found.
Launcher3/AndroidManifest.xml
View file @
49e43af6
...
...
@@ -46,19 +46,19 @@
android:largeHeap=
"@bool/config_largeHeap"
android:restoreAnyVersion=
"true"
android:supportsRtl=
"true"
tools:replace=
"android:label"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
tools:replace=
"android:label"
>
<activity
android:name=
".function.shortcut.ExitShortcut"
android:excludeFromRecents=
"true"
android:icon=
"@drawable/launcher_out"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
android:name=
".function.shortcut.SettingShortcut"
android:excludeFromRecents=
"true"
android:icon=
"@mipmap/ic_settings"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<receiver
android:name=
".settings.BootReceiver"
android:enabled=
"true"
...
...
@@ -68,48 +68,47 @@
android:enabled=
"true"
android:exported=
"true"
/>
<activity
android:name=
".function.setting.ChangePwdActivity"
<activity
android:name=
".function.setting.ChangePwdActivity"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
android:theme=
"@style/SettingTheme"
/>
<service
android:name=
".settings.wifi.WifiScanService"
android:enabled=
"true"
android:exported=
"true"
/>
<activity
android:name=
".settings.wifi.WifiWhiteListActivity"
android:excludeFromRecents=
"true"
/>
<activity
android:name=
".function.setting.SettingAdminActivity"
android:theme=
"@style/SettingTheme"
android:excludeFromRecents=
"true"
/>
<activity
android:name=
".function.setting.SettingActivity"
<activity
android:name=
".settings.wifi.WifiWhiteListActivity"
android:excludeFromRecents=
"true"
/>
<activity
android:name=
".function.setting.SettingAdminActivity"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.SettingAbout
Activity"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.Setting
Activity"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.PrivacyPolicy
Activity"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.SettingAbout
Activity"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.SettingPwd
Activity"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.PrivacyPolicy
Activity"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.SettingBuy
Activity"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.SettingPwd
Activity"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
>
</activity>
<activity
android:name=
".ManagerAuthActivity"
android:theme=
"@style/SettingTheme"
/>
<activity
android:name=
".function.setting.SettingBuyActivity"
android:excludeFromRecents=
"true"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/SettingTheme"
></activity>
<activity
android:name=
".ManagerAuthActivity"
android:excludeFromRecents=
"true"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
android:name=
".function.setting.AppChooseActivity"
android:excludeFromRecents=
"true"
...
...
@@ -122,6 +121,7 @@
-->
<activity
android:name=
".Launcher"
android:autoRemoveFromRecents=
"true"
android:clearTaskOnLaunch=
"true"
android:configChanges=
"keyboard|keyboardHidden|navigation"
android:enabled=
"true"
...
...
@@ -131,9 +131,8 @@
android:screenOrientation=
"sensor"
android:stateNotNeeded=
"true"
android:taskAffinity=
""
android:autoRemoveFromRecents=
"true"
android:windowSoftInputMode=
"adjustPan|stateUnchanged"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
>
android:theme=
"@style/Launcher3Theme"
android:windowSoftInputMode=
"adjustPan|stateUnchanged"
>
<intent-filter>
<!-- <action android:name="android.intent.action.MAIN" /> -->
...
...
@@ -145,19 +144,17 @@
<action
android:name=
"android.start_launcher"
/>
</intent-filter>
</activity>
<!-- The settings activity. When extending keep the intent filter present -->
<activity
android:name=
".function.pwd.PwdPinSetPwdActivity"
android:excludeFromRecents=
"true"
android:autoRemoveFromRecents=
"true"
android:excludeFromRecents=
"true"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
android:name=
".SettingsActivity"
android:autoRemoveFromRecents=
"true"
android:label=
"@string/settings_button_text"
android:excludeFromRecents=
"true"
android:label=
"@string/settings_button_text"
android:theme=
"@android:style/Theme.DeviceDefault.Settings"
>
<intent-filter>
<action
android:name=
"android.intent.action.APPLICATION_PREFERENCES"
/>
...
...
@@ -179,10 +176,10 @@
<activity
android:name=
".settings.BlankActivity"
android:launchMode=
"singleInstance"
android:autoRemoveFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/TransparentTheme"
>
android:launchMode=
"singleInstance"
android:theme=
"@style/NoTitleTranslucentTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
Launcher3/res/values/colors.xml
View file @
49e43af6
...
...
@@ -55,4 +55,5 @@
<color
name=
"colorLine"
>
#dedede
</color>
<color
name=
"colorBackground"
>
#f6f6f6
</color>
<color
name=
"revBackground"
>
#2d80df
</color>
<color
name=
"translate"
>
#00000000
</color>
</resources>
Launcher3/res/values/styles.xml
View file @
49e43af6
...
...
@@ -169,4 +169,33 @@
<!-- 设置项右侧的开关 -->
<item
name=
"qmui_common_list_item_switch"
>
@drawable/switch_button
</item>
</style>
<style
name=
"Launcher3Theme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<!-- <item name="android:windowBackground">@android:color/transparent</item>-->
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowAnimationStyle"
>
@style/Animation
</item>
</style>
<style
name=
"Animation"
>
<item
name=
"android:activityOpenEnterAnimation"
>
@null
</item>
<item
name=
"android:activityOpenExitAnimation"
>
@null
</item>
<item
name=
"android:activityCloseEnterAnimation"
>
@null
</item>
<item
name=
"android:activityCloseExitAnimation"
>
@null
</item>
<item
name=
"android:taskOpenEnterAnimation"
>
@null
</item>
<item
name=
"android:taskOpenExitAnimation"
>
@null
</item>
<item
name=
"android:taskCloseEnterAnimation"
>
@null
</item>
<item
name=
"android:taskCloseExitAnimation"
>
@null
</item>
<item
name=
"android:taskToFrontEnterAnimation"
>
@null
</item>
<item
name=
"android:taskToFrontExitAnimation"
>
@null
</item>
<item
name=
"android:taskToBackEnterAnimation"
>
@null
</item>
<item
name=
"android:taskToBackExitAnimation"
>
@null
</item>
</style>
<style
name=
"NoTitleTranslucentTheme"
parent=
"AppTheme"
>
<item
name=
"android:windowAnimationStyle"
>
@style/Animation
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"android:windowBackground"
>
@color/translate
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
</style>
</resources>
Launcher3/src/com/android/launcher3/Launcher.java
View file @
49e43af6
...
...
@@ -160,6 +160,7 @@ import com.secspace.lib.common.event.RefreshWorkSpaceEvent;
import
com.secspace.lib.common.function.ActivationHelper
;
import
com.secspace.lib.common.function.DialogManager
;
import
com.secspace.lib.common.function.WorkManager
;
import
com.secspace.lib.common.update.CheckUpdateCore
;
import
com.secspace.lib.common.utils.ActivityHelper
;
import
com.secspace.lib.common.utils.DeviceUtil
;
import
com.secspace.lib.common.utils.DpmHelper
;
...
...
@@ -425,7 +426,8 @@ public class Launcher extends BaseActivity
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
EventBus
.
getDefault
().
register
(
this
);
}
ActivationHelper
.
INSTANCE
.
init
(
this
);
CheckUpdateCore
.
get
().
init
(
this
);
if
(
Prefs
.
isFirstInit
(
this
))
{
List
<
String
>
pkgs
=
new
ArrayList
<>();
pkgs
.
add
(
getPackageName
());
...
...
@@ -4562,4 +4564,9 @@ public class Launcher extends BaseActivity
}
}
}
@Override
public
void
overridePendingTransition
(
int
enterAnim
,
int
exitAnim
)
{
super
.
overridePendingTransition
(
0
,
0
);
}
}
Launcher3/src/com/android/launcher3/function/pwd/PwdPinSetPwdActivity.java
View file @
49e43af6
...
...
@@ -17,16 +17,14 @@ import android.widget.Button;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.android.launcher3.BaseActivity
;
import
com.android.launcher3.Launcher
;
import
com.android.launcher3.R
;
import
com.android.launcher3.settings.BlankActivity
;
import
com.secspace.lib.common.utils.Prefs
;
import
com.secspace.lib.common.utils.ToastUtil
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.regex.Pattern
;
...
...
@@ -74,9 +72,8 @@ public class PwdPinSetPwdActivity extends BaseActivity implements View.OnClickLi
private
void
startLauncher
()
{
Intent
intent
=
new
Intent
();
intent
.
setAction
(
"android.start_launcher"
);
intent
.
setPackage
(
this
.
getPackageName
());
intent
.
setClass
(
this
,
Launcher
.
class
);
intent
.
setClass
(
this
,
BlankActivity
.
class
);
startActivity
(
intent
);
finish
();
}
...
...
Launcher3/src/com/android/launcher3/settings/BlankActivity.java
View file @
49e43af6
package
com
.
android
.
launcher3
.
settings
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.text.TextUtils
;
import
android.view.WindowManager
;
import
com.android.launcher3.function.pwd.PwdPinSetPwdActivity
;
import
com.secspace.lib.common.base.BaseActivity
;
...
...
@@ -22,6 +25,12 @@ public class BlankActivity extends BaseActivity {
}
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
if
(!
Prefs
.
isPrivacyPolicyAccept
(
this
))
{
...
...
@@ -41,4 +50,9 @@ public class BlankActivity extends BaseActivity {
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
}
@Override
public
void
overridePendingTransition
(
int
enterAnim
,
int
exitAnim
)
{
super
.
overridePendingTransition
(
0
,
0
);
}
}
lib_common/src/main/java/com/secspace/lib/common/function/SwitchOutMdm.kt
View file @
49e43af6
...
...
@@ -25,63 +25,69 @@ object SwitchOutMdm: ISwitch() {
private
var
context
:
Context
?
=
null
private
val
TAG
=
"SwitchOutMdm"
fun
exit
(
context
:
Context
)
{
}
private
fun
removeDisallowedRunningApp
(){
val
mdmFactoryManager
=
MdmFactoryManager
.
getInstance
()
val
list
=
mdmFactoryManager
.
deviceApplicationManager
.
disallowedRunningApp
mdmFactoryManager
.
deviceApplicationManager
.
removeDisallowedRunningApp
(
list
)
Log
.
e
(
TAG
,
"remove:${list}"
)
mdmFactoryManager
.
deviceApplicationManager
?.
let
{
val
list
=
it
.
disallowedRunningApp
it
.
removeDisallowedRunningApp
(
list
)
Log
.
e
(
TAG
,
"remove:${list}"
)
}
}
private
fun
recover
()
{
private
fun
recover
(
context
:
Context
)
{
val
mdmFactoryManager
=
MdmFactoryManager
.
getInstance
()
Prefs
.
setAutoStartSelf
(
context
,
false
)
mdmFactoryManager
.
deviceApplicationManager
.
setApplicationEnabledSetting
(
"com.huawei.powergenie"
,
PackageManager
.
COMPONENT_ENABLED_STATE_ENABLED
,
1
)
mdmFactoryManager
.
deviceRestrictionManager
.
isAdbDisabled
=
false
mdmFactoryManager
.
deviceRestrictionManager
.
isUSBOtgDisabled
=
false
mdmFactoryManager
.
deviceRestrictionManager
.
isUSBDataDisabled
=
false
mdmFactoryManager
.
deviceRestrictionManager
.
isExternalStorageDisabled
=
false
mdmFactoryManager
.
deviceRestrictionManager
.
isStatusBarExpandPanelDisabled
=
false
mdmFactoryManager
.
deviceApplicationManager
?.
let
{
it
.
removePersistentApp
(
getPersistentList
(
context
))
it
.
setApplicationEnabledSetting
(
"com.huawei.powergenie"
,
PackageManager
.
COMPONENT_ENABLED_STATE_ENABLED
,
1
)
}
mdmFactoryManager
.
deviceRestrictionManager
?.
let
{
it
.
isAdbDisabled
=
false
it
.
isUSBOtgDisabled
=
false
it
.
isUSBDataDisabled
=
false
it
.
isExternalStorageDisabled
=
false
it
.
isStatusBarExpandPanelDisabled
=
false
}
mdmFactoryManager
.
deviceSettingsManager
?.
let
{
it
.
isRestoreFactoryDisabled
=
false
it
.
isSystemUpdateDisabled
=
false
}
mdmFactoryManager
.
deviceSettingsManager
.
isRestoreFactoryDisabled
=
false
mdmFactoryManager
.
deviceSettingsManager
.
isSystemUpdateDisabled
=
false
DisableCompat
.
enableComponent
(
context
,
COMPONENT_UPDATE_SYSTEM
)
DisableCompat
.
enableComponent
(
context
,
EnterprisePrivacySettingsActivity
)
}
private
fun
clearProcesses
()
{
val
dam
=
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
//clear task
val
runningTasks
=
dam
.
getRunningTasks
(
1000
)
if
(
runningTasks
!=
null
)
{
for
(
task
in
runningTasks
)
{
val
pkg
=
task
.
baseActivity
.
packageName
if
(
pkg
==
context
?.
packageName
||
pkg
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
pkg
==
"com.android.systemui"
)
{
continue
dam
?.
let
{
//clear task
val
runningTasks
=
it
.
getRunningTasks
(
1000
)
if
(
runningTasks
!=
null
)
{
for
(
task
in
runningTasks
)
{
val
pkg
=
task
.
baseActivity
.
packageName
if
(
pkg
==
context
?.
packageName
||
pkg
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
pkg
==
"com.android.systemui"
)
{
continue
}
it
.
removeTask
(
task
.
id
)
Log
.
d
(
TAG
,
"remove task "
+
task
.
baseActivity
.
packageName
)
}
dam
.
removeTask
(
task
.
id
)
Log
.
d
(
TAG
,
"remove task "
+
task
.
baseActivity
.
packageName
)
}
}
//clear processes
val
runningAppProcesses
=
dam
.
runningAppProcesses
val
packages
=
getAllPackages
(
PackageManager
.
MATCH_UNINSTALLED_PACKAGES
)
if
(
runningAppProcesses
!=
null
)
{
for
(
processInfo
in
runningAppProcesses
)
{
val
processName
=
processInfo
.
processName
if
(!
packages
.
contains
(
processName
))
{
continue
}
if
(
processName
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
context
?.
packageName
==
processName
||
processName
==
"com.huawei.powergenie"
)
{
continue
//clear processes
val
runningAppProcesses
=
it
.
runningAppProcesses
val
packages
=
getAllPackages
(
PackageManager
.
MATCH_UNINSTALLED_PACKAGES
)
if
(
runningAppProcesses
!=
null
)
{
for
(
processInfo
in
runningAppProcesses
)
{
val
processName
=
processInfo
.
processName
if
(!
packages
.
contains
(
processName
))
{
continue
}
if
(
processName
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
context
?.
packageName
==
processName
||
processName
==
"com.huawei.powergenie"
)
{
continue
}
it
.
killApplicationProcess
(
processName
)
it
.
forceStopPackage
(
processName
)
Log
.
d
(
TAG
,
"kill $processName"
)
}
dam
.
killApplicationProcess
(
processName
)
dam
.
forceStopPackage
(
processName
)
Log
.
d
(
TAG
,
"kill $processName"
)
}
}
}
...
...
@@ -111,14 +117,13 @@ object SwitchOutMdm: ISwitch() {
if
(
context
?.
packageName
?.
let
{
name
.
contains
(
it
)
}
!!
||
name
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
)
{
continue
}
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
.
forceStopPackage
(
name
)
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
?
.
forceStopPackage
(
name
)
}
}
override
suspend
fun
init
(
context
:
Context
)
{
this
.
context
=
context
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
.
removePersistentApp
(
getPersistentList
(
context
))
recover
()
recover
(
context
)
MdmUtils
.
clearDefaultLauncher
(
context
)
removeDisallowedRunningApp
()
clearProcesses
()
...
...
lib_common/src/main/res/layout/privacypolicydialog_layout.xml
View file @
49e43af6
...
...
@@ -7,7 +7,7 @@
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
48dp
"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"10dp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment