From fab2119f11aba5577be7ace60746cd3587904005 Mon Sep 17 00:00:00 2001 From: Cyl18 Date: Mon, 30 Apr 2018 10:07:11 +0800 Subject: [PATCH] fix #7 --- app/build.gradle | 4 +-- .../cyl18/opapplocktweaker/AppLockHooker.java | 25 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b94d29b..79983d1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "com.cyl18.opapplocktweaker" minSdkVersion 24 targetSdkVersion 26 - versionCode 14 - versionName "1.7.3" + versionCode 15 + versionName "1.7.4" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/cyl18/opapplocktweaker/AppLockHooker.java b/app/src/main/java/com/cyl18/opapplocktweaker/AppLockHooker.java index 08f010f..d02e957 100644 --- a/app/src/main/java/com/cyl18/opapplocktweaker/AppLockHooker.java +++ b/app/src/main/java/com/cyl18/opapplocktweaker/AppLockHooker.java @@ -251,8 +251,12 @@ private SharedPreferences getPreferences() { } private void hookFaceUnlockStop(boolean force) { - FaceUnlockServiceConnector.getInstance().stopFaceUnlock(force); - currentApplockerActivity.unbindService(connection); + try { + FaceUnlockServiceConnector.getInstance().stopFaceUnlock(force); + currentApplockerActivity.unbindService(connection); + } catch (Exception e) { + + } } private void hookFaceUnlockStart() { @@ -260,18 +264,15 @@ private void hookFaceUnlockStart() { intent.setClassName(Constants.FACEUNLOCK_PACKAGE, Constants.FACEUNLOCK_SERVICE); currentApplockerActivity.bindService(intent, connection, Context.BIND_AUTO_CREATE); currentTracker = new TrackerHandler(XposedHelpers.getObjectField(currentApplockerActivity, Constants.TRACKER)); - getLayout().setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - FaceUnlockServiceConnector.getInstance().stopFaceUnlock(false); - FaceUnlockServiceConnector.getInstance().startFaceUnlock(); - } - }); + //getLayout().setOnClickListener(new View.OnClickListener() { + // @Override + // public void onClick(View view) { + // FaceUnlockServiceConnector.getInstance().stopFaceUnlock(false); + // FaceUnlockServiceConnector.getInstance().startFaceUnlock(); + // } + //}); } - private View getLayout() { - return currentApplockerActivity.findViewById(Constants.ONEPLUS_APPLOCK_LAYOUT_ID); - } public String getUnlockPackageName() { return ((String) XposedHelpers.getObjectField(currentApplockerActivity, "mPackageName"));