Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
fix #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyl18 committed Apr 30, 2018
1 parent 7415c69 commit fab2119
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
25 changes: 13 additions & 12 deletions app/src/main/java/com/cyl18/opapplocktweaker/AppLockHooker.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,27 +251,28 @@ 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() {
Intent intent = new Intent();
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"));
Expand Down

0 comments on commit fab2119

Please sign in to comment.