├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── accountmanager.apk ├── app-release.apk ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── acffo │ │ └── xqx │ │ └── accountmanageacffo │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── acffo │ │ │ └── xqx │ │ │ └── accountmanageacffo │ │ │ ├── MainActivity.java │ │ │ ├── MainAdapter.java │ │ │ ├── XApplication.java │ │ │ ├── base │ │ │ ├── Constant.java │ │ │ ├── activity │ │ │ │ ├── AppManager.java │ │ │ │ ├── BaseActivity.java │ │ │ │ └── BaseFragmentActivity.java │ │ │ ├── database │ │ │ │ ├── Account.java │ │ │ │ ├── AccountDB.java │ │ │ │ ├── AdminDB.java │ │ │ │ ├── AdminEntity.java │ │ │ │ ├── DeepGuardDB.java │ │ │ │ └── DeepGuardEntity.java │ │ │ ├── dialog │ │ │ │ ├── AccountInfoDialog.java │ │ │ │ ├── DeepGuardValidationMainDialog.java │ │ │ │ ├── DeepGuardValidationSettingDialog.java │ │ │ │ ├── IsNoDialog.java │ │ │ │ ├── MessageDialogSingle.java │ │ │ │ └── ResetPsDialog.java │ │ │ ├── entity │ │ │ │ └── AppEntity.java │ │ │ ├── eventbus │ │ │ │ ├── AddAccount.java │ │ │ │ ├── AddFromAccountEventbus.java │ │ │ │ ├── SelectApp.java │ │ │ │ └── UpdataMainListEventbus.java │ │ │ ├── popupwindow │ │ │ │ └── SortPopupWindow.java │ │ │ └── utils │ │ │ │ ├── AlipayUtil.java │ │ │ │ ├── ApkTool.java │ │ │ │ ├── CryptUtil.java │ │ │ │ └── PinyinUtils.java │ │ │ └── ui │ │ │ ├── addAccount │ │ │ ├── AddAccountActivity.java │ │ │ ├── AppAdapter.java │ │ │ └── SelectAppActivity.java │ │ │ ├── addFromAccount │ │ │ ├── AddFromAccountActivity.java │ │ │ └── AddFromAccountAdapter.java │ │ │ ├── main │ │ │ ├── AboutActivity.java │ │ │ ├── DeepGuardActivity.java │ │ │ ├── EnterMainActivity.java │ │ │ ├── SetAdminPsActivity.java │ │ │ ├── SetDeepGuardPSActivity.java │ │ │ └── SettingActivity.java │ │ │ └── search │ │ │ └── SearchActivity.java │ └── res │ │ ├── drawable │ │ ├── bg_account1.xml │ │ ├── bg_app_noimg.xml │ │ ├── bg_btn_over.xml │ │ ├── bg_concern_white.xml │ │ ├── bg_edit.xml │ │ ├── bg_edit_admin.xml │ │ ├── bg_logout.xml │ │ ├── bg_popup_more.9.png │ │ ├── bg_search.xml │ │ ├── dialog_corner_bg.xml │ │ ├── dialog_corner_bg_bottom_green.xml │ │ ├── dialog_corner_bg_bottom_oranger.xml │ │ ├── edittextbg.xml │ │ ├── edittextline.xml │ │ ├── label_copy.xml │ │ └── label_edit.xml │ │ ├── layout │ │ ├── activity_about.xml │ │ ├── activity_add_account.xml │ │ ├── activity_add_from_account.xml │ │ ├── activity_deep_guard.xml │ │ ├── activity_enter_main_actiivty.xml │ │ ├── activity_main.xml │ │ ├── activity_search.xml │ │ ├── activity_select_app.xml │ │ ├── activity_set_admin_ps.xml │ │ ├── activity_set_deep_guard_ps.xml │ │ ├── activity_setting.xml │ │ ├── dialog_deepguardvalidation.xml │ │ ├── dialog_is_no.xml │ │ ├── dialog_message.xml │ │ ├── dialog_message_singleline.xml │ │ ├── dialog_resetps.xml │ │ ├── item_app.xml │ │ ├── item_from_account.xml │ │ ├── item_main_list.xml │ │ └── popup_sort.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── icon_about.png │ │ ├── icon_account.png │ │ ├── icon_add.png │ │ ├── icon_app.png │ │ ├── icon_back.png │ │ ├── icon_back_white.png │ │ ├── icon_deep_ps.png │ │ ├── icon_delete.png │ │ ├── icon_explain.png │ │ ├── icon_lock.png │ │ ├── icon_menu.png │ │ ├── icon_mlock.png │ │ ├── icon_money.png │ │ ├── icon_p_cancel.png │ │ ├── icon_password.png │ │ ├── icon_search.png │ │ ├── icon_select.png │ │ ├── icon_selected.png │ │ ├── icon_setting.png │ │ ├── icon_setting_explain.png │ │ └── icon_unselected.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── acffo │ └── xqx │ └── accountmanageacffo │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screenshots ├── a1.png ├── aa.png ├── b1.png ├── bb.png ├── c1.png ├── cc.png ├── d1.png └── dd.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 账号密橱 2 | 账号密码管理APP [APK下载](https://www.coolapk.com/apk/170680) 3 |
注:个人APP 仅供学习 ,不可用于商业用途。 4 | 5 | 6 | ## 功能描述:
7 | 1、本地数据库加密,无网络权限,保证安全
8 | 2、深层保护功能,重要账号信息允许二次验证保护
9 | 3、提供当前手机安装的应用选择,添加账号更快速
10 | 4、简单易用,界面简约
11 | 12 | 注:
13 | 1、验证密码不可找回,一旦忘记,只能卸载重装
14 | 2、卸载软件之后,数据同时清除,不在手机留存
15 | 16 | 17 | ## APP效果截图: 18 | ![image](https://github.com/BestCoderXQX/AccountManage/raw/master/screenshots/a1.png) 19 | ![image](https://github.com/BestCoderXQX/AccountManage/raw/master/screenshots/b1.png) 20 | ![image](https://github.com/BestCoderXQX/AccountManage/raw/master/screenshots/c1.png) 21 | ![image](https://github.com/BestCoderXQX/AccountManage/raw/master/screenshots/d1.png) 22 | 23 | 24 | [我的博客: 听着music睡](http://www.cnblogs.com/xqxacm/) 25 | 26 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/accountmanager.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/accountmanager.apk -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/app-release.apk -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.neenbedankt.android-apt' 3 | def dbflow_version = "4.0.2" 4 | android { 5 | compileSdkVersion 25 6 | buildToolsVersion "25.0.3" 7 | defaultConfig { 8 | applicationId "acffo.xqx.accountmanageacffo" 9 | minSdkVersion 15 10 | targetSdkVersion 25 11 | versionCode 3 12 | versionName "1.2.1" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 26 | exclude group: 'com.android.support', module: 'support-annotations' 27 | }) 28 | compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.18' 29 | compile 'com.android.support:design:25.3.1' 30 | compile 'com.android.support:appcompat-v7:25.3.1' 31 | compile 'com.android.support:support-v4:25.3.1' 32 | compile 'com.jakewharton:butterknife:7.0.0' 33 | 34 | //数据库 35 | apt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}" 36 | compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}" 37 | compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}" 38 | // sql-cipher database encyrption (optional) 39 | compile "com.github.Raizlabs.DBFlow:dbflow-sqlcipher:${dbflow_version}" 40 | compile 'com.mxn.soul:flowingdrawer-core:2.0.0' 41 | compile 'com.nineoldandroids:library:2.4.0' 42 | compile 'com.github.bumptech.glide:glide:3.6.1' 43 | compile 'de.greenrobot:eventbus:2.4.0' 44 | compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1' 45 | compile 'com.belerweb:pinyin4j:2.5.0' 46 | compile 'com.yanzhenjie:permission:1.1.0' 47 | 48 | testCompile 'junit:junit:4.12' 49 | } 50 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\androidapp\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/acffo/xqx/accountmanageacffo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("acffo.xqx.accountmanage", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/MainAdapter.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | 6 | import com.chad.library.adapter.base.BaseQuickAdapter; 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | 9 | import java.util.ArrayList; 10 | 11 | import acffo.xqx.accountmanageacffo.base.database.Account; 12 | import acffo.xqx.accountmanageacffo.base.utils.PinyinUtils; 13 | 14 | /** 15 | * @author xqx 16 | * @email djlxqx@163.com 17 | * blog:http://www.cnblogs.com/xqxacm/ 18 | * createAt 2017/11/29 19 | * description: 主界面 账号列表适配器 20 | */ 21 | 22 | public class MainAdapter extends BaseQuickAdapter { 23 | 24 | 25 | public MainAdapter(ArrayList datas) { 26 | super(R.layout.item_main_list, datas); 27 | } 28 | 29 | @Override 30 | protected void convert(BaseViewHolder helper, final Account item) { 31 | helper.setText(R.id.name ,item.getTitle()); 32 | 33 | Bitmap bitmap=BitmapFactory.decodeFile(item.getImgUrl()); 34 | if (bitmap==null){ 35 | helper.setVisible(R.id.img , false); 36 | helper.setVisible(R.id.noimg , true); 37 | helper.setText(R.id.noimg , PinyinUtils.getFirstSpell(item.getTitle()).substring(0,1).toUpperCase()); 38 | }else { 39 | helper.setVisible(R.id.img , true); 40 | helper.setVisible(R.id.noimg , false); 41 | helper.setImageBitmap(R.id.img, bitmap); 42 | } 43 | 44 | // 子控件点击事件 45 | helper.addOnClickListener(R.id.btnDelete); 46 | 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/XApplication.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo; 2 | 3 | import android.app.Application; 4 | 5 | import com.raizlabs.android.dbflow.config.FlowManager; 6 | 7 | /** 8 | * @author xqx 9 | * @email djlxqx@163.com 10 | * blog:http://www.cnblogs.com/xqxacm/ 11 | * createAt 2017/11/29 12 | * description: acffo 个人APP 开源 版权所有,仅供学习! 13 | */ 14 | 15 | public class XApplication extends Application{ 16 | @Override 17 | public void onCreate() { 18 | super.onCreate(); 19 | 20 | // 数据库的初始化 21 | FlowManager.init(this); 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/Constant.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base; 2 | 3 | /** 4 | * Created by 徐启鑫 on 2017/11/24. 5 | */ 6 | 7 | public class Constant { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/activity/AppManager.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.activity; 2 | 3 | /* 4 | * @author xqx 5 | * @emil djlxqx@163.com 6 | * create at 2017/6/12 7 | * description: 管理activity的类 8 | */ 9 | 10 | import android.app.Activity; 11 | import android.app.ActivityManager; 12 | import android.content.Context; 13 | 14 | import java.util.Stack; 15 | 16 | public class AppManager { 17 | private static Stack activityStack; 18 | private static AppManager instance; 19 | 20 | /** 21 | * 单一实例 22 | */ 23 | public static AppManager getAppManager() { 24 | if (instance == null) { 25 | instance = new AppManager(); 26 | } 27 | return instance; 28 | } 29 | 30 | /** 31 | * 添加Activity到堆栈 32 | */ 33 | public void addActivity(Activity activity) { 34 | if (activityStack == null) { 35 | activityStack = new Stack(); 36 | } 37 | activityStack.add(activity); 38 | } 39 | 40 | /** 41 | * 获取当前Activity(堆栈中最后一个压入的) 42 | */ 43 | public Activity currentActivity() { 44 | Activity activity = activityStack.lastElement(); 45 | return activity; 46 | } 47 | 48 | /** 49 | * 结束当前Activity(堆栈中最后一个压入的) 50 | */ 51 | public void finishActivity() { 52 | Activity activity = activityStack.lastElement(); 53 | if (activity != null) { 54 | activity.finish(); 55 | activity = null; 56 | } 57 | } 58 | 59 | /** 60 | * 结束指定的Activity 61 | */ 62 | public void finishActivity(Activity activity) { 63 | if (activity != null) { 64 | activityStack.remove(activity); 65 | activity.finish(); 66 | activity = null; 67 | } 68 | } 69 | 70 | /** 71 | * 结束指定类名的Activity 72 | */ 73 | public void finishActivity(Class cls) { 74 | for (Activity activity : activityStack) { 75 | if (activity.getClass().equals(cls)) { 76 | finishActivity(activity); 77 | } 78 | } 79 | } 80 | 81 | /** 82 | * 结束所有Activity 83 | */ 84 | public void finishAllActivity() { 85 | for (int i = 0, size = activityStack.size(); i < size; i++) { 86 | if (null != activityStack.get(i)) { 87 | activityStack.get(i).finish(); 88 | } 89 | } 90 | activityStack.clear(); 91 | } 92 | 93 | /** 94 | * 退出应用程序 95 | */ 96 | @SuppressWarnings("deprecation") 97 | public void AppExit(Context context) { 98 | try { 99 | finishAllActivity(); 100 | ActivityManager activityMgr = (ActivityManager) context 101 | .getSystemService(Context.ACTIVITY_SERVICE); 102 | activityMgr.restartPackage(context.getPackageName()); 103 | System.exit(0); 104 | } catch (Exception e) { 105 | } 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/activity/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.activity; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | 7 | 8 | /** 9 | * @author xqx 10 | * @email djlxqx@163.com 11 | * blog:http://www.cnblogs.com/xqxacm/ 12 | * createAt 2017/11/9 13 | * description: 父Activity 进行 Activity管理 14 | */ 15 | 16 | public class BaseActivity extends Activity{ 17 | /** 18 | * activity堆栈管理 19 | */ 20 | protected AppManager appManager = AppManager.getAppManager(); 21 | 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | // 添加activity 到栈 26 | appManager.addActivity(this); 27 | } 28 | 29 | protected void onPause() { 30 | super.onPause(); 31 | } 32 | 33 | protected void onResume() { 34 | super.onResume(); 35 | } 36 | @Override 37 | protected void onDestroy() { 38 | super.onDestroy(); 39 | // 从栈中移除activity 40 | appManager.finishActivity(this); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/activity/BaseFragmentActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.FragmentActivity; 6 | 7 | 8 | /** 9 | * Created by xqx on 2017/6/12. 10 | */ 11 | public class BaseFragmentActivity extends FragmentActivity { 12 | /** 13 | * activity堆栈管理 14 | */ 15 | protected AppManager appManager = AppManager.getAppManager(); 16 | 17 | @Override 18 | protected void onCreate(@Nullable Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | // 添加activity 到栈 21 | appManager.addActivity(this); 22 | 23 | } 24 | 25 | protected void onPause() { 26 | super.onPause(); 27 | 28 | } 29 | 30 | protected void onResume() { 31 | super.onResume(); 32 | } 33 | @Override 34 | protected void onDestroy() { 35 | super.onDestroy(); 36 | // 从栈中移除activity 37 | appManager.finishActivity(this); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/database/Account.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.database; 2 | 3 | import com.raizlabs.android.dbflow.annotation.Column; 4 | import com.raizlabs.android.dbflow.annotation.PrimaryKey; 5 | import com.raizlabs.android.dbflow.annotation.Table; 6 | import com.raizlabs.android.dbflow.structure.BaseModel; 7 | 8 | /** 9 | * @author xqx 10 | * @email djlxqx@163.com 11 | * blog:http://www.cnblogs.com/xqxacm/ 12 | * createAt 2017/11/30 13 | * description: 账号信息 14 | */ 15 | 16 | @Table(database = AccountDB.class) 17 | public class Account extends BaseModel{ 18 | //主键 一个表必须有至少一个主键 19 | // (autoincrement = true) 表示该字段是自增的,可以不设置 ,默认false 20 | @PrimaryKey(autoincrement = true) 21 | long id ; 22 | 23 | // 标题 24 | @Column 25 | String title; 26 | 27 | // 名字 28 | @Column 29 | String name; 30 | 31 | // 密码 32 | @Column 33 | String password; 34 | 35 | // 备注 36 | @Column 37 | String explain ; 38 | 39 | // 图标 文件路径 40 | @Column 41 | String imgUrl; 42 | 43 | // 是否深层加密 44 | @Column 45 | boolean isEncrypt; 46 | 47 | public Account() { 48 | } 49 | 50 | public String getName() { 51 | return name; 52 | } 53 | 54 | public void setName(String name) { 55 | this.name = name; 56 | } 57 | 58 | public String getPassword() { 59 | return password; 60 | } 61 | 62 | public void setPassword(String password) { 63 | this.password = password; 64 | } 65 | 66 | public String getExplain() { 67 | return explain; 68 | } 69 | 70 | public void setExplain(String explain) { 71 | this.explain = explain; 72 | } 73 | 74 | public String getImgUrl() { 75 | return imgUrl; 76 | } 77 | 78 | public void setImgUrl(String imgUrl) { 79 | this.imgUrl = imgUrl; 80 | } 81 | 82 | public String getTitle() { 83 | return title; 84 | } 85 | 86 | public void setTitle(String title) { 87 | this.title = title; 88 | } 89 | 90 | public boolean isEncrypt() { 91 | return isEncrypt; 92 | } 93 | 94 | public void setEncrypt(boolean encrypt) { 95 | isEncrypt = encrypt; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/database/AccountDB.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.database; 2 | 3 | import com.raizlabs.android.dbflow.annotation.Database; 4 | 5 | /** 6 | * @author xqx 7 | * @email djlxqx@163.com 8 | * blog:http://www.cnblogs.com/xqxacm/ 9 | * createAt 2017/11/30 10 | * description: 账号信息数据库 11 | */ 12 | 13 | 14 | @Database(name = AccountDB.Name , version = AccountDB.VERSION) 15 | public class AccountDB { 16 | 17 | static final String Name = "SchoolDB"; //数据库名 18 | static final int VERSION = 1; //数据库版本号 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/database/AdminDB.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.database; 2 | 3 | import com.raizlabs.android.dbflow.annotation.Database; 4 | 5 | /** 6 | * @author xqx 7 | * @email djlxqx@163.com 8 | * blog:http://www.cnblogs.com/xqxacm/ 9 | * createAt 2017/11/28 10 | * description: 登录应用密码数据库 11 | */ 12 | 13 | 14 | @Database(name = AdminDB.Name , version = AdminDB.VERSION) 15 | public class AdminDB { 16 | static final String Name = "ADMIN"; //数据库名 17 | static final int VERSION = 1; //数据库版本号 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/database/AdminEntity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.database; 2 | 3 | import com.raizlabs.android.dbflow.annotation.Column; 4 | import com.raizlabs.android.dbflow.annotation.PrimaryKey; 5 | import com.raizlabs.android.dbflow.annotation.Table; 6 | import com.raizlabs.android.dbflow.structure.BaseModel; 7 | 8 | /** 9 | * @author xqx 10 | * @email djlxqx@163.com 11 | * blog:http://www.cnblogs.com/xqxacm/ 12 | * createAt 2017/11/30 13 | * description: 登录应用密码 14 | */ 15 | 16 | @Table(database = AdminDB.class) 17 | public class AdminEntity extends BaseModel{ 18 | 19 | @PrimaryKey(autoincrement = true) 20 | long id ; 21 | 22 | @Column 23 | String password ; // 密码 24 | 25 | @Column 26 | String quesetion; //问题 27 | 28 | @Column 29 | String result; //答案 30 | 31 | 32 | public String getPassword() { 33 | return password; 34 | } 35 | 36 | public void setPassword(String password) { 37 | this.password = password; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/database/DeepGuardDB.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.database; 2 | 3 | import com.raizlabs.android.dbflow.annotation.Database; 4 | 5 | /** 6 | * @author xqx 7 | * @email djlxqx@163.com 8 | * blog:http://www.cnblogs.com/xqxacm/ 9 | * createAt 2017/11/30 10 | * description: 深层保护密码数据库 11 | */ 12 | 13 | @Database(name = DeepGuardDB.Name , version = DeepGuardDB.VERSION) 14 | public class DeepGuardDB { 15 | static final String Name = "DeepGuard"; //数据库名 16 | static final int VERSION = 1; //数据库版本号 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/database/DeepGuardEntity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.database; 2 | 3 | import com.raizlabs.android.dbflow.annotation.Column; 4 | import com.raizlabs.android.dbflow.annotation.PrimaryKey; 5 | import com.raizlabs.android.dbflow.annotation.Table; 6 | import com.raizlabs.android.dbflow.structure.BaseModel; 7 | 8 | /** 9 | * @author xqx 10 | * @email djlxqx@163.com 11 | * blog:http://www.cnblogs.com/xqxacm/ 12 | * createAt 2017/11/30 13 | * description:深层保护密码 14 | */ 15 | 16 | @Table(database = DeepGuardDB.class) 17 | public class DeepGuardEntity extends BaseModel{ 18 | @PrimaryKey(autoincrement = true) 19 | long id ; 20 | 21 | @Column 22 | String password ; // 密码 23 | 24 | @Column 25 | String quesetion; //问题 26 | 27 | @Column 28 | String result; //答案 29 | 30 | 31 | public String getPassword() { 32 | return password; 33 | } 34 | 35 | public void setPassword(String password) { 36 | this.password = password; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/dialog/DeepGuardValidationMainDialog.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.dialog; 2 | 3 | 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.content.DialogInterface; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.Window; 10 | import android.widget.EditText; 11 | import android.widget.TextView; 12 | 13 | import com.raizlabs.android.dbflow.sql.language.SQLite; 14 | import com.sdsmdg.tastytoast.TastyToast; 15 | 16 | import java.util.List; 17 | 18 | import acffo.xqx.accountmanageacffo.R; 19 | import acffo.xqx.accountmanageacffo.base.database.Account; 20 | import acffo.xqx.accountmanageacffo.base.database.DeepGuardEntity; 21 | 22 | /** 23 | * @author xqx 24 | * @email djlxqx@163.com 25 | * blog:http://www.cnblogs.com/xqxacm/ 26 | * createAt 2017/11/30 27 | * description: 二级验证/深层保护密码验证 对话框 28 | */ 29 | 30 | public class DeepGuardValidationMainDialog extends Dialog { 31 | public DeepGuardValidationMainDialog(Context context) { 32 | super(context); 33 | } 34 | 35 | public DeepGuardValidationMainDialog(Context context, int themeResId) { 36 | super(context, themeResId); 37 | } 38 | 39 | 40 | 41 | public static class Builder { 42 | EditText editPassword; // 密码框 43 | List deepGuardPs ; 44 | 45 | public void create(final Context context , final Account account) { 46 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 47 | final ResetPsDialog dialog = new ResetPsDialog(context, R.style.PopularDialog); 48 | dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉title 49 | View layout = inflater.inflate(R.layout.dialog_deepguardvalidation, null); 50 | editPassword = (EditText) layout.findViewById(R.id.editPassword); 51 | 52 | deepGuardPs = SQLite.select().from(DeepGuardEntity.class).queryList(); 53 | 54 | //关闭按钮 55 | layout.findViewById(R.id.btnClose).setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | dialog.dismiss(); 59 | } 60 | }); 61 | 62 | //关闭按钮 63 | layout.findViewById(R.id.btnCancel).setOnClickListener(new View.OnClickListener() { 64 | @Override 65 | public void onClick(View v) { 66 | dialog.dismiss(); 67 | } 68 | }); 69 | 70 | 71 | ((TextView) layout.findViewById(R.id.btnConfirm)).setOnClickListener(new View.OnClickListener() { 72 | @Override 73 | public void onClick(View v) { 74 | 75 | if (editPassword.getText().toString().equals("")) { 76 | TastyToast.makeText(context, "请填写深层保护密码!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 77 | return; 78 | } 79 | 80 | if (deepGuardPs.get(0).getPassword().equals(editPassword.getText().toString())){ 81 | // 成功 , 进入 82 | // 该账号信息不再深层保护列表里 ,直接打开 83 | final AccountInfoDialog.Builder builder = new AccountInfoDialog.Builder(); 84 | builder.create(context , account ); 85 | /** 86 | * 编辑 87 | */ 88 | builder.setEdit(new DialogInterface.OnClickListener() { 89 | @Override 90 | public void onClick(DialogInterface d, int which) { 91 | builder.setEnableEdit(); 92 | } 93 | }); 94 | dialog.dismiss(); 95 | 96 | }else { 97 | TastyToast.makeText(context, "进入失败,密码错误!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 98 | } 99 | 100 | } 101 | }); 102 | 103 | dialog.setContentView(layout); 104 | dialog.setCanceledOnTouchOutside(false);// 设置点击屏幕Dialog不消失 105 | dialog.show(); 106 | } 107 | 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/dialog/DeepGuardValidationSettingDialog.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.dialog; 2 | 3 | 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.Window; 10 | import android.widget.EditText; 11 | 12 | import com.raizlabs.android.dbflow.sql.language.SQLite; 13 | import com.sdsmdg.tastytoast.TastyToast; 14 | 15 | import java.util.List; 16 | 17 | import acffo.xqx.accountmanageacffo.R; 18 | import acffo.xqx.accountmanageacffo.base.database.DeepGuardEntity; 19 | import acffo.xqx.accountmanageacffo.ui.main.DeepGuardActivity; 20 | import acffo.xqx.accountmanageacffo.ui.main.SetDeepGuardPSActivity; 21 | 22 | /** 23 | * @author xqx 24 | * @email djlxqx@163.com 25 | * blog:http://www.cnblogs.com/xqxacm/ 26 | * createAt 2017/11/30 27 | * description: 二级验证/深层保护密码验证 对话框 28 | */ 29 | 30 | public class DeepGuardValidationSettingDialog extends Dialog { 31 | public DeepGuardValidationSettingDialog(Context context) { 32 | super(context); 33 | } 34 | 35 | public DeepGuardValidationSettingDialog(Context context, int themeResId) { 36 | super(context, themeResId); 37 | } 38 | 39 | 40 | 41 | public static class Builder { 42 | EditText editPassword; // 密码框 43 | List deepGuardPs ; 44 | 45 | public void create(final Context context , final int type) { 46 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 47 | final ResetPsDialog dialog = new ResetPsDialog(context, R.style.PopularDialog); 48 | dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉title 49 | View layout = inflater.inflate(R.layout.dialog_deepguardvalidation, null); 50 | editPassword = (EditText) layout.findViewById(R.id.editPassword); 51 | 52 | deepGuardPs = SQLite.select().from(DeepGuardEntity.class).queryList(); 53 | 54 | //关闭按钮 55 | layout.findViewById(R.id.btnClose).setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | dialog.dismiss(); 59 | } 60 | }); 61 | 62 | //关闭按钮 63 | layout.findViewById(R.id.btnCancel).setOnClickListener(new View.OnClickListener() { 64 | @Override 65 | public void onClick(View v) { 66 | dialog.dismiss(); 67 | } 68 | }); 69 | 70 | 71 | layout.findViewById(R.id.btnConfirm).setOnClickListener(new View.OnClickListener() { 72 | @Override 73 | public void onClick(View v) { 74 | 75 | if (editPassword.getText().toString().equals("")) { 76 | TastyToast.makeText(context, "请填写深层保护密码!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 77 | return; 78 | } 79 | 80 | if (deepGuardPs.get(0).getPassword().equals(editPassword.getText().toString())){ 81 | // 成功 , 进入 82 | // 1、代表进入深层保护列表 2、代表修改深层保护密码 83 | if (type==1) { 84 | context.startActivity(new Intent(context, DeepGuardActivity.class)); 85 | }else if (type==2){ 86 | boolean delete = deepGuardPs.get(0).delete(); 87 | if (delete) { 88 | context.startActivity(new Intent(context, SetDeepGuardPSActivity.class)); 89 | }else{ 90 | TastyToast.makeText(context, "异常错误", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 91 | } 92 | } 93 | dialog.dismiss(); 94 | }else { 95 | TastyToast.makeText(context, "进入失败,密码错误!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 96 | } 97 | } 98 | }); 99 | 100 | dialog.setContentView(layout); 101 | dialog.setCanceledOnTouchOutside(false);// 设置点击屏幕Dialog不消失 102 | dialog.show(); 103 | } 104 | 105 | 106 | 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/dialog/IsNoDialog.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.dialog; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.content.DialogInterface; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.Window; 9 | import android.widget.TextView; 10 | 11 | import acffo.xqx.accountmanageacffo.R; 12 | 13 | 14 | /** 15 | * @author xqx 16 | * @emil djlxqx@163.com 17 | * blog:http://www.cnblogs.com/xqxacm/ 18 | * createAt 2017/6/27 19 | * description: 确定取消对话框 20 | */ 21 | 22 | public class IsNoDialog extends Dialog { 23 | public IsNoDialog(Context context) { 24 | super(context); 25 | } 26 | 27 | public IsNoDialog(Context context, int themeResId) { 28 | super(context, themeResId); 29 | } 30 | 31 | private static OnClickListener btnConfirmListener; 32 | private static OnClickListener btnCancelListener; 33 | 34 | public static class Builder { 35 | 36 | public IsNoDialog.Builder setConfirmButton(OnClickListener listener) { 37 | btnConfirmListener = listener; 38 | return this; 39 | } 40 | 41 | public IsNoDialog.Builder setCancelButton(OnClickListener listener) { 42 | btnCancelListener = listener; 43 | return this; 44 | } 45 | 46 | public void create(Context context, String content,String txtNo ,String txtYes) { 47 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 48 | final AccountInfoDialog dialog = new AccountInfoDialog(context, R.style.PopularDialog); 49 | dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉title 50 | View layout = inflater.inflate(R.layout.dialog_is_no, null); 51 | ((TextView)layout.findViewById(R.id.btnCancel)).setText(txtNo); 52 | ((TextView)layout.findViewById(R.id.btnConfirm)).setText(txtYes); 53 | ((TextView) layout.findViewById(R.id.txtContent)).setText(content); 54 | 55 | ((TextView)layout.findViewById(R.id.btnCancel)).setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | btnCancelListener.onClick(dialog, 59 | DialogInterface.BUTTON_POSITIVE); 60 | } 61 | }); 62 | ((TextView)layout.findViewById(R.id.btnConfirm)).setOnClickListener(new View.OnClickListener() { 63 | @Override 64 | public void onClick(View v) { 65 | btnConfirmListener.onClick(dialog, 66 | DialogInterface.BUTTON_NEGATIVE); 67 | } 68 | }); 69 | 70 | 71 | dialog.setContentView(layout); 72 | dialog.setCanceledOnTouchOutside(false);// 设置点击屏幕Dialog不消失 73 | dialog.show(); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/dialog/MessageDialogSingle.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.dialog; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.Window; 8 | import android.widget.TextView; 9 | 10 | import acffo.xqx.accountmanageacffo.R; 11 | 12 | 13 | /** 14 | * @author xqx 15 | * @email djlxqx@163.com 16 | * blog:http://www.cnblogs.com/xqxacm/ 17 | * createAt 2017/10/19 18 | * description: 纯文本消息对话框 ,单行 19 | */ 20 | 21 | public class MessageDialogSingle extends Dialog { 22 | public MessageDialogSingle(Context context) { 23 | super(context); 24 | } 25 | 26 | public MessageDialogSingle(Context context, int themeResId) { 27 | super(context, themeResId); 28 | } 29 | 30 | public static class Builder { 31 | 32 | 33 | public void create(Context context, String content) { 34 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 35 | final MessageDialogSingle dialog = new MessageDialogSingle(context, R.style.PopularDialog); 36 | dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉title 37 | View layout = inflater.inflate(R.layout.dialog_message_singleline, null); 38 | 39 | ((TextView) layout.findViewById(R.id.txtContent)).setText(content); 40 | //取消按钮 41 | layout.findViewById(R.id.btnComfirm).setOnClickListener(new View.OnClickListener() { 42 | @Override 43 | public void onClick(View v) { 44 | dialog.dismiss(); 45 | } 46 | }); 47 | 48 | dialog.setContentView(layout); 49 | dialog.setCanceledOnTouchOutside(false);// 设置点击屏幕Dialog不消失 50 | dialog.show(); 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/dialog/ResetPsDialog.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.dialog; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.Window; 9 | import android.widget.EditText; 10 | import android.widget.TextView; 11 | 12 | import com.raizlabs.android.dbflow.sql.language.SQLite; 13 | import com.sdsmdg.tastytoast.TastyToast; 14 | 15 | import java.util.List; 16 | 17 | import acffo.xqx.accountmanageacffo.R; 18 | import acffo.xqx.accountmanageacffo.base.activity.AppManager; 19 | import acffo.xqx.accountmanageacffo.base.database.AdminEntity; 20 | import acffo.xqx.accountmanageacffo.ui.main.SetAdminPsActivity; 21 | 22 | 23 | /** 24 | * @author xqx 25 | * @emil djlxqx@163.com 26 | * blog:http://www.cnblogs.com/xqxacm/ 27 | * createAt 2017/6/27 28 | * description: 输入原密码对话框 29 | */ 30 | 31 | 32 | public class ResetPsDialog extends Dialog { 33 | public ResetPsDialog(Context context) { 34 | super(context); 35 | } 36 | 37 | public ResetPsDialog(Context context, int themeResId) { 38 | super(context, themeResId); 39 | } 40 | 41 | 42 | 43 | public static class Builder { 44 | EditText editPassword; // 密码框 45 | 46 | public void create(final Context context ) { 47 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 48 | final ResetPsDialog dialog = new ResetPsDialog(context, R.style.PopularDialog); 49 | dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉title 50 | View layout = inflater.inflate(R.layout.dialog_resetps, null); 51 | editPassword = (EditText) layout.findViewById(R.id.editPassword); 52 | 53 | 54 | //关闭按钮 55 | layout.findViewById(R.id.btnClose).setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | dialog.dismiss(); 59 | } 60 | }); 61 | 62 | //关闭按钮 63 | layout.findViewById(R.id.btnCancel).setOnClickListener(new View.OnClickListener() { 64 | @Override 65 | public void onClick(View v) { 66 | dialog.dismiss(); 67 | } 68 | }); 69 | 70 | ((TextView) layout.findViewById(R.id.btnConfirm)).setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | 74 | if (editPassword.getText().toString().equals("")) { 75 | TastyToast.makeText(context, "请填写登录密码!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 76 | return; 77 | } 78 | List adminEntities = SQLite.select().from(AdminEntity.class).queryList(); 79 | if (adminEntities.size()==0){ 80 | // 如果没有设置 81 | TastyToast.makeText(context, "未设置登录密码,请先设置!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 82 | AppManager.getAppManager().finishAllActivity(); 83 | context.startActivity(new Intent(context,SetAdminPsActivity.class)); 84 | dialog.dismiss(); 85 | }else if (adminEntities.size()>1){ 86 | for (int i = 1; i < adminEntities.size(); i++) { 87 | adminEntities.get(i).delete(); 88 | } 89 | } 90 | if (adminEntities.get(0).getPassword().equals(editPassword.getText().toString())){ 91 | // 成功 , 进入 92 | adminEntities.get(0).delete(); 93 | AppManager.getAppManager().finishAllActivity(); 94 | TastyToast.makeText(context, "验证成功,请设置登录密码", TastyToast.LENGTH_SHORT, TastyToast.SUCCESS); 95 | context.startActivity(new Intent(context,SetAdminPsActivity.class)); 96 | dialog.dismiss(); 97 | }else { 98 | TastyToast.makeText(context, "进入失败,密码错误!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 99 | } 100 | 101 | } 102 | }); 103 | 104 | dialog.setContentView(layout); 105 | dialog.setCanceledOnTouchOutside(false);// 设置点击屏幕Dialog不消失 106 | dialog.show(); 107 | } 108 | 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/entity/AppEntity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.entity; 2 | 3 | 4 | import android.graphics.drawable.Drawable; 5 | 6 | /** 7 | * @author xqx 8 | * @email djlxqx@163.com 9 | * blog:http://www.cnblogs.com/xqxacm/ 10 | * createAt 2017/11/23 11 | * description: 应用信息 12 | */ 13 | 14 | 15 | public class AppEntity { 16 | private String name; 17 | private Drawable img ; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public Drawable getImg() { 28 | return img; 29 | } 30 | 31 | public void setImg(Drawable img) { 32 | this.img = img; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/eventbus/AddAccount.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.eventbus; 2 | 3 | import acffo.xqx.accountmanageacffo.base.database.Account; 4 | 5 | /** 6 | * Created by 徐启鑫 on 2017/11/24. 7 | */ 8 | 9 | public class AddAccount { 10 | private Account account; 11 | 12 | public AddAccount(Account account) { 13 | this.account = account; 14 | } 15 | 16 | public Account getAccount() { 17 | return account; 18 | } 19 | 20 | public void setAccount(Account account) { 21 | this.account = account; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/eventbus/AddFromAccountEventbus.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.eventbus; 2 | 3 | import java.util.ArrayList; 4 | 5 | import acffo.xqx.accountmanageacffo.base.database.Account; 6 | 7 | /** 8 | * @author xqx 9 | * @email djlxqx@163.com 10 | * blog:http://www.cnblogs.com/xqxacm/ 11 | * createAt 2017/11/29 12 | * description: 从已有的账号数据中添加数据到深层加密的集合 13 | */ 14 | 15 | public class AddFromAccountEventbus { 16 | private ArrayList lists ; 17 | 18 | public AddFromAccountEventbus(ArrayList lists) { 19 | this.lists = lists; 20 | } 21 | 22 | public ArrayList getLists() { 23 | return lists; 24 | } 25 | 26 | public void setLists(ArrayList lists) { 27 | this.lists = lists; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/eventbus/SelectApp.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.eventbus; 2 | 3 | import acffo.xqx.accountmanageacffo.base.entity.AppEntity; 4 | 5 | /** 6 | * @author xqx 7 | * @email djlxqx@163.com 8 | * blog:http://www.cnblogs.com/xqxacm/ 9 | * createAt 2017/11/24 10 | * description: 选中一个app item之后 传递app数据 11 | */ 12 | 13 | public class SelectApp { 14 | private AppEntity appEntity; 15 | 16 | public SelectApp(AppEntity appEntity) { 17 | this.appEntity = appEntity; 18 | } 19 | 20 | public AppEntity getAppEntity() { 21 | return appEntity; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/eventbus/UpdataMainListEventbus.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.eventbus; 2 | 3 | /** 4 | * @author xqx 5 | * @email djlxqx@163.com 6 | * blog:http://www.cnblogs.com/xqxacm/ 7 | * createAt 2017/11/30 8 | * description: 更新主界面账号列表 9 | */ 10 | 11 | public class UpdataMainListEventbus { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/popupwindow/SortPopupWindow.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.popupwindow; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.ColorDrawable; 5 | import android.view.LayoutInflater; 6 | import android.view.MotionEvent; 7 | import android.view.View; 8 | import android.widget.PopupWindow; 9 | import android.widget.TextView; 10 | 11 | 12 | import acffo.xqx.accountmanageacffo.R; 13 | 14 | import static android.view.ViewGroup.LayoutParams; 15 | import static android.view.ViewGroup.OnClickListener; 16 | import static android.view.ViewGroup.OnTouchListener; 17 | 18 | /** 19 | * @author xqx 20 | * @email djlxqx@163.com 21 | * blog:http://www.cnblogs.com/xqxacm/ 22 | * createAt 2017/11/28 23 | * description: 排序 条件 popupwindow 24 | */ 25 | 26 | public class SortPopupWindow extends PopupWindow{ 27 | private View mMenuView; //popupwindow布局生成的View 28 | private TextView btnTimeAscend; //按时间升序 29 | private TextView btnTimeDescend; //按时间降序 30 | private TextView btnNameAscend; //按名字升序 31 | private TextView btnNameDescend; //按名字降序 32 | 33 | public SortPopupWindow(final Context context , OnClickListener itemsOnClick) { 34 | super(context); 35 | 36 | LayoutInflater inflater = (LayoutInflater) context 37 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 38 | mMenuView = inflater.inflate(R.layout.popup_sort, null); 39 | 40 | btnTimeAscend = (TextView) mMenuView.findViewById(R.id.btnTimeAscend); 41 | btnTimeDescend = (TextView) mMenuView.findViewById(R.id.btnTimeDescend); 42 | btnNameAscend = (TextView) mMenuView.findViewById(R.id.btnNameAscend); 43 | btnNameDescend = (TextView) mMenuView.findViewById(R.id.btnNameDescend); 44 | 45 | btnTimeAscend.setOnClickListener(itemsOnClick); 46 | btnTimeDescend.setOnClickListener(itemsOnClick); 47 | btnNameAscend.setOnClickListener(itemsOnClick); 48 | btnNameDescend.setOnClickListener(itemsOnClick); 49 | 50 | this.setContentView(mMenuView); 51 | this.setWidth(LayoutParams.WRAP_CONTENT); 52 | this.setHeight(LayoutParams.WRAP_CONTENT); 53 | ColorDrawable dw = new ColorDrawable(0x000000); 54 | this.setBackgroundDrawable(dw); 55 | this.setFocusable(true); 56 | //点击popupWindow之外的部分 关闭popupWindow 57 | mMenuView.setOnTouchListener(new OnTouchListener() { 58 | public boolean onTouch(View v, MotionEvent event) { 59 | int height = mMenuView.findViewById(R.id.ly_popup).getBottom(); 60 | int y = (int) event.getY(); 61 | if (event.getAction() == MotionEvent.ACTION_UP){ 62 | if(y>height){ 63 | dismiss(); 64 | } 65 | } 66 | return true; 67 | } 68 | }); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/utils/AlipayUtil.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.ActivityNotFoundException; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.pm.PackageInfo; 8 | import android.content.pm.PackageManager; 9 | 10 | import java.net.URISyntaxException; 11 | 12 | /** 13 | * @author xqx 14 | * @email djlxqx@163.com 15 | * blog:http://www.cnblogs.com/xqxacm/ 16 | * createAt $date$ 17 | * description: 18 | */ 19 | public class AlipayUtil { 20 | // 支付宝包名 21 | private static final String ALIPAY_PACKAGE_NAME = "com.eg.android.AlipayGphone"; 22 | 23 | // 旧版支付宝二维码通用 Intent Scheme Url 格式 24 | private static final String INTENT_URL_FORMAT = "intent://platformapi/startapp?saId=10000007&" + 25 | "clientVersion=3.7.0.0718&qrcode=https%3A%2F%2Fqr.alipay.com%2F{urlCode}%3F_s" + 26 | "%3Dweb-other&_t=1472443966571#Intent;" + 27 | "scheme=alipayqr;package=com.eg.android.AlipayGphone;end"; 28 | 29 | /** 30 | * 打开转账窗口 31 | * 旧版支付宝二维码方法,需要使用 https://fama.alipay.com/qrcode/index.htm 网站生成的二维码 32 | * 这个方法最好,但在 2016 年 8 月发现新用户可能无法使用 33 | * 34 | * @param activity Parent Activity 35 | * @param urlCode 手动解析二维码获得地址中的参数,例如 https://qr.alipay.com/aehvyvf4taua18zo6e 最后那段 36 | * @return 是否成功调用 37 | */ 38 | public static boolean startAlipayClient(Activity activity, String urlCode) { 39 | return startIntentUrl(activity, INTENT_URL_FORMAT.replace("{urlCode}", urlCode)); 40 | } 41 | 42 | /** 43 | * 打开 Intent Scheme Url 44 | * 45 | * @param activity Parent Activity 46 | * @param intentFullUrl Intent 跳转地址 47 | * @return 是否成功调用 48 | */ 49 | public static boolean startIntentUrl(Activity activity, String intentFullUrl) { 50 | try { 51 | Intent intent = Intent.parseUri( 52 | intentFullUrl, 53 | Intent.URI_INTENT_SCHEME 54 | ); 55 | activity.startActivity(intent); 56 | return true; 57 | } catch (URISyntaxException e) { 58 | e.printStackTrace(); 59 | return false; 60 | } catch (ActivityNotFoundException e) { 61 | e.printStackTrace(); 62 | return false; 63 | } 64 | } 65 | 66 | /** 67 | * 判断支付宝客户端是否已安装,建议调用转账前检查 68 | * 69 | * @param context Context 70 | * @return 支付宝客户端是否已安装 71 | */ 72 | public static boolean hasInstalledAlipayClient(Context context) { 73 | PackageManager pm = context.getPackageManager(); 74 | try { 75 | PackageInfo info = pm.getPackageInfo(ALIPAY_PACKAGE_NAME, 0); 76 | return info != null; 77 | } catch (PackageManager.NameNotFoundException e) { 78 | e.printStackTrace(); 79 | return false; 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/utils/ApkTool.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.utils; 2 | 3 | import android.content.pm.ApplicationInfo; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager; 6 | import android.graphics.drawable.Drawable; 7 | import android.util.Log; 8 | 9 | import java.util.ArrayList; 10 | 11 | import acffo.xqx.accountmanageacffo.base.entity.AppEntity; 12 | 13 | /** 14 | * Created by 徐启鑫 on 2017/11/24. 15 | */ 16 | 17 | public class ApkTool { 18 | 19 | static String TAG = "ApkTool"; 20 | public static ArrayList mLocalInstallApps =null; 21 | public static ArrayList scanLocalInstallAppList(PackageManager packageManager) { 22 | ArrayList myAppInfos =new ArrayList(); 23 | try{ 24 | ArrayList packageInfos = (ArrayList) packageManager.getInstalledPackages(0); 25 | for(int i =0;i < packageInfos.size();i++) { 26 | PackageInfo packageInfo = packageInfos.get(i); 27 | //过滤掉系统app 28 | if((ApplicationInfo.FLAG_SYSTEM& packageInfo.applicationInfo.flags) !=0) { 29 | continue; 30 | } 31 | AppEntity myAppInfo =new AppEntity(); 32 | myAppInfo.setName(packageInfo.applicationInfo.loadLabel(packageManager).toString()); 33 | Drawable drawable = packageInfo.applicationInfo.loadIcon(packageManager); 34 | if(drawable ==null) { 35 | continue; 36 | } 37 | myAppInfo.setImg(drawable); 38 | myAppInfos.add(myAppInfo); 39 | } 40 | }catch(Exception e) { 41 | Log.e(TAG,"===============获取应用包信息失败"); 42 | } 43 | return myAppInfos; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/utils/CryptUtil.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.utils; 2 | 3 | import java.security.InvalidKeyException; 4 | import java.security.NoSuchAlgorithmException; 5 | import java.security.spec.InvalidKeySpecException; 6 | 7 | import javax.crypto.BadPaddingException; 8 | import javax.crypto.Cipher; 9 | import javax.crypto.IllegalBlockSizeException; 10 | import javax.crypto.NoSuchPaddingException; 11 | import javax.crypto.SecretKey; 12 | import javax.crypto.SecretKeyFactory; 13 | import javax.crypto.spec.DESKeySpec; 14 | 15 | 16 | /** 17 | * @author xqx 18 | * @email djlxqx@163.com 19 | * blog:http://www.cnblogs.com/xqxacm/ 20 | * createAt 2017/11/27 21 | * description: des 加密 22 | */ 23 | 24 | public class CryptUtil { 25 | // 对称加密 DES 部分 26 | public static String KEY = "jiamikey"; 27 | 28 | public static byte[] getPasswordByte(){ 29 | return KEY.getBytes(); 30 | } 31 | public static byte[] desEncrypt(byte[] data, byte[] password) { 32 | byte[] ret = null; 33 | 34 | if (data != null && password != null) { 35 | // DES 密码必须是8个字节;标准的描述是按位描述;必须是 64bit 36 | if (data.length > 0 && password.length == 8) { 37 | 38 | // 1. 创建 Cipher ,用于加密和解密,就是一个内部的算法引擎 39 | // getInstance("加密的算法名称") 40 | try { 41 | 42 | Cipher cipher = Cipher.getInstance("DES"); 43 | 44 | // 3. 生成 Key 对象,根据不同的算法 45 | 46 | DESKeySpec keySpec = new DESKeySpec(password); 47 | 48 | // 3.2 使用密钥生成工具,来生成实际的 Key 对象 49 | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");// 参数为算法名称 50 | 51 | // 3.3 生成 Key 52 | 53 | SecretKey secretKey = keyFactory.generateSecret(keySpec); 54 | 55 | // 2. 初始化 Cipher,设置是加密模式还是解密模式,同时设置密码 56 | // 通常第二个参数可以使用 Key 对象,每一种算法,Key对象的生成是不同的 57 | cipher.init(Cipher.ENCRYPT_MODE, secretKey); 58 | 59 | // 4. 进行加密或者解密的实际操作; 60 | // 返回值就是最终的结果了 61 | ret = cipher.doFinal(data); 62 | 63 | } catch (NoSuchAlgorithmException e) { // 找不到算法的异常 64 | e.printStackTrace(); 65 | } catch (NoSuchPaddingException e) { // 66 | e.printStackTrace(); 67 | } catch (InvalidKeyException e) { // 非法的密钥异常 68 | e.printStackTrace(); 69 | } catch (InvalidKeySpecException e) { 70 | e.printStackTrace(); 71 | } catch (BadPaddingException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalBlockSizeException e) { 74 | e.printStackTrace(); 75 | } 76 | 77 | 78 | } 79 | } 80 | 81 | return ret; 82 | } 83 | 84 | 85 | public static byte[] desDecrypt(byte[] data, byte[] password) { 86 | byte[] ret = null; 87 | 88 | if (data != null && password != null) { 89 | // DES 密码必须是8个字节;标准的描述是按位描述;必须是 64bit 90 | if (data.length > 0 && password.length == 8) { 91 | 92 | // 1. 创建 Cipher ,用于加密和解密,就是一个内部的算法引擎 93 | // getInstance("加密的算法名称") 94 | try { 95 | 96 | Cipher cipher = Cipher.getInstance("DES"); 97 | 98 | // 3. 生成 Key 对象,根据不同的算法 99 | 100 | DESKeySpec keySpec = new DESKeySpec(password); 101 | 102 | // 3.2 使用密钥生成工具,来生成实际的 Key 对象 103 | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");// 参数为算法名称 104 | 105 | // 3.3 生成 Key 106 | 107 | SecretKey secretKey = keyFactory.generateSecret(keySpec); 108 | 109 | // 2. 初始化 Cipher,设置是加密模式还是解密模式,同时设置密码 110 | // 通常第二个参数可以使用 Key 对象,每一种算法,Key对象的生成是不同的 111 | cipher.init(Cipher.DECRYPT_MODE, secretKey); 112 | 113 | // 4. 进行加密或者解密的实际操作; 114 | // 返回值就是最终的结果了 115 | ret = cipher.doFinal(data); 116 | 117 | } catch (NoSuchAlgorithmException e) { // 找不到算法的异常 118 | e.printStackTrace(); 119 | } catch (NoSuchPaddingException e) { // 120 | e.printStackTrace(); 121 | } catch (InvalidKeyException e) { // 非法的密钥异常 122 | e.printStackTrace(); 123 | } catch (InvalidKeySpecException e) { 124 | e.printStackTrace(); 125 | } catch (BadPaddingException e) { 126 | e.printStackTrace(); 127 | } catch (IllegalBlockSizeException e) { 128 | e.printStackTrace(); 129 | } 130 | 131 | 132 | } 133 | } 134 | 135 | return ret; 136 | } 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/base/utils/PinyinUtils.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.base.utils; 2 | import net.sourceforge.pinyin4j.PinyinHelper; 3 | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; 4 | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; 5 | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; 6 | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; 7 | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; 8 | /** 9 | * @author xqx 10 | * @email djlxqx@163.com 11 | * blog:http://www.cnblogs.com/xqxacm/ 12 | * createAt 2017/11/27 13 | * description: 拼音相关类 14 | */ 15 | 16 | 17 | public class PinyinUtils { 18 | /** 19 | * 将字符串中的中文转化为拼音,其他字符不变 20 | * 花花大神->huahuadashen 21 | * @param inputString 22 | * @return 23 | */ 24 | public static String getPingYin(String inputString) { 25 | HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); 26 | format.setCaseType(HanyuPinyinCaseType.LOWERCASE); 27 | format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); 28 | format.setVCharType(HanyuPinyinVCharType.WITH_V); 29 | char[] input = inputString.trim().toCharArray(); 30 | String output = ""; 31 | try { 32 | for (char curchar : input) { 33 | if (java.lang.Character.toString(curchar).matches( 34 | "[\\u4E00-\\u9FA5]+")) { 35 | String[] temp = PinyinHelper.toHanyuPinyinStringArray( 36 | curchar, format); 37 | output += temp[0]; 38 | } else 39 | output += java.lang.Character.toString(curchar); 40 | } 41 | } catch (BadHanyuPinyinOutputFormatCombination e) { 42 | e.printStackTrace(); 43 | } 44 | return output; 45 | } 46 | /** 47 | * 汉字转换为汉语拼音首字母,英文字符不变 48 | * 花花大神->hhds 49 | * 汉字 50 | * @return 拼音 51 | */ 52 | public static String getFirstSpell(String chinese) { 53 | StringBuffer pybf = new StringBuffer(); 54 | char[] arr = chinese.toCharArray(); 55 | HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); 56 | defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); 57 | defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); 58 | for (char curchar : arr) { 59 | if (curchar > 128) { 60 | try { 61 | String[] temp = PinyinHelper.toHanyuPinyinStringArray(curchar, defaultFormat); 62 | if (temp != null) { 63 | pybf.append(temp[0].charAt(0)); 64 | } 65 | } catch (BadHanyuPinyinOutputFormatCombination e) { 66 | e.printStackTrace(); 67 | } 68 | } else { 69 | pybf.append(curchar); 70 | } 71 | } 72 | return pybf.toString().replaceAll("\\W", "").trim(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/addAccount/AddAccountActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.addAccount; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Bitmap; 5 | import android.graphics.drawable.BitmapDrawable; 6 | import android.os.Bundle; 7 | import android.os.Environment; 8 | import android.util.Base64; 9 | import android.view.View; 10 | import android.widget.EditText; 11 | import android.widget.ImageView; 12 | import android.widget.TextView; 13 | 14 | import com.sdsmdg.tastytoast.TastyToast; 15 | 16 | import java.io.File; 17 | import java.io.FileOutputStream; 18 | import java.io.IOException; 19 | 20 | import acffo.xqx.accountmanageacffo.R; 21 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 22 | import acffo.xqx.accountmanageacffo.base.database.Account; 23 | import acffo.xqx.accountmanageacffo.base.eventbus.AddAccount; 24 | import acffo.xqx.accountmanageacffo.base.eventbus.SelectApp; 25 | import acffo.xqx.accountmanageacffo.base.utils.CryptUtil; 26 | import butterknife.Bind; 27 | import butterknife.ButterKnife; 28 | import de.greenrobot.event.EventBus; 29 | /** 30 | * @author xqx 31 | * @email djlxqx@163.com 32 | * blog:http://www.cnblogs.com/xqxacm/ 33 | * createAt 2017/11/29 34 | * description: 添加账号信息 35 | */ 36 | 37 | public class AddAccountActivity extends BaseActivity implements View.OnClickListener { 38 | 39 | @Bind(R.id.btnBack) 40 | ImageView btnBack; 41 | @Bind(R.id.img) 42 | ImageView img; 43 | @Bind(R.id.editTitle) 44 | EditText editTitle; 45 | @Bind(R.id.btnApp) 46 | TextView btnApp; 47 | @Bind(R.id.editAccount) 48 | EditText editAccount; 49 | @Bind(R.id.editPassword) 50 | EditText editPassword; 51 | @Bind(R.id.editExplain) 52 | EditText editExplain; 53 | @Bind(R.id.btnSave) 54 | TextView btnSave; 55 | 56 | 57 | @Override 58 | protected void onCreate(Bundle savedInstanceState) { 59 | super.onCreate(savedInstanceState); 60 | setContentView(R.layout.activity_add_account); 61 | ButterKnife.bind(this); 62 | 63 | initVariables(); 64 | initView(); 65 | initEvent(); 66 | 67 | EventBus.getDefault().register(this); 68 | 69 | } 70 | 71 | private void initVariables() { 72 | 73 | } 74 | 75 | private void initView() { 76 | 77 | } 78 | 79 | private void initEvent() { 80 | btnBack.setOnClickListener(this); 81 | btnApp.setOnClickListener(this); 82 | btnSave.setOnClickListener(this); 83 | } 84 | 85 | 86 | @Override 87 | public void onClick(View v) { 88 | switch (v.getId()){ 89 | case R.id.btnBack: 90 | finish(); 91 | break; 92 | case R.id.btnApp: 93 | // 选择已有的应用名称作为标题 94 | startActivity(new Intent(this, SelectAppActivity.class)); 95 | break; 96 | case R.id.btnSave: 97 | if (editTitle.getText().toString().equals("")) { 98 | TastyToast.makeText(getApplicationContext(), "请填写标题!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 99 | return; 100 | } 101 | if (editAccount.getText().toString().equals("")) { 102 | TastyToast.makeText(getApplicationContext(), "请填写账号!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 103 | return; 104 | } 105 | if (editPassword.getText().toString().equals("")) { 106 | TastyToast.makeText(getApplicationContext(), "请填写密码!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 107 | return; 108 | } 109 | // 保存 110 | Account account = new Account(); 111 | account.setName(editAccount.getText().toString()); 112 | 113 | // 加密解密用的都是字节数组 114 | byte[] contentBytes = editPassword.getText().toString().getBytes(); 115 | //加密 116 | byte[] bytes = CryptUtil.desEncrypt(contentBytes, CryptUtil.getPasswordByte()); 117 | // 加密后的数据 118 | String encodeString = Base64.encodeToString(bytes, Base64.NO_WRAP); 119 | 120 | account.setPassword(encodeString); 121 | account.setExplain(editExplain.getText().toString()); 122 | account.setTitle(editTitle.getText().toString()); 123 | account.setEncrypt(false); // 默认无深层加密 124 | 125 | String fileName = Environment.getExternalStorageDirectory().getPath() + "/AcountManager/"+editTitle.getText().toString()+System.currentTimeMillis()+".png"; 126 | File file = new File(fileName); 127 | if (img.getDrawable()!=null) { 128 | // 有图片 129 | boolean b = saveBitmap(file); 130 | account.setImgUrl(file.getPath()); 131 | }else{ 132 | account.setImgUrl(""); 133 | } 134 | boolean save = account.save(); 135 | if (save) { 136 | TastyToast.makeText(getApplicationContext(), "保存成功!", TastyToast.LENGTH_SHORT, TastyToast.SUCCESS); 137 | EventBus.getDefault().post(new AddAccount(account)); 138 | }else{ 139 | TastyToast.makeText(getApplicationContext(), "保存失败!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 140 | } 141 | finish(); 142 | 143 | break; 144 | } 145 | } 146 | 147 | /** 148 | * 图片存文件 149 | */ 150 | public boolean saveBitmap(File f) { 151 | if (!f.exists()) { 152 | if (!f.getParentFile().exists()) { 153 | f.getParentFile().mkdirs(); 154 | } 155 | try { 156 | f.createNewFile(); 157 | FileOutputStream out = new FileOutputStream(f); 158 | ((BitmapDrawable)img.getDrawable()).getBitmap().compress(Bitmap.CompressFormat.PNG, 100, out); 159 | out.flush(); 160 | out.close(); 161 | return true; 162 | } catch (IOException e) { 163 | e.printStackTrace(); 164 | } 165 | } 166 | 167 | return false; 168 | } 169 | 170 | /** 171 | * 选择应用之后 返回 应用名和应用图标 172 | * @param event 173 | */ 174 | public void onEventMainThread(SelectApp event) { 175 | img.setImageDrawable(event.getAppEntity().getImg()); 176 | editTitle.setText(event.getAppEntity().getName()); 177 | } 178 | 179 | 180 | @Override 181 | protected void onDestroy() { 182 | super.onDestroy(); 183 | EventBus.getDefault().unregister(this); 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/addAccount/AppAdapter.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.addAccount; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | 6 | import java.util.ArrayList; 7 | 8 | import acffo.xqx.accountmanageacffo.R; 9 | import acffo.xqx.accountmanageacffo.base.entity.AppEntity; 10 | 11 | /** 12 | * Created by 徐启鑫 on 2017/11/23. 13 | */ 14 | 15 | public class AppAdapter extends BaseQuickAdapter { 16 | 17 | 18 | public AppAdapter(ArrayList datas) { 19 | super(R.layout.item_app, datas); 20 | } 21 | 22 | @Override 23 | protected void convert(BaseViewHolder helper, final AppEntity item) { 24 | helper.setText(R.id.name ,item.getName()); 25 | helper.setImageDrawable(R.id.img,item.getImg()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/addAccount/SelectAppActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.addAccount; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.widget.LinearLayoutManager; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | 9 | import com.chad.library.adapter.base.BaseQuickAdapter; 10 | 11 | import java.util.ArrayList; 12 | 13 | import acffo.xqx.accountmanageacffo.R; 14 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 15 | import acffo.xqx.accountmanageacffo.base.entity.AppEntity; 16 | import acffo.xqx.accountmanageacffo.base.eventbus.SelectApp; 17 | import acffo.xqx.accountmanageacffo.base.utils.ApkTool; 18 | import butterknife.Bind; 19 | import butterknife.ButterKnife; 20 | import de.greenrobot.event.EventBus; 21 | 22 | /** 23 | * @author xqx 24 | * @email djlxqx@163.com 25 | * blog:http://www.cnblogs.com/xqxacm/ 26 | * createAt 2017/11/23 27 | * description: 选择已有的应用名作为标题 28 | */ 29 | 30 | public class SelectAppActivity extends BaseActivity implements View.OnClickListener { 31 | 32 | @Bind(R.id.btnBack) 33 | ImageView btnBack; 34 | @Bind(R.id.recycler) 35 | RecyclerView recycler; 36 | 37 | private ArrayList datas; 38 | private AppAdapter adapter ; 39 | @Override 40 | protected void onCreate(Bundle savedInstanceState) { 41 | super.onCreate(savedInstanceState); 42 | setContentView(R.layout.activity_select_app); 43 | ButterKnife.bind(this); 44 | 45 | initVariables(); 46 | initView(); 47 | initEvent(); 48 | initData(); 49 | } 50 | 51 | private void initData() { 52 | datas = ApkTool.scanLocalInstallAppList(this.getPackageManager()); 53 | adapter.addData(datas); 54 | adapter.notifyDataSetChanged(); 55 | } 56 | 57 | private void initVariables() { 58 | datas = new ArrayList<>(); 59 | 60 | } 61 | 62 | private void initEvent() { 63 | btnBack.setOnClickListener(this); 64 | } 65 | 66 | private void initView() { 67 | recycler.setLayoutManager(new LinearLayoutManager(this)); 68 | adapter = new AppAdapter(datas); 69 | 70 | //设置item点击事件 返回选中的应用的名字和图标 71 | adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { 72 | @Override 73 | public void onItemClick(BaseQuickAdapter a, View view, int position) { 74 | EventBus.getDefault().post(new SelectApp(adapter.getData().get(position))); 75 | finish(); 76 | } 77 | }); 78 | recycler.setAdapter(adapter); 79 | } 80 | 81 | @Override 82 | public void onClick(View v) { 83 | switch (v.getId()){ 84 | case R.id.btnBack: 85 | finish(); 86 | break; 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/addFromAccount/AddFromAccountActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.addFromAccount; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.widget.LinearLayoutManager; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.chad.library.adapter.base.BaseQuickAdapter; 11 | import com.raizlabs.android.dbflow.sql.language.SQLite; 12 | 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | import acffo.xqx.accountmanageacffo.R; 17 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 18 | import acffo.xqx.accountmanageacffo.base.database.Account; 19 | import acffo.xqx.accountmanageacffo.base.database.Account_Table; 20 | import acffo.xqx.accountmanageacffo.base.eventbus.AddFromAccountEventbus; 21 | import butterknife.Bind; 22 | import butterknife.ButterKnife; 23 | import de.greenrobot.event.EventBus; 24 | /** 25 | * @author xqx 26 | * @email djlxqx@163.com 27 | * blog:http://www.cnblogs.com/xqxacm/ 28 | * createAt 2017/11/29 29 | * description: 从已有的账号信息列表中选择放到深层保护里 当打开深层保护的账号信息的时候需要输入2次密码 30 | */ 31 | 32 | public class AddFromAccountActivity extends BaseActivity implements View.OnClickListener { 33 | 34 | @Bind(R.id.btnBack) 35 | ImageView btnBack; 36 | @Bind(R.id.recycler) 37 | RecyclerView recycler; 38 | @Bind(R.id.btnSave) 39 | TextView btnSave; 40 | private AddFromAccountAdapter adapter; 41 | private ArrayList datas; 42 | 43 | private ArrayList selectedDatas ; // 选中的账号 44 | 45 | @Override 46 | protected void onCreate(Bundle savedInstanceState) { 47 | super.onCreate(savedInstanceState); 48 | setContentView(R.layout.activity_add_from_account); 49 | ButterKnife.bind(this); 50 | 51 | initVariables(); 52 | initView(); 53 | initEvent(); 54 | initDatas(); 55 | 56 | } 57 | 58 | private void initVariables() { 59 | datas = new ArrayList<>(); 60 | selectedDatas = new ArrayList<>(); 61 | } 62 | 63 | private void initDatas() { 64 | datas.clear(); 65 | List accountList = SQLite.select().from(Account.class).where(Account_Table.isEncrypt.is(false)).queryList(); 66 | adapter.addData(accountList); 67 | adapter.notifyDataSetChanged(); 68 | } 69 | 70 | private void initView() { 71 | 72 | recycler.setLayoutManager(new LinearLayoutManager(this)); 73 | adapter = new AddFromAccountAdapter(datas); 74 | 75 | //设置item点击事件 选中 76 | adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { 77 | @Override 78 | public void onItemClick(BaseQuickAdapter a, View view, final int position) { 79 | if (selectedDatas.contains(adapter.getData().get(position))){ 80 | selectedDatas.remove(adapter.getData().get(position)); 81 | }else{ 82 | selectedDatas.add(adapter.getData().get(position)); 83 | } 84 | adapter.setSelectedAccounts(selectedDatas); 85 | adapter.notifyItemChanged(position); 86 | } 87 | }); 88 | 89 | recycler.setAdapter(adapter); 90 | } 91 | 92 | private void initEvent() { 93 | btnBack.setOnClickListener(this); 94 | btnSave.setOnClickListener(this); 95 | } 96 | 97 | @Override 98 | public void onClick(View v) { 99 | switch (v.getId()) { 100 | case R.id.btnBack: 101 | finish(); 102 | break; 103 | case R.id.btnSave: 104 | // 保存 105 | EventBus.getDefault().post(new AddFromAccountEventbus(selectedDatas)); 106 | finish(); 107 | break; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/addFromAccount/AddFromAccountAdapter.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.addFromAccount; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | 6 | import com.chad.library.adapter.base.BaseQuickAdapter; 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | 9 | import java.util.ArrayList; 10 | 11 | import acffo.xqx.accountmanageacffo.R; 12 | import acffo.xqx.accountmanageacffo.base.database.Account; 13 | import acffo.xqx.accountmanageacffo.base.utils.PinyinUtils; 14 | 15 | /** 16 | * Created by 徐启鑫 on 2017/11/29. 17 | */ 18 | 19 | public class AddFromAccountAdapter extends BaseQuickAdapter { 20 | 21 | private ArrayList selectedAccounts; 22 | 23 | public AddFromAccountAdapter(ArrayList datas) { 24 | super(R.layout.item_from_account, datas); 25 | selectedAccounts = new ArrayList<>(); 26 | } 27 | 28 | public void setSelectedAccounts(ArrayList selectedAccounts) { 29 | this.selectedAccounts = selectedAccounts; 30 | } 31 | 32 | @Override 33 | protected void convert(BaseViewHolder helper, final Account item) { 34 | helper.setText(R.id.name ,item.getTitle()); 35 | Bitmap bitmap= BitmapFactory.decodeFile(item.getImgUrl()); 36 | if (bitmap==null){ 37 | helper.setVisible(R.id.img , false); 38 | helper.setVisible(R.id.noimg , true); 39 | helper.setText(R.id.noimg , PinyinUtils.getFirstSpell(item.getTitle()).substring(0,1).toUpperCase()); 40 | }else { 41 | helper.setVisible(R.id.img , true); 42 | helper.setVisible(R.id.noimg , false); 43 | helper.setImageBitmap(R.id.img, bitmap); 44 | } 45 | 46 | if (selectedAccounts.contains(item)){ 47 | helper.setImageResource(R.id.btnState , R.mipmap.icon_selected); 48 | }else{ 49 | helper.setImageResource(R.id.btnState , R.mipmap.icon_unselected); 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/main/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.main; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | 7 | import acffo.xqx.accountmanageacffo.R; 8 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 9 | import butterknife.Bind; 10 | import butterknife.ButterKnife; 11 | 12 | public class AboutActivity extends BaseActivity implements View.OnClickListener { 13 | 14 | @Bind(R.id.btnBack) 15 | ImageView btnBack; 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_about); 21 | ButterKnife.bind(this); 22 | 23 | initEvent(); 24 | } 25 | 26 | private void initEvent() { 27 | btnBack.setOnClickListener(this); 28 | } 29 | 30 | @Override 31 | public void onClick(View v) { 32 | switch (v.getId()){ 33 | case R.id.btnBack: 34 | finish(); 35 | break; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/main/DeepGuardActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.main; 2 | 3 | import android.content.DialogInterface; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.View; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.chad.library.adapter.base.BaseQuickAdapter; 13 | import com.raizlabs.android.dbflow.sql.language.SQLite; 14 | import com.sdsmdg.tastytoast.TastyToast; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | import acffo.xqx.accountmanageacffo.R; 20 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 21 | import acffo.xqx.accountmanageacffo.base.database.Account; 22 | import acffo.xqx.accountmanageacffo.base.database.Account_Table; 23 | import acffo.xqx.accountmanageacffo.base.dialog.IsNoDialog; 24 | import acffo.xqx.accountmanageacffo.base.dialog.MessageDialogSingle; 25 | import acffo.xqx.accountmanageacffo.base.eventbus.AddFromAccountEventbus; 26 | import acffo.xqx.accountmanageacffo.MainAdapter; 27 | import acffo.xqx.accountmanageacffo.base.eventbus.UpdataMainListEventbus; 28 | import acffo.xqx.accountmanageacffo.ui.addFromAccount.AddFromAccountActivity; 29 | import butterknife.Bind; 30 | import butterknife.ButterKnife; 31 | import de.greenrobot.event.EventBus; 32 | 33 | /** 34 | * @author xqx 35 | * @email djlxqx@163.com 36 | * blog:http://www.cnblogs.com/xqxacm/ 37 | * createAt 2017/11/29 38 | * description: 深层保护 列表 在这里的账号被查看的时候 会要求输入2次密码才可查看 39 | */ 40 | 41 | public class DeepGuardActivity extends BaseActivity implements View.OnClickListener { 42 | 43 | @Bind(R.id.btnBack) 44 | ImageView btnBack; 45 | @Bind(R.id.btnExplain) 46 | ImageView btnExplain; 47 | @Bind(R.id.recycler) 48 | RecyclerView recycler; 49 | @Bind(R.id.btnAdd) 50 | TextView btnAdd; 51 | private MainAdapter adapter; 52 | private ArrayList datas; 53 | 54 | @Override 55 | protected void onCreate(Bundle savedInstanceState) { 56 | super.onCreate(savedInstanceState); 57 | setContentView(R.layout.activity_deep_guard); 58 | ButterKnife.bind(this); 59 | 60 | initVariables(); 61 | initView(); 62 | initEvent(); 63 | initDatas(); 64 | EventBus.getDefault().register(this); 65 | } 66 | 67 | private void initVariables() { 68 | datas = new ArrayList<>(); 69 | } 70 | 71 | private void initView() { 72 | recycler.setLayoutManager(new LinearLayoutManager(this)); 73 | adapter = new MainAdapter(datas); 74 | 75 | //设置item点击事件 返回选中的应用的名字和图标 76 | adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { 77 | @Override 78 | public void onItemClick(BaseQuickAdapter a, View view, final int position) { 79 | 80 | } 81 | }); 82 | 83 | adapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() { 84 | @Override 85 | public void onItemChildClick(BaseQuickAdapter a, View view, final int position) { 86 | if (view.getId() == R.id.btnDelete){ 87 | IsNoDialog.Builder builder = new IsNoDialog.Builder(); 88 | builder.create(DeepGuardActivity.this, "是否移除,将不再受深层保护!", "否", "是"); 89 | builder.setConfirmButton(new DialogInterface.OnClickListener() { 90 | @Override 91 | public void onClick(DialogInterface dialog, int which) { 92 | // 从深层加密中 去掉 93 | Account account = adapter.getData().get(position); 94 | account.setEncrypt(false); 95 | boolean save = account.save(); 96 | if (save){ 97 | adapter.remove(position); 98 | EventBus.getDefault().post(new UpdataMainListEventbus()); // 更新主界面列表,修改了数据库 需重新从数据库获取最新的记录 99 | }else{ 100 | TastyToast.makeText(getApplicationContext(), "移除失败!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 101 | } 102 | dialog.dismiss(); 103 | } 104 | }); 105 | builder.setCancelButton(new DialogInterface.OnClickListener() { 106 | @Override 107 | public void onClick(DialogInterface dialog, int which) { 108 | dialog.dismiss(); 109 | } 110 | }); 111 | 112 | } 113 | } 114 | }); 115 | recycler.setAdapter(adapter); 116 | } 117 | 118 | 119 | private void initDatas() { 120 | datas.clear(); 121 | List accountList = SQLite.select().from(Account.class).where(Account_Table.isEncrypt.is(true)).queryList(); 122 | adapter.addData(accountList); 123 | adapter.notifyDataSetChanged(); 124 | } 125 | 126 | private void initEvent() { 127 | btnBack.setOnClickListener(this); 128 | btnExplain.setOnClickListener(this); 129 | btnAdd.setOnClickListener(this); 130 | } 131 | 132 | @Override 133 | public void onClick(View v) { 134 | switch (v.getId()) { 135 | case R.id.btnBack: 136 | finish(); 137 | break; 138 | case R.id.btnExplain: 139 | MessageDialogSingle.Builder builder = new MessageDialogSingle.Builder(); 140 | builder.create(this, "查看该列表中的账号信息需二次验证"); 141 | break; 142 | case R.id.btnAdd: 143 | // 添加账号信息到 144 | startActivity(new Intent(this, AddFromAccountActivity.class)); 145 | break; 146 | } 147 | } 148 | public void onEventMainThread(AddFromAccountEventbus event) { 149 | ArrayList lists = event.getLists(); 150 | if (lists.size()>0){ 151 | // 有数据, 提示添加成功 152 | TastyToast.makeText(this, "添加成功", TastyToast.LENGTH_SHORT, TastyToast.SUCCESS); 153 | EventBus.getDefault().post(new UpdataMainListEventbus()); // 更新主界面列表,修改了数据库 需重新从数据库获取最新的记录 154 | } 155 | for (int i = 0; i < lists.size(); i++) { 156 | Account account = lists.get(i); 157 | account.setEncrypt(true); 158 | boolean save = account.save(); 159 | if (save){ 160 | adapter.addData(account); 161 | } 162 | } 163 | adapter.notifyDataSetChanged(); 164 | } 165 | 166 | @Override 167 | protected void onDestroy() { 168 | super.onDestroy(); 169 | EventBus.getDefault().unregister(this); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/main/EnterMainActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.main; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.EditText; 7 | import android.widget.TextView; 8 | 9 | import com.raizlabs.android.dbflow.sql.language.SQLite; 10 | import com.sdsmdg.tastytoast.TastyToast; 11 | import com.yanzhenjie.permission.AndPermission; 12 | import com.yanzhenjie.permission.Permission; 13 | import com.yanzhenjie.permission.PermissionListener; 14 | 15 | import java.util.List; 16 | 17 | import acffo.xqx.accountmanageacffo.MainActivity; 18 | import acffo.xqx.accountmanageacffo.R; 19 | import acffo.xqx.accountmanageacffo.base.activity.AppManager; 20 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 21 | import acffo.xqx.accountmanageacffo.base.database.AdminEntity; 22 | import butterknife.Bind; 23 | import butterknife.ButterKnife; 24 | 25 | /** 26 | * @author xqx 27 | * @email djlxqx@163.com 28 | * blog:http://www.cnblogs.com/xqxacm/ 29 | * createAt 2017/11/28 30 | * description: 输入密码 , 进入应用 31 | */ 32 | 33 | public class EnterMainActivity extends BaseActivity implements View.OnClickListener { 34 | 35 | @Bind(R.id.editPs) 36 | EditText editPs; 37 | @Bind(R.id.btnConfirm) 38 | TextView btnConfirm; 39 | List adminEntities ; 40 | 41 | @Override 42 | protected void onCreate(Bundle savedInstanceState) { 43 | super.onCreate(savedInstanceState); 44 | setContentView(R.layout.activity_enter_main_actiivty); 45 | ButterKnife.bind(this); 46 | initVariables(); 47 | initEvent(); 48 | initPermission(); 49 | } 50 | 51 | private void initVariables() { 52 | // 从数据库中获取到登录密码的记录 53 | adminEntities = SQLite.select().from(AdminEntity.class).queryList(); 54 | if (adminEntities.size()==0){ 55 | // 如果没有设置 56 | startActivity(new Intent(this,SetAdminPsActivity.class)); 57 | AppManager.getAppManager().finishActivity(); 58 | }else if (adminEntities.size()>1){ 59 | // 如果有多个记录 则只留下一个 ,其他的都删掉。当然多个记录的情况一般不存在 60 | for (int i = 1; i < adminEntities.size(); i++) { 61 | adminEntities.get(i).delete(); 62 | } 63 | } 64 | } 65 | 66 | private void initEvent() { 67 | btnConfirm.setOnClickListener(this); 68 | } 69 | 70 | @Override 71 | public void onClick(View v) { 72 | switch (v.getId()){ 73 | case R.id.btnConfirm: 74 | // 完成 75 | if (adminEntities.size()!=0) { 76 | if (adminEntities.get(0).getPassword().equals(editPs.getText().toString())) { 77 | // 成功 , 进入 78 | startActivity(new Intent(this, MainActivity.class)); 79 | AppManager.getAppManager().finishActivity(); 80 | } else { 81 | TastyToast.makeText(getApplicationContext(), "进入失败,密码错误!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 82 | } 83 | }else{ 84 | startActivity(new Intent(this, SetAdminPsActivity.class)); 85 | AppManager.getAppManager().finishActivity(); 86 | } 87 | break; 88 | } 89 | } 90 | 91 | private void initPermission() { 92 | AndPermission.with(this) 93 | .requestCode(100) 94 | .permission( Permission.STORAGE) 95 | .callback(listener) 96 | .start(); 97 | 98 | } 99 | private PermissionListener listener = new PermissionListener() { 100 | @Override 101 | public void onSucceed(int requestCode, List grantedPermissions) { 102 | // 权限申请成功回调。 103 | // 这里的requestCode就是申请时设置的requestCode。 104 | // 和onActivityResult()的requestCode一样,用来区分多个不同的请求。 105 | if(requestCode == 200) { 106 | // TODO ... 107 | } 108 | } 109 | 110 | @Override 111 | public void onFailed(int requestCode, List deniedPermissions) { 112 | // 权限申请失败回调。 113 | if(requestCode == 200) { 114 | // TODO ... 115 | TastyToast.makeText(getApplicationContext(), "拒绝权限可能导致软件使用异常", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 116 | } 117 | } 118 | }; 119 | } 120 | 121 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/main/SetAdminPsActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.main; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.EditText; 7 | import android.widget.TextView; 8 | 9 | import com.sdsmdg.tastytoast.TastyToast; 10 | 11 | import acffo.xqx.accountmanageacffo.R; 12 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 13 | import acffo.xqx.accountmanageacffo.base.database.AdminEntity; 14 | import butterknife.Bind; 15 | import butterknife.ButterKnife; 16 | 17 | /** 18 | * @author xqx 19 | * @email djlxqx@163.com 20 | * blog:http://www.cnblogs.com/xqxacm/ 21 | * createAt 2017/11/28 22 | * description: 设置进入app密码 23 | */ 24 | 25 | public class SetAdminPsActivity extends BaseActivity implements View.OnClickListener { 26 | 27 | @Bind(R.id.editPS) 28 | EditText editPS; 29 | @Bind(R.id.editPsConfirm) 30 | EditText editPsConfirm; 31 | @Bind(R.id.btnConfirm) 32 | TextView btnConfirm; 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_set_admin_ps); 38 | ButterKnife.bind(this); 39 | 40 | initEvent(); 41 | 42 | } 43 | 44 | private void initEvent() { 45 | btnConfirm.setOnClickListener(this); 46 | } 47 | 48 | @Override 49 | public void onClick(View v) { 50 | switch (v.getId()){ 51 | case R.id.btnConfirm: 52 | // 完成 53 | if (editPS.getText().toString().equals("")){ 54 | TastyToast.makeText(getApplicationContext(), "请填写密码", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 55 | return ; 56 | } 57 | if (editPS.getText().toString().length()<8){ 58 | TastyToast.makeText(getApplicationContext(), "请输入至少8位密码", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 59 | return ; 60 | } 61 | if (editPsConfirm.getText().toString().equals("")){ 62 | TastyToast.makeText(getApplicationContext(), "请填写确认密码", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 63 | return; 64 | } 65 | if (!editPS.getText().toString().equals(editPsConfirm.getText().toString())){ 66 | // 两个密码不一致 67 | TastyToast.makeText(getApplicationContext(), "密码不一致!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 68 | return; 69 | } 70 | AdminEntity adminEntity = new AdminEntity(); 71 | adminEntity.setPassword(editPsConfirm.getText().toString()); 72 | boolean save = adminEntity.save(); 73 | if (save){ 74 | startActivity(new Intent(this,EnterMainActivity.class)); 75 | finish(); 76 | }else{ 77 | TastyToast.makeText(getApplicationContext(), "设置失败!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 78 | } 79 | break; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/main/SetDeepGuardPSActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.main; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.widget.EditText; 6 | import android.widget.TextView; 7 | 8 | import com.raizlabs.android.dbflow.sql.language.SQLite; 9 | import com.sdsmdg.tastytoast.TastyToast; 10 | 11 | import java.util.List; 12 | 13 | import acffo.xqx.accountmanageacffo.R; 14 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 15 | import acffo.xqx.accountmanageacffo.base.database.DeepGuardEntity; 16 | import butterknife.Bind; 17 | import butterknife.ButterKnife; 18 | 19 | public class SetDeepGuardPSActivity extends BaseActivity implements View.OnClickListener { 20 | 21 | 22 | @Bind(R.id.editPS) 23 | EditText editPS; 24 | @Bind(R.id.editPsConfirm) 25 | EditText editPsConfirm; 26 | @Bind(R.id.btnConfirm) 27 | TextView btnConfirm; 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | setContentView(R.layout.activity_set_deep_guard_ps); 33 | ButterKnife.bind(this); 34 | 35 | // 进到这个界面 说明当前没有设置 深层保护密码 即 DeepGuardDB数据库中没有数据 36 | // 不过以防万一 ,这里还是要清空一下数据库中的所有记录 37 | List deepGuardPs = SQLite.select().from(DeepGuardEntity.class).queryList(); 38 | for (int i = 0; i < deepGuardPs.size(); i++) { 39 | deepGuardPs.get(i).delete(); 40 | } 41 | initEvent(); 42 | } 43 | 44 | private void initEvent() { 45 | btnConfirm.setOnClickListener(this); 46 | } 47 | 48 | @Override 49 | public void onClick(View v) { 50 | switch (v.getId()){ 51 | case R.id.btnConfirm: 52 | // 完成 53 | if (editPS.getText().toString().equals("")){ 54 | TastyToast.makeText(getApplicationContext(), "请填写密码", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 55 | return ; 56 | } 57 | if (editPS.getText().toString().length()<8){ 58 | TastyToast.makeText(getApplicationContext(), "请输入至少8位密码", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 59 | return ; 60 | } 61 | if (editPsConfirm.getText().toString().equals("")){ 62 | TastyToast.makeText(getApplicationContext(), "请填写确认密码", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 63 | return; 64 | } 65 | if (!editPS.getText().toString().equals(editPsConfirm.getText().toString())){ 66 | // 两个密码不一致 67 | TastyToast.makeText(getApplicationContext(), "密码不一致!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 68 | return; 69 | } 70 | DeepGuardEntity deepGuardEntity = new DeepGuardEntity(); 71 | deepGuardEntity.setPassword(editPsConfirm.getText().toString()); 72 | boolean save = deepGuardEntity.save(); 73 | if (save){ 74 | TastyToast.makeText(getApplicationContext(), "设置成功,请牢记密码!", TastyToast.LENGTH_SHORT, TastyToast.SUCCESS); 75 | finish(); 76 | }else{ 77 | TastyToast.makeText(getApplicationContext(), "设置失败!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 78 | } 79 | break; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/main/SettingActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.main; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.ImageView; 7 | import android.widget.RelativeLayout; 8 | 9 | import com.raizlabs.android.dbflow.sql.language.SQLite; 10 | import com.sdsmdg.tastytoast.TastyToast; 11 | 12 | import java.util.List; 13 | 14 | import acffo.xqx.accountmanageacffo.R; 15 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 16 | import acffo.xqx.accountmanageacffo.base.database.DeepGuardEntity; 17 | import acffo.xqx.accountmanageacffo.base.dialog.DeepGuardValidationSettingDialog; 18 | import acffo.xqx.accountmanageacffo.base.dialog.ResetPsDialog; 19 | import acffo.xqx.accountmanageacffo.base.utils.AlipayUtil; 20 | import butterknife.Bind; 21 | import butterknife.ButterKnife; 22 | 23 | /** 24 | * @author xqx 25 | * @email djlxqx@163.com 26 | * blog:http://www.cnblogs.com/xqxacm/ 27 | * createAt 2017/11/29 28 | * description: 设置界面 29 | */ 30 | 31 | public class SettingActivity extends BaseActivity implements View.OnClickListener { 32 | 33 | @Bind(R.id.btnBack) 34 | ImageView btnBack; // 后退 35 | @Bind(R.id.btnSetAdminPs) 36 | RelativeLayout btnSetAdminPs; // 修改登录密码 37 | @Bind(R.id.btnAbout) 38 | RelativeLayout btnAbout; // 关于作者 39 | @Bind(R.id.btnArk) 40 | RelativeLayout btnArk; 41 | @Bind(R.id.btnSetDeepGuardPs) 42 | RelativeLayout btnSetDeepGuardPs; // 修改深层保护密码 43 | List deepGuardPs;// 深层保护数据库中密码 44 | @Bind(R.id.btnM) 45 | RelativeLayout btnM; 46 | 47 | @Override 48 | protected void onCreate(Bundle savedInstanceState) { 49 | super.onCreate(savedInstanceState); 50 | setContentView(R.layout.activity_setting); 51 | ButterKnife.bind(this); 52 | deepGuardPs = SQLite.select().from(DeepGuardEntity.class).queryList(); 53 | initEvent(); 54 | } 55 | 56 | private void initEvent() { 57 | btnBack.setOnClickListener(this); 58 | btnSetAdminPs.setOnClickListener(this); 59 | btnAbout.setOnClickListener(this); 60 | btnArk.setOnClickListener(this); 61 | btnSetDeepGuardPs.setOnClickListener(this); 62 | btnM.setOnClickListener(this); 63 | } 64 | 65 | @Override 66 | protected void onStart() { 67 | super.onStart(); 68 | deepGuardPs.clear(); 69 | deepGuardPs = SQLite.select().from(DeepGuardEntity.class).queryList(); 70 | } 71 | 72 | @Override 73 | public void onClick(View v) { 74 | switch (v.getId()) { 75 | case R.id.btnBack: 76 | finish(); 77 | break; 78 | case R.id.btnSetAdminPs: 79 | // 修改密码 80 | ResetPsDialog.Builder builder = new ResetPsDialog.Builder(); 81 | builder.create(this); 82 | break; 83 | case R.id.btnArk: 84 | // 深层保护 85 | if (deepGuardPs.size() == 0) { 86 | // 如果没有设置 87 | TastyToast.makeText(this, "未设置深层保护密码,请先设置!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 88 | startActivity(new Intent(this, SetDeepGuardPSActivity.class)); 89 | return; 90 | } else if (deepGuardPs.size() > 1) { 91 | for (int i = 1; i < deepGuardPs.size(); i++) { 92 | deepGuardPs.get(i).delete(); 93 | } 94 | } 95 | DeepGuardValidationSettingDialog.Builder deepGuardbuilder = new DeepGuardValidationSettingDialog.Builder(); 96 | deepGuardbuilder.create(this, 1); // 1、代表进入深层保护列表 2、代表修改深层保护密码 97 | break; 98 | case R.id.btnAbout: 99 | // 关于作者 100 | startActivity(new Intent(this, AboutActivity.class)); 101 | break; 102 | case R.id.btnSetDeepGuardPs: 103 | // 修改深层保护密码 104 | if (deepGuardPs.size() == 0) { 105 | // 如果没有设置 106 | TastyToast.makeText(this, "未设置深层保护密码,请先设置!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 107 | startActivity(new Intent(this, SetDeepGuardPSActivity.class)); 108 | return; 109 | } else if (deepGuardPs.size() > 1) { 110 | for (int i = 1; i < deepGuardPs.size(); i++) { 111 | deepGuardPs.get(i).delete(); 112 | } 113 | } 114 | DeepGuardValidationSettingDialog.Builder deepGuardbuilderReset = new DeepGuardValidationSettingDialog.Builder(); 115 | deepGuardbuilderReset.create(this, 2);// 1、代表进入深层保护列表 2、代表修改深层保护密码 116 | break; 117 | case R.id.btnM: 118 | if (AlipayUtil.hasInstalledAlipayClient(this)){ 119 | AlipayUtil.startAlipayClient(this,"FKX01450PAGAZKMGVIK3FA"); 120 | }else{ 121 | TastyToast.makeText(this, "未检测到支付宝,无法实现打赏功能", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 122 | } 123 | break; 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /app/src/main/java/acffo/xqx/accountmanageacffo/ui/search/SearchActivity.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo.ui.search; 2 | 3 | import android.content.DialogInterface; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.View; 9 | import android.widget.EditText; 10 | import android.widget.ImageView; 11 | 12 | import com.chad.library.adapter.base.BaseQuickAdapter; 13 | import com.raizlabs.android.dbflow.sql.language.SQLite; 14 | import com.sdsmdg.tastytoast.TastyToast; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | import acffo.xqx.accountmanageacffo.MainActivity; 20 | import acffo.xqx.accountmanageacffo.MainAdapter; 21 | import acffo.xqx.accountmanageacffo.R; 22 | import acffo.xqx.accountmanageacffo.base.activity.BaseActivity; 23 | import acffo.xqx.accountmanageacffo.base.database.Account; 24 | import acffo.xqx.accountmanageacffo.base.database.Account_Table; 25 | import acffo.xqx.accountmanageacffo.base.database.DeepGuardEntity; 26 | import acffo.xqx.accountmanageacffo.base.dialog.AccountInfoDialog; 27 | import acffo.xqx.accountmanageacffo.base.dialog.DeepGuardValidationMainDialog; 28 | import acffo.xqx.accountmanageacffo.base.dialog.IsNoDialog; 29 | import acffo.xqx.accountmanageacffo.ui.main.SetDeepGuardPSActivity; 30 | import butterknife.Bind; 31 | import butterknife.ButterKnife; 32 | 33 | /** 34 | * @author xqx 35 | * @email djlxqx@163.com 36 | * blog:http://www.cnblogs.com/xqxacm/ 37 | * createAt 2017/12/21 38 | * description: 查询功能 39 | */ 40 | public class SearchActivity extends BaseActivity implements View.OnClickListener { 41 | 42 | @Bind(R.id.editSearch) 43 | EditText editSearch; 44 | @Bind(R.id.btnSearch) 45 | ImageView btnSearch; 46 | @Bind(R.id.recycler) 47 | RecyclerView recycler; 48 | 49 | private ArrayList datas; 50 | private MainAdapter adapter; 51 | 52 | @Override 53 | protected void onCreate(Bundle savedInstanceState) { 54 | super.onCreate(savedInstanceState); 55 | setContentView(R.layout.activity_search); 56 | ButterKnife.bind(this); 57 | initVariables(); 58 | initView(); 59 | initEvent(); 60 | } 61 | 62 | private void initEvent() { 63 | btnSearch.setOnClickListener(this); 64 | } 65 | 66 | private void initVariables() { 67 | datas = new ArrayList<>(); 68 | } 69 | 70 | private void initView() { 71 | 72 | recycler.setLayoutManager(new LinearLayoutManager(this)); 73 | adapter = new MainAdapter(datas); 74 | 75 | //设置item点击事件 返回选中的应用的名字和图标 76 | adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { 77 | @Override 78 | public void onItemClick(BaseQuickAdapter a, View view, final int position) { 79 | 80 | if (adapter.getData().get(position).isEncrypt()) { 81 | // 该账号信息在深层保护列表里 需要 验证深层保护的密码 82 | // 判断是否设置了,没有则先设置 83 | 84 | List deepGuardPs = SQLite.select().from(DeepGuardEntity.class).queryList(); 85 | if (deepGuardPs.size() == 0) { 86 | TastyToast.makeText(SearchActivity.this, "未设置深层保护密码,请先设置!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 87 | startActivity(new Intent(SearchActivity.this, SetDeepGuardPSActivity.class)); 88 | return; 89 | } 90 | DeepGuardValidationMainDialog.Builder deepGuardBuilder = new DeepGuardValidationMainDialog.Builder(); 91 | deepGuardBuilder.create(SearchActivity.this, adapter.getData().get(position)); 92 | } else { 93 | // 该账号信息不再深层保护列表里 ,直接打开 94 | final AccountInfoDialog.Builder builder = new AccountInfoDialog.Builder(); 95 | builder.create(SearchActivity.this, adapter.getItem(position)); 96 | /** 97 | * 编辑 98 | */ 99 | builder.setEdit(new DialogInterface.OnClickListener() { 100 | @Override 101 | public void onClick(DialogInterface d, int which) { 102 | builder.setEnableEdit(); 103 | } 104 | }); 105 | } 106 | } 107 | }); 108 | 109 | adapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() { 110 | @Override 111 | public void onItemChildClick(BaseQuickAdapter a, View view, final int position) { 112 | if (view.getId() == R.id.btnDelete) { 113 | //删除按钮 114 | IsNoDialog.Builder builder = new IsNoDialog.Builder(); 115 | builder.create(SearchActivity.this, "是否删除", "否", "是"); 116 | builder.setConfirmButton(new DialogInterface.OnClickListener() { 117 | @Override 118 | public void onClick(DialogInterface dialog, int which) { 119 | boolean delete = adapter.getData().get(position).delete(); 120 | if (delete) { 121 | // 删除成功 122 | adapter.remove(position); 123 | TastyToast.makeText(getApplicationContext(), "删除成功!", TastyToast.LENGTH_SHORT, TastyToast.SUCCESS); 124 | } else { 125 | // 删除失败 126 | TastyToast.makeText(getApplicationContext(), "删除失败!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 127 | 128 | } 129 | dialog.dismiss(); 130 | } 131 | }); 132 | builder.setCancelButton(new DialogInterface.OnClickListener() { 133 | @Override 134 | public void onClick(DialogInterface dialog, int which) { 135 | dialog.dismiss(); 136 | } 137 | }); 138 | } 139 | } 140 | }); 141 | recycler.setAdapter(adapter); 142 | } 143 | 144 | @Override 145 | public void onClick(View v) { 146 | switch (v.getId()){ 147 | case R.id.btnSearch: 148 | if (editSearch.getText().toString().equals("")){ 149 | TastyToast.makeText(getApplicationContext(), "请输入查询内容!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 150 | return; 151 | } 152 | searchDatas(editSearch.getText().toString()); 153 | break; 154 | } 155 | } 156 | 157 | /** 158 | * 根据内容查询数据 159 | * @param content 160 | */ 161 | private void searchDatas(String content) { 162 | datas.clear(); 163 | List accountList = SQLite.select().from(Account.class).where(Account_Table.title.like(content)).queryList(); 164 | adapter.addData(accountList); 165 | adapter.notifyDataSetChanged(); 166 | if (adapter.getData().size()==0){ 167 | TastyToast.makeText(getApplicationContext(), "无符合条件的结果!", TastyToast.LENGTH_SHORT, TastyToast.CONFUSING); 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_account1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 32 | 33 | 34 | 38 | 39 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_app_noimg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_btn_over.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_concern_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_edit_admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_logout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_popup_more.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/drawable/bg_popup_more.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_corner_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_corner_bg_bottom_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_corner_bg_bottom_oranger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edittextbg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edittextline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/label_copy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/label_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 22 | 23 | 31 | 32 | 33 | 37 | 38 | 41 | 42 | 49 | 50 | 57 | 58 | 66 | 79 | 80 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 18 | 19 | 23 | 24 | 32 | 33 | 41 | 59 | 60 | 77 | 78 | 79 | 80 | 81 | 94 | 95 | 109 | 117 | 118 | 119 | 131 | 132 | 146 | 154 | 155 | 156 | 168 | 169 | 183 | 191 | 192 | 193 | 194 | 195 | 198 | 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_from_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 24 | 25 | 33 | 34 | 46 | 47 | 51 | 52 | 53 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_deep_guard.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 24 | 25 | 33 | 34 | 43 | 44 | 45 | 49 | 50 | 56 | 57 | 58 | 72 | 73 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_enter_main_actiivty.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 18 | 26 | 1 27 | 28 | 32 | 33 | 47 | 48 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 25 | 26 | 39 | 48 | 49 | 53 | 63 | 70 | 78 | 79 | 82 | 88 | 89 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 15 | 30 | 39 | 40 | 41 | 46 | 47 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_select_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 22 | 23 | 31 | 32 | 36 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_set_admin_ps.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 24 | 25 | 26 | 31 | 46 | 47 | 61 | 62 | 63 | 73 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_set_deep_guard_ps.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 24 | 25 | 26 | 31 | 46 | 47 | 61 | 62 | 63 | 73 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 23 | 24 | 32 | 33 | 37 | 38 | 43 | 50 | 51 | 60 | 61 | 67 | 68 | 73 | 80 | 81 | 90 | 91 | 97 | 98 | 99 | 104 | 111 | 112 | 121 | 122 | 126 | 127 | 132 | 139 | 140 | 149 | 150 | 156 | 157 | 158 | 163 | 170 | 171 | 180 | 181 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_deepguardvalidation.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 12 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 46 | 47 | 60 | 61 | 74 | 82 | 83 | 84 | 85 | 86 | 87 | 95 | 110 | 111 | 112 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_is_no.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 16 | 29 | 30 | 31 | 39 | 54 | 55 | 56 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_message_singleline.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 21 | 22 | 23 | 36 | 37 | 38 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_resetps.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 12 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 46 | 47 | 60 | 61 | 74 | 82 | 83 | 84 | 85 | 86 | 87 | 95 | 110 | 111 | 112 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 30 | 31 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_from_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 34 | 35 | 44 | 54 | 62 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 31 | 32 | 41 | 49 | 50 | 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout/popup_sort.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 23 | 24 | 33 | 34 | 43 | 44 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_about.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_account.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_add.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_app.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_back.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_back_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_back_white.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_deep_ps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_deep_ps.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_delete.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_explain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_explain.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_lock.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_menu.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_mlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_mlock.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_money.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_p_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_p_cancel.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_password.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_search.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_select.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_selected.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_setting.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_setting_explain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_setting_explain.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-hdpi/icon_unselected.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #e2e2e2 4 | #e2e2e2 5 | #30c5ff 6 | 7 | #30c5ff 8 | #fcaa3c 9 | 10 | #fff 11 | #000 12 | #00000000 13 | 14 | #f8e2b3 15 | 16 | #ffa28d 17 | #e2201a 18 | #fdbf01 19 | #de525c 20 | #00b050 21 | #00b0f0 22 | #82ce34 23 | 24 | #f2f2f2 25 | #e2e2e2 26 | #6e7678 27 | #5d5d5d 28 | #3d3d3d 29 | #626262 30 | #faf9f9 31 | #91a4c1 32 | 33 | #009dd9 34 | #91a4c1 35 | #60c2e8 36 | #4ab8e9 37 | 38 | #f5f5f5 39 | #444 40 | #666 41 | #888 42 | #999 43 | #a3a7b6 44 | #cfd5da 45 | #00aaff 46 | #66cfd5da 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 0.5dp 7 | 1dp 8 | 2dp 9 | 4dp 10 | 6dp 11 | 8dp 12 | 10dp 13 | 12dp 14 | 14dp 15 | 15dp 16 | 16dp 17 | 18dp 18 | 20dp 19 | 22dp 20 | 24dp 21 | 26dp 22 | 28dp 23 | 30dp 24 | 32dp 25 | 34dp 26 | 36dp 27 | 38dp 28 | 40dp 29 | 42dp 30 | 44dp 31 | 46dp 32 | 48dp 33 | 50dp 34 | 52dp 35 | 36 | 37 | 8sp 38 | 10sp 39 | 12sp 40 | 14sp 41 | 16sp 42 | 18sp 43 | 20sp 44 | 22sp 45 | 24sp 46 | 26sp 47 | 28sp 48 | 30sp 49 | 32sp 50 | 34sp 51 | 36sp 52 | 38sp 53 | 40sp 54 | 42sp 55 | 44sp 56 | 46sp 57 | 48sp 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 账号密橱 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 17 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/test/java/acffo/xqx/accountmanageacffo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package acffo.xqx.accountmanageacffo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.2' 9 | classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | maven { url "https://jitpack.io" } 20 | 21 | } 22 | } 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } 27 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /screenshots/a1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/a1.png -------------------------------------------------------------------------------- /screenshots/aa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/aa.png -------------------------------------------------------------------------------- /screenshots/b1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/b1.png -------------------------------------------------------------------------------- /screenshots/bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/bb.png -------------------------------------------------------------------------------- /screenshots/c1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/c1.png -------------------------------------------------------------------------------- /screenshots/cc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/cc.png -------------------------------------------------------------------------------- /screenshots/d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/d1.png -------------------------------------------------------------------------------- /screenshots/dd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BestCoderXQX/AccountManage/cc50ed4f4aee481c1aa4b3dac2cfe13d8e16471f/screenshots/dd.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------