package com.cat9tac.androidsafe.receiver;

import android.app.admin.DeviceAdminReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import static android.widget.Toast.LENGTH_SHORT;

/**
 * Created by cat9tac on 2016/3/14.
 */
public class MyDeviceAdminReceiver extends DeviceAdminReceiver {
    @Override
    public void onEnabled(Context context, Intent intent) {
        super.onEnabled(context, intent);
    }

    @Override
    public void onDisabled(Context context, Intent intent) {
        Log.i("DDD","Myadmin disable");
    }
}

@@ -164,45 +164,147 @@
 oid.
-util.Log;%0Aimport android.widget.Toast
+content.SharedPreferences;%0Aimport android.util.Log;%0Aimport android.widget.Toast;%0A%0Aimport com.cat9tac.androidsafe.util.SharePreferenceEditor
 ;%0A%0Ai
@@ -461,16 +461,977 @@
 eiver %7B%0A
+    private static int failed_count=0;%0A    private static  final String FAILED_COUNT=%22FAILED_COUNT%22;%0A    //private SharePreferenceEditor sharePreferenceEditor;%0A    private static SharedPreferences sharedPreferences;%0A    private static SharedPreferences.Editor editor;%0A%0A%0A    @Override%0A    public void onPasswordFailed(Context context, Intent intent) %7B%0A        super.onPasswordFailed(context, intent);%0A        //int c=sharePreferenceEditor.getSharedPreferences().getInt(FAILED_COUNT,2);%0A        sharedPreferences=context.getSharedPreferences(%22state.activate%22,Context.MODE_PRIVATE);%0A        int c=sharedPreferences.getInt(FAILED_COUNT,2);%0A        failed_count++;%0A        if(failed_count%3E=c)%7B%0A            Log.i(%22DDD%22,%22onPasswordFailed%22+failed_count+%22time%22);%0A        %7D%0A%0A%0A%0A    %7D%0A%0A    @Override%0A    public void onPasswordSucceeded(Context context, Intent intent) %7B%0A        super.onPasswordSucceeded(context, intent);%0A        Log.i(%22DDD%22,%22onPasswordSucceeded%22);%0A    %7D%0A%0A
     @Ove
@@ -1534,24 +1534,62 @@
 t, intent);%0A
+        Log.i(%22DDD%22,%22Myadmin eable%22);%0A
     %7D%0A%0A    @

add onPasswirdFeiled