├── .idea
├── .name
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── inspectionProfiles
│ ├── profiles_settings.xml
│ └── Project_Default.xml
├── dictionaries
│ └── ND88.xml
├── modules.xml
├── runConfigurations.xml
├── compiler.xml
├── gradle.xml
└── misc.xml
├── settings.gradle
├── app
├── .gitignore
├── release
│ └── OreoWiFiPasswords.apk
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── intro_cab.png
│ │ │ │ ├── intro_app_icon.png
│ │ │ │ ├── intro_disclaimer.png
│ │ │ │ ├── intro_quick_copy.png
│ │ │ │ ├── intro_thank_you.png
│ │ │ │ ├── intro_root_permission.png
│ │ │ │ ├── scrollbar_thumb.xml
│ │ │ │ ├── highlight_selected.xml
│ │ │ │ └── highlight_selected_dark.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── ic_action_done.png
│ │ │ │ ├── ic_action_tag.png
│ │ │ │ ├── ic_backspace.png
│ │ │ │ ├── ic_action_reload.png
│ │ │ │ ├── ic_action_share.png
│ │ │ │ ├── ic_gesture_drag.png
│ │ │ │ ├── ic_action_context_tag.png
│ │ │ │ ├── ic_action_context_top.png
│ │ │ │ ├── ic_action_search_open.png
│ │ │ │ ├── ic_action_context_copy.png
│ │ │ │ ├── ic_action_context_delete.png
│ │ │ │ └── ic_action_search_close.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── ic_action_done.png
│ │ │ │ ├── ic_action_tag.png
│ │ │ │ ├── ic_backspace.png
│ │ │ │ ├── ic_action_reload.png
│ │ │ │ ├── ic_action_share.png
│ │ │ │ ├── ic_gesture_drag.png
│ │ │ │ ├── ic_action_context_tag.png
│ │ │ │ ├── ic_action_context_top.png
│ │ │ │ ├── ic_action_search_open.png
│ │ │ │ ├── ic_action_context_copy.png
│ │ │ │ ├── ic_action_context_delete.png
│ │ │ │ └── ic_action_search_close.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── ic_action_tag.png
│ │ │ │ ├── ic_backspace.png
│ │ │ │ ├── ic_action_done.png
│ │ │ │ ├── ic_action_share.png
│ │ │ │ ├── ic_gesture_drag.png
│ │ │ │ ├── ic_action_reload.png
│ │ │ │ ├── ic_action_context_copy.png
│ │ │ │ ├── ic_action_context_tag.png
│ │ │ │ ├── ic_action_context_top.png
│ │ │ │ ├── ic_action_search_close.png
│ │ │ │ ├── ic_action_search_open.png
│ │ │ │ └── ic_action_context_delete.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── ic_backspace.png
│ │ │ │ ├── ic_action_done.png
│ │ │ │ ├── ic_action_tag.png
│ │ │ │ ├── ic_action_reload.png
│ │ │ │ ├── ic_action_share.png
│ │ │ │ ├── ic_gesture_drag.png
│ │ │ │ ├── ic_action_context_copy.png
│ │ │ │ ├── ic_action_context_tag.png
│ │ │ │ ├── ic_action_context_top.png
│ │ │ │ ├── ic_action_search_close.png
│ │ │ │ ├── ic_action_search_open.png
│ │ │ │ └── ic_action_context_delete.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── ic_action_tag.png
│ │ │ │ ├── ic_backspace.png
│ │ │ │ ├── ic_action_done.png
│ │ │ │ ├── ic_action_reload.png
│ │ │ │ ├── ic_action_share.png
│ │ │ │ ├── ic_gesture_drag.png
│ │ │ │ ├── ic_action_context_tag.png
│ │ │ │ ├── ic_action_context_top.png
│ │ │ │ ├── ic_action_search_open.png
│ │ │ │ ├── ic_action_context_copy.png
│ │ │ │ ├── ic_action_search_close.png
│ │ │ │ └── ic_action_context_delete.png
│ │ │ ├── anim
│ │ │ │ ├── layout_left_to_right_slide.xml
│ │ │ │ ├── activity_slide_in_up.xml
│ │ │ │ ├── dialog_slide_in_bottom.xml
│ │ │ │ ├── dialog_slide_out_bottom.xml
│ │ │ │ ├── activity_slide_out_down.xml
│ │ │ │ ├── left_in.xml
│ │ │ │ ├── left_out.xml
│ │ │ │ ├── right_in.xml
│ │ │ │ ├── right_out.xml
│ │ │ │ ├── slide_right.xml
│ │ │ │ ├── shake.xml
│ │ │ │ ├── scale_from_top_right_corner.xml
│ │ │ │ ├── scale_to_top_right_corner.xml
│ │ │ │ ├── simple_grow.xml
│ │ │ │ ├── shrink_and_fold_out.xml
│ │ │ │ └── shrink_and_fold_in.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── menu
│ │ │ │ ├── menu_settings.xml
│ │ │ │ ├── menu_context_archive.xml
│ │ │ │ ├── menu_main.xml
│ │ │ │ ├── menu_context.xml
│ │ │ │ └── menu_wifi_list_fragment.xml
│ │ │ ├── values-v21
│ │ │ │ └── styles.xml
│ │ │ ├── values
│ │ │ │ ├── integers.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── strings.xml
│ │ │ ├── drawable-v21
│ │ │ │ ├── highlight_selected.xml
│ │ │ │ └── highlight_selected_dark.xml
│ │ │ ├── layout
│ │ │ │ ├── app_bar.xml
│ │ │ │ ├── activity_settings.xml
│ │ │ │ ├── dialog_share_warning.xml
│ │ │ │ ├── fragment_wifi_list.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── dialog_input.xml
│ │ │ │ ├── wifi_entry_row.xml
│ │ │ │ └── dialog_about.xml
│ │ │ ├── transition
│ │ │ │ ├── activity_slide_left.xml
│ │ │ │ └── activity_slide_right.xml
│ │ │ └── xml
│ │ │ │ └── preferences.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── pithsoftware
│ │ │ │ └── wifipasswords
│ │ │ │ ├── dialogs
│ │ │ │ ├── CustomAlertDialogListener.java
│ │ │ │ ├── InputDialogListener.java
│ │ │ │ ├── CustomAlertDialogFragment.java
│ │ │ │ ├── AboutDialogFragment.java
│ │ │ │ └── InputDialogFragment.java
│ │ │ │ ├── recycler
│ │ │ │ ├── ItemDragListener.java
│ │ │ │ ├── ItemTouchHelperAdapter.java
│ │ │ │ ├── WifiListLoadedListener.java
│ │ │ │ ├── MyTouchHelperCallback.java
│ │ │ │ ├── RecyclerTouchListener.java
│ │ │ │ └── WifiListAdapter.java
│ │ │ │ ├── extras
│ │ │ │ ├── RequestCodes.java
│ │ │ │ ├── RootCheck.java
│ │ │ │ ├── FlingBehavior.java
│ │ │ │ ├── ScrollAwareFABBehavior.java
│ │ │ │ ├── AutoUpdateList.java
│ │ │ │ ├── MyApplication.java
│ │ │ │ └── AppCompatPreferenceActivity.java
│ │ │ │ ├── activities
│ │ │ │ ├── IntroActivity.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── SettingsActivity.java
│ │ │ │ ├── pojo
│ │ │ │ └── WifiEntry.java
│ │ │ │ └── database
│ │ │ │ └── PasswordDB.java
│ │ └── AndroidManifest.xml
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── pithsoftware
│ │ └── wifipasswords
│ │ └── ApplicationTest.java
├── proguard-rules.pro
├── build.gradle
└── app.iml
├── list-dark.png
├── list-new.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── RootShell-1.6-release
├── build.gradle
├── RootShell-1.6-release.aar
└── RootShell-1.6-release.iml
├── .gitignore
├── gradle.properties
├── WifiPasswords.iml
├── gradlew.bat
├── README.md
└── gradlew
/.idea/.name:
--------------------------------------------------------------------------------
1 | WifiPasswords
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':RootShell-1.6-release'
2 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /gradle.properties
3 | /fabric.properties
4 | /*.apk
5 |
--------------------------------------------------------------------------------
/list-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/list-dark.png
--------------------------------------------------------------------------------
/list-new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/list-new.png
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/release/OreoWiFiPasswords.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/release/OreoWiFiPasswords.apk
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/RootShell-1.6-release/build.gradle:
--------------------------------------------------------------------------------
1 | configurations.maybeCreate("default")
2 | artifacts.add("default", file('RootShell-1.6-release.aar'))
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_cab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable/intro_cab.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 | app/release/
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable/intro_app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_disclaimer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable/intro_disclaimer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_quick_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable/intro_quick_copy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_thank_you.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable/intro_thank_you.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/RootShell-1.6-release/RootShell-1.6-release.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/RootShell-1.6-release/RootShell-1.6-release.aar
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_done.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_backspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_backspace.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_done.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_backspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_backspace.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_backspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_backspace.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_backspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_backspace.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_reload.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_gesture_drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_gesture_drag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_reload.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_gesture_drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_gesture_drag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_done.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_gesture_drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_gesture_drag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_done.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_backspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_backspace.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_root_permission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable/intro_root_permission.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_reload.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_reload.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_gesture_drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_gesture_drag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_done.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_reload.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_gesture_drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_gesture_drag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_context_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_context_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_context_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_context_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_search_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_search_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_context_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_context_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_context_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_context_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_search_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_search_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_context_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_context_copy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_context_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_context_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_search_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-hdpi/ic_action_search_close.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_context_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_context_copy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_context_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_context_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_search_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-mdpi/ic_action_search_close.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_context_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_context_copy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_context_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_context_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_context_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_context_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_search_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_search_close.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_search_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_search_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_context_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_context_copy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_context_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_context_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_context_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_context_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_search_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_search_close.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_search_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_search_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_context_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_context_tag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_context_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_context_top.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_search_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_search_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_context_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xhdpi/ic_action_context_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_context_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_context_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_context_copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_context_copy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_search_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_search_close.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_context_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Mawer/OreoWifiPasswords/HEAD/app/src/main/res/drawable-xxxhdpi/ic_action_context_delete.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/layout_left_to_right_slide.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/dialogs/CustomAlertDialogListener.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.dialogs;
2 |
3 |
4 | public interface CustomAlertDialogListener {
5 |
6 | void showPathErrorDialog();
7 |
8 | void showRootErrorDialog();
9 | }
10 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Nov 20 22:11:43 CAT 2017
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-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/recycler/ItemDragListener.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.recycler;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 |
5 | public interface ItemDragListener {
6 |
7 | void onStartDrag(RecyclerView.ViewHolder viewHolder);
8 | }
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scrollbar_thumb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/dictionaries/ND88.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | appbar
5 | crashlytics
6 | glitchy
7 | passcode
8 | snackbar
9 | ssid
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/activity_slide_in_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/dialog_slide_in_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/dialog_slide_out_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/activity_slide_out_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/left_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/recycler/ItemTouchHelperAdapter.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.recycler;
2 |
3 | import com.pithsoftware.wifipasswords.pojo.WifiEntry;
4 |
5 | public interface ItemTouchHelperAdapter {
6 |
7 | boolean onItemMove(int fromPosition, int toPosition);
8 |
9 | WifiEntry onItemDismiss(int position);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/recycler/WifiListLoadedListener.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.recycler;
2 |
3 | import com.pithsoftware.wifipasswords.pojo.WifiEntry;
4 |
5 | import java.util.ArrayList;
6 |
7 | public interface WifiListLoadedListener {
8 |
9 | public void onWifiListLoaded(ArrayList listWifi, int numOfEntries, boolean resetDB);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/shake.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_from_top_right_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_to_top_right_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 200
6 | 350
7 | 350
8 | 350
9 | -1500
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/dialogs/InputDialogListener.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.dialogs;
2 |
3 |
4 | import com.pithsoftware.wifipasswords.pojo.WifiEntry;
5 |
6 | import java.util.ArrayList;
7 |
8 | public interface InputDialogListener {
9 |
10 | void onSubmitAddDialog(String title, String password);
11 |
12 | void onSubmitTagDialog(String tag, ArrayList listWifi, ArrayList positions);
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/highlight_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/pithsoftware/wifipasswords/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/highlight_selected_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/simple_grow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_context_archive.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/highlight_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 | -
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/highlight_selected_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 | -
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
15 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/shrink_and_fold_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/shrink_and_fold_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
24 |
25 |
--------------------------------------------------------------------------------
/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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/RequestCodes.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 |
4 | public class RequestCodes {
5 |
6 | public static final int ACTIVITY_INTRO_CODE = 30;
7 | public static final int ACTIVITY_SETTINGS_CODE = 42;
8 |
9 | public static final int SETTINGS_PATH_ERROR_CODE = 50;
10 |
11 | public static final int DIALOG_PATH_ERROR_CODE = 51;
12 | public static final int DIALOG_LOAD_WARNING_CODE = 52;
13 | public static final int DIALOG_ADD_CODE = 53;
14 | public static final int DIALOG_TAG_CODE = 54;
15 |
16 | public static final int DIALOG_CANCEL = 98;
17 | public static final int DIALOG_CONFIRM = 99;
18 |
19 | public static final int HIDE_PASS = 996;
20 | public static final int DARK_THEME = 997;
21 | public static final int SHOW_NO_PASSWORD_CODE = 998;
22 | public static final int RESET_TO_DEFAULT = 999;
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/WifiPasswords.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/transition/activity_slide_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/transition/activity_slide_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/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 D:\Android\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 | -keep class android.support.v7.widget.SearchView { *; }
19 | -dontwarn java.lang.invoke.*
20 | -keep class butterknife.** { *; }
21 | -dontwarn butterknife.internal.**
22 | -keep class **$$ViewBinder { *; }
23 |
24 | -keepclasseswithmembernames class * {
25 | @butterknife.* ;
26 | }
27 |
28 | -keepclasseswithmembernames class * {
29 | @butterknife.* ;
30 | }
31 |
32 | -keepattributes SourceFile,LineNumberTable
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #1976D2
6 | #1565C0
7 | #BBDEFB
8 | #FF9800
9 | #B6B6B6
10 | #212121
11 | #727272
12 | #B6B6B6
13 |
14 | #0d47a1
15 | #f44336
16 | #BDBDBD
17 | #000000
18 | #FFFFFF
19 |
20 |
21 | #212121
22 | #000000
23 | #303030
24 | #424242
25 | #d50000
26 | #FFFFFF
27 | #727272
28 |
29 |
--------------------------------------------------------------------------------
/RootShell-1.6-release/RootShell-1.6-release.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 24dp
7 | 0dp
8 | 8dp
9 |
10 | 16dp
11 | 4dp
12 | 8dp
13 | 16sp
14 | 14sp
15 | 72dp
16 |
17 | 16dp
18 | 16dp
19 | 4dp
20 |
21 | 50dp
22 | 4dp
23 | 4dp
24 | 4dp
25 | 4dp
26 | 4dp
27 | 10dp
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_share_warning.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
23 |
24 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wifi_list.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/RootCheck.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 | import android.util.Log;
4 |
5 | import com.stericson.RootShell.RootShell;
6 |
7 | public class RootCheck {
8 |
9 | private static final String TAG = "ROOT";
10 |
11 | /***********************************************************************/
12 | //Root Check method
13 | //Credit: http://muzikant-android.blogspot.co.il/2011/02/how-to-get-root-access-and-execute.html
14 | /***********************************************************************/
15 | public static boolean canRunRootCommands() {
16 | boolean retval;
17 |
18 | try {
19 | if (!RootShell.isRootAvailable()) {
20 | retval = false;
21 | Log.d(TAG, "Can't get root access or denied by user");
22 | } else if (RootShell.isAccessGiven()) {
23 | retval = true;
24 | Log.d(TAG, "Root access granted");
25 | } else {
26 | retval = false;
27 | Log.d(TAG, "Root access rejected");
28 | }
29 | } catch (Exception e) {
30 | // Can't get root !
31 | // Probably broken pipe exception on trying to write to output stream (os) after su failed, meaning that the device is not rooted
32 |
33 | retval = false;
34 | Log.d(TAG, "Root access rejected [" + e.getClass().getName() + "] : " + e.getMessage());
35 | }
36 |
37 | return retval;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/recycler/MyTouchHelperCallback.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.recycler;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 | import android.support.v7.widget.helper.ItemTouchHelper;
5 |
6 |
7 | public class MyTouchHelperCallback extends ItemTouchHelper.Callback {
8 |
9 | final ItemTouchHelperAdapter mAdapter;
10 |
11 | public MyTouchHelperCallback(ItemTouchHelperAdapter adapter) {
12 | mAdapter = adapter;
13 | }
14 |
15 |
16 | @Override
17 | public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
18 |
19 | int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
20 | int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
21 |
22 | return makeMovementFlags(dragFlags, swipeFlags);
23 | }
24 |
25 | @Override
26 | public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
27 |
28 | mAdapter.onItemMove(viewHolder.getAdapterPosition(), target.getAdapterPosition());
29 | return true;
30 | }
31 |
32 | @Override
33 | public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
34 |
35 | mAdapter.onItemDismiss(viewHolder.getAdapterPosition());
36 | }
37 |
38 |
39 | //used for ItemTouchHelperAdapter
40 | @Override
41 | public boolean isLongPressDragEnabled() {
42 | return false;
43 | }
44 |
45 | @Override
46 | public boolean isItemViewSwipeEnabled() {
47 | return false;
48 | }
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | }
3 | apply plugin: 'com.android.application'
4 | apply plugin: 'signing'
5 |
6 | android {
7 | lintOptions {
8 | checkReleaseBuilds false
9 | }
10 | signingConfigs {
11 | release {
12 | keyAlias 'WifiPasswords'
13 | storeFile file('D:/Projects/AndroidSign/AndroidKeystore.jks')
14 | }
15 | }
16 | compileSdkVersion 24
17 | buildToolsVersion '26.0.2'
18 | defaultConfig {
19 | applicationId "com.pithsoftware.wifipasswords"
20 | minSdkVersion 16
21 | targetSdkVersion 24
22 | versionCode 17
23 | versionName "2.1.5"
24 | }
25 | buildTypes {
26 | release {
27 | minifyEnabled true
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29 | signingConfig signingConfigs.release
30 | }
31 | }
32 | compileOptions {
33 | sourceCompatibility JavaVersion.VERSION_1_8
34 | targetCompatibility JavaVersion.VERSION_1_8
35 | }
36 | }
37 |
38 | dependencies {
39 | implementation fileTree(include: ['*.jar'], dir: 'libs')
40 | implementation 'com.android.support:appcompat-v7:24.2.1'
41 | implementation 'com.android.support:recyclerview-v7:24.2.1'
42 | implementation 'com.android.support:design:24.2.1'
43 | implementation 'com.android.support:cardview-v7:24.2.1'
44 | implementation 'me.zhanghai.android.materialprogressbar:library:1.1.4'
45 | implementation 'com.github.paolorotolo:appintro:3.2.0'
46 | implementation 'com.github.traex.rippleeffect:library:1.3'
47 | annotationProcessor 'com.jakewharton:butterknife:7.0.1'
48 | implementation 'com.jakewharton:butterknife:7.0.1'
49 | implementation project(':RootShell-1.6-release')
50 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_wifi_list_fragment.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
15 |
16 |
22 |
23 |
28 |
29 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
19 |
22 |
23 |
24 |
25 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/FlingBehavior.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 | import android.content.Context;
4 | import android.support.design.widget.AppBarLayout;
5 | import android.support.design.widget.CoordinatorLayout;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.util.AttributeSet;
8 | import android.view.View;
9 |
10 | //Layout Behavior class to fix AppBarLayout + RecyclerView fling issue
11 | // Issue link: https://code.google.com/p/android/issues/detail?id=177729
12 |
13 | public final class FlingBehavior extends AppBarLayout.Behavior {
14 | private static final int TOP_CHILD_FLING_THRESHOLD = 3;
15 | private boolean isPositive;
16 |
17 | public FlingBehavior() {
18 | }
19 |
20 | public FlingBehavior(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | @Override
25 | public boolean onNestedFling(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, float velocityX, float velocityY, boolean consumed) {
26 | if (velocityY > 0 && !isPositive || velocityY < 0 && isPositive) {
27 | velocityY = velocityY * -1;
28 | }
29 | if (target instanceof RecyclerView && velocityY < 0) {
30 | final RecyclerView recyclerView = (RecyclerView) target;
31 | final View firstChild = recyclerView.getChildAt(0);
32 | final int childAdapterPosition = recyclerView.getChildAdapterPosition(firstChild);
33 | consumed = childAdapterPosition > TOP_CHILD_FLING_THRESHOLD;
34 | }
35 | return super.onNestedFling(coordinatorLayout, child, target, velocityX, velocityY, consumed);
36 | }
37 |
38 | @Override
39 | public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dx, int dy, int[] consumed) {
40 | super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed);
41 | isPositive = dy > 0;
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/ScrollAwareFABBehavior.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 |
4 | import android.content.Context;
5 | import android.support.design.widget.CoordinatorLayout;
6 | import android.support.design.widget.FloatingActionButton;
7 | import android.support.v4.view.ViewCompat;
8 | import android.util.AttributeSet;
9 | import android.view.View;
10 |
11 | public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior {
12 |
13 | public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
14 | super();
15 | }
16 |
17 | @Override
18 | public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout,
19 | final FloatingActionButton child,
20 | final View directTargetChild, final View target, final int nestedScrollAxes) {
21 | // Ensure we react to vertical scrolling
22 | return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL
23 | || super.onStartNestedScroll(coordinatorLayout, child,
24 | directTargetChild, target, nestedScrollAxes);
25 | }
26 |
27 | @Override
28 | public void onNestedScroll(final CoordinatorLayout coordinatorLayout,
29 | final FloatingActionButton child,
30 | final View target, final int dxConsumed, final int dyConsumed,
31 | final int dxUnconsumed, final int dyUnconsumed) {
32 | super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed,
33 | dxUnconsumed, dyUnconsumed);
34 | if (dyConsumed > 0 && child.getVisibility() == View.VISIBLE && child.isEnabled()) {
35 | // User scrolled down and the FAB is currently visible -> hide the FAB
36 | child.hide();
37 | } else if (dyConsumed < 0 && child.getVisibility() != View.VISIBLE && child.isEnabled()) {
38 | // User scrolled up and the FAB is currently not visible -> show the FAB
39 | child.show();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/AutoUpdateList.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.preference.PreferenceManager;
6 | import android.support.v4.app.FragmentManager;
7 |
8 | import com.pithsoftware.wifipasswords.R;
9 | import com.pithsoftware.wifipasswords.activities.MainActivity;
10 | import com.pithsoftware.wifipasswords.fragments.WifiListFragment;
11 |
12 |
13 | public class AutoUpdateList {
14 |
15 | private static final String DEFAULT_UPDATE = "1";
16 | private static final String LAST_UPDATE = "last_update";
17 | private static final int DISABLED = -1;
18 |
19 |
20 | public static void update(Context context, FragmentManager fragmentManager) {
21 |
22 | if(!MyApplication.sShouldAutoUpdateList)
23 | return;
24 |
25 | SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
26 | SharedPreferences.Editor editor = sharedPreferences.edit();
27 |
28 | long currentTime = System.currentTimeMillis();
29 | long lastUpdateTime = sharedPreferences.getLong(LAST_UPDATE, 0);
30 |
31 | if(lastUpdateTime == 0) {
32 | lastUpdateTime = currentTime;
33 | editor.putLong(LAST_UPDATE, lastUpdateTime).apply();
34 | }
35 |
36 | int updateOption = Integer.parseInt(sharedPreferences.getString(context.getString(R.string.pref_auto_update_key), DEFAULT_UPDATE));
37 |
38 | if(updateOption != DISABLED) {
39 | MyApplication.sShouldAutoUpdateList = false;
40 |
41 | if(currentTime > lastUpdateTime + getMillisUntilPrompt(updateOption)) {
42 |
43 | editor.putLong(LAST_UPDATE, System.currentTimeMillis()).apply();
44 | ((WifiListFragment) fragmentManager
45 | .findFragmentByTag(MainActivity.WIFI_LIST_FRAGMENT_TAG))
46 | .loadFromFile(false);
47 | }
48 |
49 | }
50 | }
51 |
52 |
53 | private static int getMillisUntilPrompt(int days) {
54 | return days * 24 * 60 * 60 * 1000;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_input.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
22 |
23 |
24 |
25 |
29 |
30 |
39 |
40 |
41 |
42 |
47 |
48 |
55 |
56 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OreoWifiPasswords
2 |
3 | This was Nexxado's first project (see Nexxado's GitHub branch )
4 |
5 | I adopted it and extended it (as my first android project) to get it working on Android Oreo.
6 |
7 | #### a completely free app that shows your device saved wifi passwords.
8 |
9 |
10 | Warning: sharing a wifi password with someone can compromise that wifi network security!
11 |
12 | Troubleshooting
13 |
14 | ## Features:
15 | - Show your device saved wifi passwords (ROOT REQUIRED )
16 | - Add wifi passwords manually
17 | - Hide wifi passwords in an archive list.
18 | - Live search wifi passwords by Name & Tag.
19 | - Optional passcode protection (style inspired by Dropbox)
20 |
21 |
22 | #### Gesture Actions:
23 | - Double-Tap to quickly copy a wifi password to clipboard
24 | - Long Press to bring up the Contextual Action Bar, allowing you to tag, share, copy or archive your wifi passwords.
25 | you can then select multiple wifi passwords by simply tapping them
26 |
27 | ### External Libraries Used:
28 |
29 | - Butter Knife by Jake Wharton
30 | - Gradle Retrolambda Plugin by Evan Tatarka
31 | - MaterialProgressBar by Zhang Hai
32 | - AppIntro by Paolo Rotolo
33 | - RippleEffect by Robin Chutaux
34 |
35 | ## Troubleshooting
36 | In case the app is unable to find the file containing your saved wifi passwords please google your device's path for the saved wifi passwords file.
37 |
38 | then insert it manually into the app's settings.
39 |
40 | the most commonly used paths by manufacturers which the app automatically tries are:
41 | - /data/misc/wifi/wpa_supplicant.conf
42 | - /data/wifi/bcm_supp.conf
43 | - /data/misc/wifi/wpa.conf
44 |
45 |
46 | Back to Top
47 |
48 | ## License
49 |
50 | Licensed under the Apache License, Version 2.0 (the "License");
51 | you may not use this file except in compliance with the License.
52 | You may obtain a copy of the License at
53 |
54 | http://www.apache.org/licenses/LICENSE-2.0
55 |
56 | Unless required by applicable law or agreed to in writing, software
57 | distributed under the License is distributed on an "AS IS" BASIS,
58 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59 | See the License for the specific language governing permissions and
60 | limitations under the License.
61 |
62 |
63 |
64 | ***
65 | Back to Top
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/activities/IntroActivity.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.activities;
2 |
3 |
4 | import android.content.pm.ActivityInfo;
5 | import android.os.Bundle;
6 | import android.support.v4.content.ContextCompat;
7 |
8 | import com.github.paolorotolo.appintro.AppIntro2;
9 | import com.github.paolorotolo.appintro.AppIntroFragment;
10 | import com.pithsoftware.wifipasswords.R;
11 |
12 | public class IntroActivity extends AppIntro2 {
13 |
14 |
15 | @Override
16 | public void init(Bundle savedInstanceState) {
17 |
18 | addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_welcome),
19 | getString(R.string.intro_message_welcome),
20 | R.drawable.intro_app_icon,
21 | ContextCompat.getColor(this, R.color.colorPrimary)));
22 |
23 | addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_disclaimer),
24 | getString(R.string.intro_message_disclaimer),
25 | R.drawable.intro_disclaimer,
26 | ContextCompat.getColor(this, R.color.colorAccent)));
27 |
28 | addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_root),
29 | getString(R.string.intro_message_root),
30 | R.drawable.intro_root_permission,
31 | ContextCompat.getColor(this, R.color.colorPrimaryDark)));
32 |
33 | addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_quick_copy),
34 | getString(R.string.intro_message_quick_copy),
35 | R.drawable.intro_quick_copy,
36 | ContextCompat.getColor(this, R.color.colorAccent)));
37 |
38 | addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_cab),
39 | getString(R.string.intro_message_cab),
40 | R.drawable.intro_cab,
41 | ContextCompat.getColor(this, R.color.colorBlue900)));
42 |
43 | addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_thank_you),
44 | "",
45 | R.drawable.intro_thank_you,
46 | ContextCompat.getColor(this, R.color.colorPrimary)));
47 |
48 |
49 | setDepthAnimation();
50 |
51 | //lock to Portrait Orientation
52 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
53 | }
54 |
55 |
56 | @Override
57 | public void onDonePressed() {
58 | setResult(RESULT_OK);
59 | finish();
60 | }
61 |
62 | @Override
63 | public void onBackPressed() {
64 | //do nothing
65 | }
66 |
67 | @Override
68 | protected void onPause() {
69 | super.onPause();
70 | }
71 |
72 | @Override
73 | protected void onResume() {
74 | super.onResume();
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/dialogs/CustomAlertDialogFragment.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.dialogs;
2 |
3 | import android.app.Dialog;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.support.annotation.NonNull;
7 | import android.support.v4.app.DialogFragment;
8 | import android.support.v7.app.AlertDialog;
9 |
10 | import com.pithsoftware.wifipasswords.R;
11 | import com.pithsoftware.wifipasswords.extras.MyApplication;
12 | import com.pithsoftware.wifipasswords.extras.RequestCodes;
13 |
14 |
15 | public class CustomAlertDialogFragment extends DialogFragment {
16 |
17 | static final String MESSAGE_KEY = "alert_dialog_message";
18 | static final String TITLE_KEY = "alert_dialog_title";
19 | static final String BUTTONS_KEY = "alert_dialog_buttons";
20 |
21 | public static CustomAlertDialogFragment getInstance(String title, String message, String... buttons) {
22 | CustomAlertDialogFragment fragment = new CustomAlertDialogFragment();
23 |
24 | Bundle args = new Bundle();
25 | args.putString(TITLE_KEY, title);
26 | args.putString(MESSAGE_KEY, message);
27 | args.putStringArray(BUTTONS_KEY, buttons);
28 | fragment.setArguments(args);
29 |
30 | return fragment;
31 | }
32 |
33 | public CustomAlertDialogFragment() {
34 |
35 | }
36 |
37 | @NonNull
38 | @Override
39 | public Dialog onCreateDialog(Bundle savedInstanceState) {
40 |
41 | Bundle bundle = getArguments();
42 | String title = bundle.getString(TITLE_KEY);
43 | String message = bundle.getString(MESSAGE_KEY);
44 | String[] buttons = bundle.getStringArray(BUTTONS_KEY);
45 |
46 | AlertDialog.Builder builder;
47 |
48 | if (MyApplication.sIsDark) {
49 | builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme_Dark);
50 | } else {
51 | builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme);
52 | }
53 |
54 | builder.setMessage(message)
55 | .setTitle(title);
56 |
57 | if(buttons != null && buttons.length > 0) {
58 |
59 | //Send Result Codes to target fragment according to button clicked
60 | builder.setPositiveButton(buttons[0], (dialog, which) -> {
61 | sendResult(RequestCodes.DIALOG_CONFIRM, null);
62 | });
63 |
64 | if(buttons.length > 1) {
65 | builder.setNegativeButton(buttons[1], (dialog, which) -> {
66 | sendResult(RequestCodes.DIALOG_CANCEL, null);
67 | });
68 | }
69 | }
70 | return builder.create();
71 | }
72 |
73 |
74 |
75 | private void sendResult(int resultCode, Intent intent) {
76 |
77 | getTargetFragment().onActivityResult(getTargetRequestCode(), resultCode, intent);
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/recycler/RecyclerTouchListener.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.recycler;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.GestureDetector;
6 | import android.view.MotionEvent;
7 | import android.view.View;
8 |
9 |
10 | /*****************************************************************************************/
11 | /****************** Implement Clicks & Gesture for RecycleView ***************************/
12 | /*****************************************************************************************/
13 | public class RecyclerTouchListener implements RecyclerView.OnItemTouchListener {
14 |
15 | GestureDetector gestureDetector;
16 | ClickListener clickListener;
17 |
18 |
19 | public RecyclerTouchListener(Context context, final RecyclerView recyclerView, final ClickListener clickListener) {
20 |
21 | this.clickListener = clickListener;
22 |
23 | gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
24 |
25 | @Override
26 | public boolean onDoubleTap(MotionEvent e) {
27 |
28 | View child = recyclerView.findChildViewUnder(e.getX(), e.getY());
29 | if(child != null && clickListener != null) {
30 | clickListener.onDoubleTap(child, recyclerView.getChildAdapterPosition(child));
31 | }
32 | return true;
33 | }
34 |
35 | @Override
36 | public boolean onSingleTapUp(MotionEvent e) {
37 | return true;
38 | }
39 |
40 | @Override
41 | public void onLongPress(MotionEvent e) {
42 | View child = recyclerView.findChildViewUnder(e.getX(), e.getY());
43 | if(child != null && clickListener != null) {
44 | clickListener.onLongClick(child, recyclerView.getChildAdapterPosition(child));
45 | }
46 |
47 | super.onLongPress(e);
48 | }
49 | });
50 | }
51 |
52 |
53 | @Override
54 | public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
55 | View child = rv.findChildViewUnder(e.getX(), e.getY());
56 | if(child != null && clickListener != null && gestureDetector.onTouchEvent(e)) {
57 |
58 | clickListener.onClick(child, rv.getChildAdapterPosition(child));
59 | }
60 |
61 | return false;
62 | }
63 |
64 | @Override
65 | public void onTouchEvent(RecyclerView rv, MotionEvent e) {
66 |
67 | }
68 |
69 | @Override
70 | public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
71 |
72 | }
73 |
74 |
75 |
76 |
77 | public interface ClickListener {
78 | void onClick(View view, int position);
79 | void onLongClick(View view, int position);
80 | void onDoubleTap(View view, int position);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.content.SharedPreferences;
6 | import android.os.Build;
7 | import android.preference.CheckBoxPreference;
8 | import android.preference.PreferenceManager;
9 |
10 | import com.pithsoftware.wifipasswords.R;
11 | import com.pithsoftware.wifipasswords.database.PasswordDB;
12 |
13 | import java.util.UUID;
14 | import java.util.concurrent.atomic.AtomicInteger;
15 |
16 | public class MyApplication extends Application {
17 |
18 | private static MyApplication sInstance;
19 | private static PasswordDB mPasswordDB;
20 | private static AtomicInteger mOpenCounter = new AtomicInteger();
21 |
22 | public static boolean mAppWentBackground;
23 |
24 | public static final String FIRST_LAUNCH = "first_launch";
25 | public static final String DEVICE_UUID = "uuid";
26 |
27 | public static final String NO_PASSWORD_TEXT = "no password";
28 |
29 | public static boolean sHidePwd;
30 | public static boolean sIsDark;
31 | public static String sMyUUID;
32 | public static boolean sShouldAutoUpdateList;
33 |
34 | @Override
35 | public void onCreate() {
36 | super.onCreate();
37 | sInstance = this;
38 | mPasswordDB = new PasswordDB(this);
39 |
40 | SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
41 |
42 | //Generate UUID for use with Crashlytics
43 | if(sharedPreferences.getBoolean(FIRST_LAUNCH, true)) {
44 | generateUUID();
45 | } else {
46 | sMyUUID = sharedPreferences.getString(DEVICE_UUID, "");
47 | }
48 |
49 |
50 | mAppWentBackground = true;
51 | sShouldAutoUpdateList = true;
52 |
53 | sIsDark = sharedPreferences.getBoolean(getString(R.string.pref_dark_theme_key), false);
54 | sHidePwd = sharedPreferences.getBoolean(getString(R.string.pref_hide_pass_key), true);
55 | }
56 |
57 |
58 | public static MyApplication getInstance() {
59 | return sInstance;
60 | }
61 |
62 | public static Context getAppContext() {
63 | return sInstance.getApplicationContext();
64 | }
65 |
66 | public synchronized static PasswordDB getWritableDatabase() {
67 |
68 | if (mPasswordDB == null && mOpenCounter.incrementAndGet() == 1) {
69 | mPasswordDB = new PasswordDB(getAppContext());
70 | }
71 | return mPasswordDB;
72 | }
73 |
74 | public synchronized static void closeDatabase() {
75 | if (mOpenCounter.decrementAndGet() == 0) {
76 | mPasswordDB.close();
77 | }
78 |
79 | }
80 |
81 | public static void darkTheme(CheckBoxPreference preference) {
82 | sIsDark = preference.isChecked();
83 | }
84 |
85 | public static void hidePass(CheckBoxPreference preference) {
86 | sHidePwd = preference.isChecked();
87 | }
88 |
89 | private void generateUUID() {
90 |
91 | sMyUUID = UUID.randomUUID().toString();
92 | PreferenceManager.getDefaultSharedPreferences(this).edit().putString(DEVICE_UUID, sMyUUID).apply();
93 |
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
13 |
20 |
21 |
26 |
27 |
28 |
29 |
30 |
31 |
37 |
38 |
44 |
45 |
51 |
52 |
58 |
59 |
67 |
68 |
69 |
70 |
71 |
72 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/dialogs/AboutDialogFragment.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.dialogs;
2 |
3 | import android.app.Activity;
4 | import android.app.Dialog;
5 | import android.app.DialogFragment;
6 | import android.content.Intent;
7 | import android.content.pm.PackageManager;
8 | import android.os.Bundle;
9 | import android.support.v7.app.AlertDialog;
10 | import android.text.method.LinkMovementMethod;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.widget.TextView;
14 |
15 | import com.pithsoftware.wifipasswords.R;
16 | import com.pithsoftware.wifipasswords.activities.IntroActivity;
17 | import com.pithsoftware.wifipasswords.extras.MyApplication;
18 |
19 | import java.util.List;
20 |
21 | import butterknife.Bind;
22 | import butterknife.ButterKnife;
23 | import butterknife.OnClick;
24 |
25 |
26 | public class AboutDialogFragment extends DialogFragment {
27 |
28 | @Bind ({R.id.dialog_about_info,
29 | R.id.dialog_about_github,
30 | R.id.dialog_about_library_butterknife,
31 | R.id.dialog_about_library_retrolambda,
32 | R.id.dialog_about_library_materialprogressbar,
33 | R.id.dialog_about_library_appintro,
34 | R.id.dialog_about_library_rippleeffect,
35 | R.id.dialog_about_help_readme})
36 | List textViewsLinks;
37 |
38 | @Bind(R.id.dialog_about_version) TextView mVersion;
39 |
40 | @OnClick(R.id.dialog_about_help_intro)
41 | void intro(View v) { startActivity(new Intent(v.getContext(), IntroActivity.class)); }
42 |
43 |
44 |
45 | public static AboutDialogFragment getInstance() {
46 | return new AboutDialogFragment();
47 | }
48 |
49 | public AboutDialogFragment() {
50 |
51 | }
52 |
53 |
54 | @Override
55 | public Dialog onCreateDialog(Bundle savedInstanceState) {
56 |
57 | Activity parent = getActivity();
58 | AlertDialog.Builder builder;
59 |
60 | //Choose theme
61 | if (MyApplication.sIsDark) {
62 | builder = new AlertDialog.Builder(parent, R.style.AlertDialogTheme_Dark);
63 | } else {
64 | builder = new AlertDialog.Builder(parent, R.style.AlertDialogTheme);
65 | }
66 |
67 | View helpDialogLayout = LayoutInflater.from(parent).inflate(R.layout.dialog_about, null);
68 |
69 | ButterKnife.bind(this, helpDialogLayout);
70 | ButterKnife.apply(textViewsLinks, LINK);
71 |
72 | //set Version Number
73 | String versionName;
74 |
75 | try {
76 | versionName = mVersion.getText().toString() + " " + parent.getPackageManager().getPackageInfo(parent.getPackageName(), 0).versionName;
77 | } catch (PackageManager.NameNotFoundException e) {
78 | versionName = getString(R.string.dialog_about_version_error);
79 | }
80 |
81 | mVersion.setText(versionName);
82 |
83 |
84 | builder.setTitle(getString(R.string.dialog_about_title));
85 | builder.setView(helpDialogLayout)
86 | .setPositiveButton(R.string.dialog_about_button, (dialog, which) -> {
87 | //do nothing
88 | });
89 |
90 | return builder.create();
91 | }
92 |
93 |
94 | final static ButterKnife.Action LINK = (view, index) -> view.setMovementMethod(LinkMovementMethod.getInstance());
95 | }
96 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/pojo/WifiEntry.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.pojo;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | import java.util.Arrays;
7 |
8 |
9 | public class WifiEntry implements Parcelable {
10 |
11 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
12 | @Override
13 | public WifiEntry createFromParcel(Parcel in) {
14 | return new WifiEntry(in);
15 | }
16 |
17 | @Override
18 | public WifiEntry[] newArray(int size) {
19 | return new WifiEntry[size];
20 | }
21 | };
22 |
23 |
24 | private String title;
25 | private String password;
26 | private String tag = "";
27 | private boolean connectedInd = false;
28 |
29 |
30 | public WifiEntry() {
31 | }
32 |
33 | public WifiEntry(String title, String password) {
34 | initVars(title, password, false, "");
35 | }
36 |
37 | public WifiEntry(String title, String password, boolean connectedInd) {
38 | initVars(title, password, connectedInd, "");
39 | }
40 |
41 | private void initVars(String title, String password, boolean connectedInd, String tag) {
42 | this.title = title;
43 | this.password = password;
44 | this.connectedInd = connectedInd;
45 | this.tag = tag;
46 | }
47 |
48 |
49 | public String getTitle() {
50 | return title;
51 | }
52 |
53 | public void setTitle(String title) {
54 | this.title = title;
55 | }
56 |
57 | public String getPassword(boolean showAll) {
58 | if (showAll) {
59 | return password;
60 | } else {
61 | char[] fill = new char[password.length()];
62 | Arrays.fill(fill, '*');
63 | return new String(fill);
64 | }
65 | }
66 |
67 | public void setPassword(String password) {
68 | this.password = password;
69 | }
70 |
71 | public boolean getConnectedInd() {
72 | return connectedInd;
73 | }
74 |
75 | public void setConnectedInd(boolean connectedInd) {
76 | this.connectedInd = connectedInd;
77 | }
78 |
79 | public String getTag() {
80 | return tag;
81 | }
82 |
83 | public void setTag(String tag) {
84 | this.tag = tag;
85 | }
86 |
87 | @Override
88 | public String toString() {
89 | return "Wifi: " + title + ", pass: " + password + ", Connected: " + connectedInd + ", tag: " + tag + "\n";
90 | }
91 |
92 | /************************************************************/
93 | //Parcelable Implementation
94 |
95 |
96 | //Parcel Constructor
97 | protected WifiEntry(Parcel in) {
98 | title = in.readString();
99 | password = in.readString();
100 | this.connectedInd = (in.readInt() == 1);
101 | tag = in.readString();
102 | }
103 |
104 |
105 | @Override
106 | public int describeContents() {
107 | return 0;
108 | }
109 |
110 | @Override
111 | public void writeToParcel(Parcel dest, int flags) {
112 |
113 | dest.writeString(title);
114 | dest.writeString(password);
115 | dest.writeInt(connectedInd ? 1 : 0);
116 | dest.writeString(tag);
117 | }
118 |
119 | }
120 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/extras/AppCompatPreferenceActivity.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.extras;
2 |
3 | /*
4 | * Copyright (C) 2014 The Android Open Source Project
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import android.content.res.Configuration;
20 | import android.os.Bundle;
21 | import android.preference.PreferenceActivity;
22 | import android.support.annotation.LayoutRes;
23 | import android.support.annotation.Nullable;
24 | import android.support.v7.app.ActionBar;
25 | import android.support.v7.app.AppCompatDelegate;
26 | import android.support.v7.widget.Toolbar;
27 | import android.view.MenuInflater;
28 | import android.view.View;
29 | import android.view.ViewGroup;
30 | /**
31 | * A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
32 | * to be used with AppCompat.
33 | *
34 | * This technique can be used with an {@link android.app.Activity} class, not just
35 | * {@link android.preference.PreferenceActivity}.
36 | */
37 |
38 | //https://android.googlesource.com/platform/development/+/master/samples/Support7Demos/src/com/example/android/supportv7/app/AppCompatPreferenceActivity.java
39 |
40 | public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
41 | private AppCompatDelegate mDelegate;
42 | @Override
43 | protected void onCreate(Bundle savedInstanceState) {
44 | getDelegate().installViewFactory();
45 | getDelegate().onCreate(savedInstanceState);
46 | super.onCreate(savedInstanceState);
47 | }
48 | @Override
49 | protected void onPostCreate(Bundle savedInstanceState) {
50 | super.onPostCreate(savedInstanceState);
51 | getDelegate().onPostCreate(savedInstanceState);
52 | }
53 | public ActionBar getSupportActionBar() {
54 | return getDelegate().getSupportActionBar();
55 | }
56 | public void setSupportActionBar(@Nullable Toolbar toolbar) {
57 | getDelegate().setSupportActionBar(toolbar);
58 | }
59 | @Override
60 | public MenuInflater getMenuInflater() {
61 | return getDelegate().getMenuInflater();
62 | }
63 | @Override
64 | public void setContentView(@LayoutRes int layoutResID) {
65 | getDelegate().setContentView(layoutResID);
66 | }
67 | @Override
68 | public void setContentView(View view) {
69 | getDelegate().setContentView(view);
70 | }
71 | @Override
72 | public void setContentView(View view, ViewGroup.LayoutParams params) {
73 | getDelegate().setContentView(view, params);
74 | }
75 | @Override
76 | public void addContentView(View view, ViewGroup.LayoutParams params) {
77 | getDelegate().addContentView(view, params);
78 | }
79 | @Override
80 | protected void onPostResume() {
81 | super.onPostResume();
82 | getDelegate().onPostResume();
83 | }
84 | @Override
85 | protected void onTitleChanged(CharSequence title, int color) {
86 | super.onTitleChanged(title, color);
87 | getDelegate().setTitle(title);
88 | }
89 | @Override
90 | public void onConfigurationChanged(Configuration newConfig) {
91 | super.onConfigurationChanged(newConfig);
92 | getDelegate().onConfigurationChanged(newConfig);
93 | }
94 | @Override
95 | protected void onStop() {
96 | super.onStop();
97 | getDelegate().onStop();
98 | }
99 | @Override
100 | protected void onDestroy() {
101 | super.onDestroy();
102 | getDelegate().onDestroy();
103 | }
104 | public void invalidateOptionsMenu() {
105 | getDelegate().invalidateOptionsMenu();
106 | }
107 | private AppCompatDelegate getDelegate() {
108 | if (mDelegate == null) {
109 | mDelegate = AppCompatDelegate.create(this, null);
110 | }
111 | return mDelegate;
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/wifi_entry_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
28 |
29 |
35 |
36 |
48 |
49 |
50 |
59 |
60 |
63 |
64 |
76 |
77 |
78 |
79 |
89 |
90 |
91 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/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 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
25 |
26 |
27 |
42 |
43 |
44 |
45 |
46 |
50 |
51 |
60 |
61 |
66 |
67 |
71 |
72 |
75 |
76 |
81 |
82 |
83 |
84 |
85 |
100 |
101 |
102 |
118 |
119 |
120 |
125 |
126 |
127 |
128 |
131 |
132 |
133 |
134 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
20 |
27 |
28 |
35 |
36 |
37 |
44 |
45 |
46 |
47 |
48 |
53 |
54 |
59 |
60 |
68 |
69 |
76 |
77 |
84 |
85 |
92 |
93 |
100 |
101 |
108 |
109 |
110 |
117 |
118 |
123 |
124 |
134 |
135 |
143 |
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/activities/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.preference.PreferenceManager;
8 | import android.support.v4.app.ActivityOptionsCompat;
9 | import android.support.v7.app.AlertDialog;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.support.v7.widget.Toolbar;
12 | import android.transition.Transition;
13 | import android.transition.TransitionInflater;
14 | import android.view.Menu;
15 | import android.view.MenuItem;
16 |
17 | import com.pithsoftware.wifipasswords.R;
18 | import com.pithsoftware.wifipasswords.dialogs.AboutDialogFragment;
19 | import com.pithsoftware.wifipasswords.extras.MyApplication;
20 | import com.pithsoftware.wifipasswords.extras.RequestCodes;
21 | import com.pithsoftware.wifipasswords.fragments.WifiListFragment;
22 |
23 | public class MainActivity extends AppCompatActivity {
24 |
25 | private WifiListFragment mWifiListFragment;
26 |
27 | public static final String WIFI_LIST_FRAGMENT_TAG = "main_fragment_tag";
28 |
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | if (MyApplication.sIsDark) {
33 | setTheme(R.style.AppTheme_Dark);
34 | }
35 | super.onCreate(savedInstanceState);
36 |
37 | //Set Activity Transition - Lollipop+
38 | if (Build.VERSION.SDK_INT >= 21) {
39 | TransitionInflater transitionInflater = TransitionInflater.from(this);
40 | Transition transition = transitionInflater.inflateTransition(R.transition.activity_slide_left);
41 | getWindow().setExitTransition(transition);
42 |
43 | }
44 |
45 | setContentView(R.layout.activity_main);
46 |
47 | //Set default values for preferences - false = runs only once!!
48 | PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
49 |
50 | Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar);
51 | setSupportActionBar(toolbar);
52 |
53 | if (savedInstanceState == null) {
54 | mWifiListFragment = WifiListFragment.newInstance();
55 | } else {
56 | mWifiListFragment = (WifiListFragment) getSupportFragmentManager().findFragmentByTag(WIFI_LIST_FRAGMENT_TAG);
57 | }
58 | mWifiListFragment.AppContext = getApplicationContext();
59 |
60 | getSupportFragmentManager().beginTransaction().replace
61 | (R.id.content_frame, mWifiListFragment, WIFI_LIST_FRAGMENT_TAG).commit();
62 |
63 | }
64 |
65 | @Override
66 | protected void onResume() {
67 | super.onResume();
68 | }
69 |
70 | @Override
71 | protected void onPause() {
72 | super.onPause();
73 |
74 | if (isFinishing()) {
75 | MyApplication.mAppWentBackground = true;
76 | }
77 | }
78 |
79 | @Override
80 | public void onBackPressed() {
81 |
82 | if (mWifiListFragment.isVisible() && mWifiListFragment.getSortModeStatus()) {
83 | mWifiListFragment.sortMode(false);
84 | return;
85 | }
86 |
87 | //Dialog to confirm Exit
88 |
89 | String[] buttons = getResources().getStringArray(R.array.dialog_exit_buttons);
90 | AlertDialog.Builder builder;
91 |
92 | //Choose theme
93 | if (MyApplication.sIsDark) {
94 | builder = new AlertDialog.Builder(this, R.style.AlertDialogTheme_Dark);
95 | } else {
96 | builder = new AlertDialog.Builder(this, R.style.AlertDialogTheme);
97 | }
98 |
99 | builder.setTitle(R.string.dialog_exit_title)
100 | .setMessage(R.string.dialog_exit_message)
101 | .setPositiveButton(buttons[0], (dialog, which) -> {
102 | finish();
103 | overridePendingTransition(R.anim.activity_slide_in_up, R.anim.activity_slide_out_down);
104 | })
105 | .setNegativeButton(buttons[1], (dialog, which) -> {
106 | //Dismiss Dialog
107 | });
108 |
109 |
110 | builder.create().show();
111 | }
112 |
113 | @Override
114 | public boolean onCreateOptionsMenu(Menu menu) {
115 | // Inflate the menu; this adds items to the action bar if it is present.
116 | getMenuInflater().inflate(R.menu.menu_main, menu);
117 | return true;
118 | }
119 |
120 | @Override
121 | public boolean onOptionsItemSelected(MenuItem item) {
122 | // Handle action bar item clicks here. The action bar will
123 | // automatically handle clicks on the Home/Up button, so long
124 | // as you specify a parent activity in AndroidManifest.xml.
125 | int id = item.getItemId();
126 |
127 | ActivityOptionsCompat compat;
128 |
129 | //noinspection SimplifiableIfStatement
130 | switch (id) {
131 |
132 | case R.id.action_settings:
133 | //Start Settings with Transition
134 | compat = ActivityOptionsCompat.makeCustomAnimation(this, R.anim.right_in, R.anim.left_out);
135 | startActivityForResult(new Intent(this, SettingsActivity.class), RequestCodes.ACTIVITY_SETTINGS_CODE, compat.toBundle());
136 | return true;
137 |
138 | case R.id.action_help:
139 | AboutDialogFragment dialog = AboutDialogFragment.getInstance();
140 | dialog.show(getFragmentManager(), getString(R.string.dialog_about_key));
141 |
142 | return true;
143 |
144 | }
145 |
146 | return super.onOptionsItemSelected(item);
147 | }
148 |
149 |
150 | @Override
151 | public void onActivityResult(int requestCode, int resultCode, Intent data) {
152 |
153 | switch (requestCode) {
154 |
155 | case RequestCodes.ACTIVITY_INTRO_CODE:
156 |
157 | mWifiListFragment.onActivityResult(requestCode, resultCode, data);
158 | break;
159 |
160 |
161 | case RequestCodes.SETTINGS_PATH_ERROR_CODE: //Handles returning from SettingsActivity after Error in Path
162 |
163 | if (resultCode == Activity.RESULT_OK) {
164 |
165 | if (mWifiListFragment.isVisible())
166 | mWifiListFragment.loadFromFile(true);
167 | }
168 | break;
169 |
170 |
171 | case RequestCodes.ACTIVITY_SETTINGS_CODE: //Return from Settings Activity - Reset to Default
172 |
173 | if (resultCode == RequestCodes.RESET_TO_DEFAULT) {
174 |
175 | mWifiListFragment.loadFromFile(true);
176 |
177 | } else if (resultCode == RequestCodes.SHOW_NO_PASSWORD_CODE) {
178 |
179 | mWifiListFragment.toggleNoPassword();
180 |
181 | } else if ((resultCode == RequestCodes.DARK_THEME) || (resultCode == RequestCodes.HIDE_PASS)) {
182 | reloadList();
183 | }
184 | break;
185 |
186 | }
187 | }
188 |
189 | private void reloadList() {
190 | finish();
191 | final Intent intent = getIntent();
192 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
193 | startActivity(intent);
194 | }
195 |
196 | }
197 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/dialogs/InputDialogFragment.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.dialogs;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.design.widget.TextInputLayout;
7 | import android.support.v4.app.DialogFragment;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.view.Window;
12 | import android.view.WindowManager;
13 | import android.view.inputmethod.EditorInfo;
14 | import android.widget.Button;
15 | import android.widget.EditText;
16 | import android.widget.LinearLayout;
17 |
18 | import com.pithsoftware.wifipasswords.R;
19 | import com.pithsoftware.wifipasswords.database.PasswordDB;
20 | import com.pithsoftware.wifipasswords.extras.MyApplication;
21 | import com.pithsoftware.wifipasswords.pojo.WifiEntry;
22 |
23 | import java.util.ArrayList;
24 |
25 | import butterknife.Bind;
26 | import butterknife.ButterKnife;
27 |
28 |
29 | public class InputDialogFragment extends DialogFragment {
30 |
31 | static final String TYPE_KEY = "type_key";
32 |
33 | public static final String ENTRIES_KEY = "entries_key";
34 | public static final String POSITIONS_LEY = "positions_key";
35 | public static final int INPUT_ENTRY = 0;
36 | public static final int INPUT_TAG = 1;
37 |
38 | @Bind(R.id.input_title)
39 | EditText mTitle;
40 | @Bind(R.id.input_password)
41 | EditText mPassword;
42 | @Bind(R.id.input_confirm)
43 | Button mConfirm;
44 | @Bind(R.id.input_cancel)
45 | Button mCancel;
46 | @Bind(R.id.dialog_add_container)
47 | LinearLayout mRoot;
48 |
49 |
50 | public static InputDialogFragment getInstance(int type, Bundle listWifiBundle) {
51 | InputDialogFragment fragment = new InputDialogFragment();
52 |
53 | if (listWifiBundle == null) {
54 | listWifiBundle = new Bundle();
55 | }
56 | listWifiBundle.putInt(TYPE_KEY, type);
57 | fragment.setArguments(listWifiBundle);
58 |
59 | return fragment;
60 | }
61 |
62 |
63 | public InputDialogFragment() {
64 |
65 | }
66 |
67 |
68 | @Nullable
69 | @Override
70 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
71 | View layout = inflater.inflate(R.layout.dialog_input, container);
72 | ButterKnife.bind(this, layout);
73 |
74 | final Bundle bundle = getArguments();
75 | int type = bundle.getInt(TYPE_KEY);
76 |
77 | final InputDialogListener listener = (InputDialogListener) getTargetFragment();
78 |
79 | switch (type) {
80 |
81 | case INPUT_ENTRY:
82 |
83 | getDialog().setTitle(R.string.dialog_add_title);
84 | mConfirm.setOnClickListener(v -> {
85 |
86 | if (hasErrors())
87 | return; //return to dialog
88 |
89 | listener.onSubmitAddDialog(mTitle.getText().toString(), mPassword.getText().toString());
90 | dismiss();
91 | });
92 |
93 | break;
94 |
95 | case INPUT_TAG:
96 |
97 | getDialog().setTitle(R.string.dialog_tag_title);
98 | mPassword.setVisibility(View.GONE);
99 | mTitle.setHint(R.string.dialog_tag_hint);
100 | mTitle.setImeOptions(EditorInfo.IME_ACTION_GO);
101 | TextInputLayout input = (TextInputLayout) layout.findViewById(R.id.input_title_layout);
102 | input.setHint("");
103 | mConfirm.setText(R.string.dialog_tag_button);
104 |
105 | final ArrayList listWifi = bundle.getParcelableArrayList(ENTRIES_KEY);
106 | final ArrayList indexWifi = bundle.getIntegerArrayList(POSITIONS_LEY);
107 |
108 | //if single entry then add current tag to InputDialog text field
109 | if (listWifi != null && listWifi.size() == 1) {
110 | mTitle.setText(listWifi.get(0).getTag());
111 | mTitle.setSelection(mTitle.getText().toString().length());
112 | }
113 |
114 | mConfirm.setOnClickListener(v -> {
115 |
116 | if (mTitle.getText() == null) {
117 | return; //return to dialog
118 | }
119 |
120 | listener.onSubmitTagDialog(mTitle.getText().toString(),
121 | listWifi, indexWifi);
122 | dismiss();
123 | });
124 |
125 | break;
126 |
127 | }
128 |
129 | mCancel.setOnClickListener(v -> dismiss());
130 |
131 |
132 | return layout;
133 | }
134 |
135 |
136 | @Override
137 | public void onResume() {
138 | super.onResume();
139 |
140 | //Set Dialog Dimensions
141 | Window dialogWindow = getDialog().getWindow();
142 | dialogWindow.setLayout(
143 | ViewGroup.LayoutParams.MATCH_PARENT,
144 | ViewGroup.LayoutParams.WRAP_CONTENT);
145 |
146 | dialogWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
147 | }
148 |
149 |
150 | private boolean hasErrors() {
151 | boolean hasError = false;
152 |
153 | boolean isEmptyTitle = mTitle.getText() == null
154 | || mTitle.getText().toString().isEmpty();
155 | boolean isEmptyPassword = mPassword.getText() == null
156 | || mPassword.getText().toString().isEmpty();
157 |
158 | if (isEmptyTitle && isEmptyPassword) {
159 | Snackbar.make(mRoot, getString(R.string.dialog_add_error_empty), Snackbar.LENGTH_SHORT)
160 | .setAction(R.string.snackbar_dismiss, v -> {
161 | //Dismisses Snackbar
162 | }).show();
163 | hasError = true;
164 |
165 | } else if (isEmptyTitle) {
166 | mTitle.setError(getString(R.string.dialog_add_title_empty));
167 | mPassword.setError(null);
168 | hasError = true;
169 |
170 | } else if (isEmptyPassword) {
171 | mTitle.setError(null);
172 | mPassword.setError(getString(R.string.dialog_add_password_empty));
173 | hasError = true;
174 |
175 | } else {
176 |
177 | String title = mTitle.getText().toString().toLowerCase();
178 |
179 | PasswordDB db = MyApplication.getWritableDatabase();
180 | String whereClause = PasswordDB.PasswordHelper.COLUMN_TITLE + " = ?";
181 | String[] whereArgs = new String[]{title};
182 | ArrayList checkList = db.getWifiEntries(whereClause, whereArgs, false);
183 | MyApplication.closeDatabase();
184 |
185 | for (WifiEntry entry : checkList) {
186 | if (entry.getTitle().toLowerCase().equals(title)) {
187 | hasError = true;
188 | break; //no need to check further
189 | }
190 | }
191 |
192 | Snackbar.make(mRoot, R.string.snackbar_wifi_exists, Snackbar.LENGTH_SHORT)
193 | .setAction(R.string.snackbar_dismiss, v -> {
194 | //Dismisses Snackbar
195 | }).show();
196 | }
197 |
198 | return hasError;
199 | }
200 | }
201 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/activities/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.activities;
2 |
3 | import android.content.SharedPreferences;
4 | import android.os.Bundle;
5 | import android.preference.CheckBoxPreference;
6 | import android.preference.EditTextPreference;
7 | import android.preference.ListPreference;
8 | import android.preference.Preference;
9 | import android.preference.PreferenceFragment;
10 | import android.preference.PreferenceManager;
11 | import android.support.v7.app.ActionBar;
12 | import android.support.v7.app.AlertDialog;
13 | import android.support.v7.widget.Toolbar;
14 | import android.view.Menu;
15 | import android.view.MenuItem;
16 |
17 | import com.pithsoftware.wifipasswords.R;
18 | import com.pithsoftware.wifipasswords.dialogs.AboutDialogFragment;
19 | import com.pithsoftware.wifipasswords.extras.AppCompatPreferenceActivity;
20 | import com.pithsoftware.wifipasswords.extras.MyApplication;
21 | import com.pithsoftware.wifipasswords.extras.RequestCodes;
22 |
23 |
24 | public class SettingsActivity extends AppCompatPreferenceActivity {
25 |
26 | SettingsFragment mSettingsFragment;
27 |
28 | static final String SETTINGS_FRAGMENT_TAG = "settings_fragment_tag";
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | if (MyApplication.sIsDark) {
33 | setTheme(R.style.AppTheme_Dark);
34 | }
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.activity_settings);
37 |
38 | Toolbar toolbar;
39 | toolbar = (Toolbar) findViewById(R.id.app_bar);
40 | setSupportActionBar(toolbar);
41 | toolbar.setTitle(getString(R.string.action_settings));
42 |
43 | ActionBar sBar = getSupportActionBar();
44 | if (sBar != null) {
45 | sBar.setDisplayShowHomeEnabled(true);
46 | sBar.setDisplayHomeAsUpEnabled(true);
47 | sBar.setDisplayShowTitleEnabled(true);
48 |
49 | }
50 |
51 |
52 | if (savedInstanceState == null) {
53 | mSettingsFragment = new SettingsFragment();
54 |
55 | } else {
56 | mSettingsFragment = (SettingsFragment) getFragmentManager().findFragmentByTag(SETTINGS_FRAGMENT_TAG);
57 | }
58 |
59 | // Display the fragment as the main content
60 | getFragmentManager().beginTransaction()
61 | .replace(R.id.settings_frame, mSettingsFragment, SETTINGS_FRAGMENT_TAG).commit();
62 |
63 | }
64 |
65 |
66 | //Required Method to Override to Validated Fragments
67 | @Override
68 | protected boolean isValidFragment(String fragmentName) {
69 |
70 | return SettingsFragment.class.getName().equals(fragmentName);
71 | }
72 |
73 | @Override
74 | public boolean onOptionsItemSelected(MenuItem item) {
75 | int id = item.getItemId();
76 |
77 | switch (id) {
78 |
79 | case android.R.id.home:
80 | onBackPressed();
81 | return true;
82 |
83 | case R.id.action_help:
84 | AboutDialogFragment dialog = AboutDialogFragment.getInstance();
85 | dialog.show(getFragmentManager(), getString(R.string.dialog_about_key));
86 | return true;
87 |
88 | }
89 |
90 | return super.onOptionsItemSelected(item);
91 | }
92 |
93 | @Override
94 | public boolean onCreateOptionsMenu(Menu menu) {
95 | getMenuInflater().inflate(R.menu.menu_settings, menu);
96 | return true;
97 | }
98 |
99 | @Override
100 | public void onBackPressed() {
101 | super.onBackPressed();
102 | overridePendingTransition(R.anim.left_in, R.anim.right_out);
103 | }
104 |
105 | @Override
106 | protected void onSaveInstanceState(Bundle outState) {
107 | super.onSaveInstanceState(outState);
108 | }
109 |
110 |
111 | @Override
112 | protected void onResume() {
113 | super.onResume();
114 | }
115 |
116 | @Override
117 | public void onPause() {
118 | super.onPause();
119 | }
120 |
121 |
122 | /***************************************************************/
123 | /****************** Settings Fragment **************************/
124 | /***************************************************************/
125 | public static class SettingsFragment extends PreferenceFragment {
126 |
127 |
128 | /***** Bind Summary to value - Listener *****/
129 | private Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener
130 | = (preference, newValue) -> {
131 |
132 | getActivity().setResult(RESULT_OK);
133 |
134 | String stringValue = newValue.toString();
135 |
136 | if (preference instanceof EditTextPreference) {
137 |
138 | preference.setSummary(stringValue);
139 |
140 | } else if (preference instanceof ListPreference) {
141 |
142 | int index = ((ListPreference) preference).findIndexOfValue(stringValue);
143 | String summary = "";
144 |
145 | if (preference.getKey().equals(getString(R.string.pref_auto_update_key))) {
146 | String disabled = getResources().getStringArray(R.array.pref_auto_update_list_values)[0];
147 | if (!stringValue.equals(disabled))
148 | summary += getString(R.string.pref_auto_update_summary) + " - ";
149 | }
150 |
151 | summary += ((ListPreference) preference).getEntries()[index];
152 | preference.setSummary(summary);
153 | }
154 |
155 | return true;
156 | };
157 |
158 | private void bindPreferenceSummaryToValue(Preference preference) {
159 | // Set the listener to watch for value changes.
160 | preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
161 |
162 | // Trigger the listener immediately with the preference's
163 | // current value.
164 | sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
165 | PreferenceManager
166 | .getDefaultSharedPreferences(preference.getContext())
167 | .getString(preference.getKey(), ""));
168 | }
169 |
170 |
171 | @Override
172 | public void onCreate(Bundle savedInstanceState) {
173 | super.onCreate(savedInstanceState);
174 |
175 | getActivity().setResult(RESULT_CANCELED);
176 |
177 | loadGeneralPreferences();
178 | }
179 |
180 |
181 | //Helper method for onCreate
182 | public void loadGeneralPreferences() {
183 |
184 |
185 | // Load the preferences from an XML resource
186 | addPreferencesFromResource(R.xml.preferences);
187 |
188 |
189 | Preference resetManualPath = findPreference(getString(R.string.pref_reset_manual_key));
190 | resetManualPath.setOnPreferenceClickListener(preference -> {
191 | resetPathPref();
192 | return true;
193 | });
194 | // Allow the Default file path to be different for Oreo+
195 | if (android.os.Build.VERSION.SDK_INT >= 26) { // Hard-CODED: Oreo
196 | String currentValue = PreferenceManager.getDefaultSharedPreferences(getActivity())
197 | .getString(getString(R.string.pref_path_manual_key), getString(R.string.pref_path_default));
198 | if (currentValue.equals(getString(R.string.pref_path_default))) {
199 | resetPathPref();
200 | }
201 | }
202 |
203 | //set dependency on checkbox
204 | resetManualPath.setDependency(getString(R.string.pref_path_checkbox_key));
205 | findPreference(getString(R.string.pref_path_manual_key)).setDependency(getString(R.string.pref_path_checkbox_key));
206 |
207 | findPreference(getString(R.string.pref_default_key)).setOnPreferenceClickListener(preference -> {
208 | showResetWarningDialog();
209 | return true;
210 | });
211 |
212 | findPreference(getString(R.string.pref_show_no_password_key)).setOnPreferenceClickListener(preference -> {
213 | getActivity().setResult(RequestCodes.SHOW_NO_PASSWORD_CODE);
214 | return true;
215 | });
216 |
217 | findPreference(getString(R.string.pref_dark_theme_key)).setOnPreferenceClickListener(preference -> {
218 | MyApplication.darkTheme((CheckBoxPreference) preference);
219 | getActivity().setResult(RequestCodes.DARK_THEME);
220 | getActivity().finish();
221 | return true;
222 | });
223 |
224 | findPreference(getString(R.string.pref_hide_pass_key)).setOnPreferenceClickListener(preference -> {
225 | MyApplication.hidePass((CheckBoxPreference) preference);
226 | getActivity().setResult(RequestCodes.HIDE_PASS);
227 | getActivity().finish();
228 | return true;
229 | });
230 |
231 | //Summary to Value
232 | bindPreferenceSummaryToValue(findPreference(getString(R.string.pref_path_manual_key)));
233 | bindPreferenceSummaryToValue(findPreference(getString(R.string.pref_auto_update_key)));
234 | }
235 |
236 | //Restore wpa_supplicant path to default
237 | private void resetPathPref() {
238 |
239 | SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getActivity());
240 | SharedPreferences.Editor editor = settings.edit();
241 | if (android.os.Build.VERSION.SDK_INT >= 26) { // Hard-CODED: Oreo
242 | editor.putString(getString(R.string.pref_path_manual_key), getString(R.string.pref_path_default_oreo));
243 | } else {
244 | editor.putString(getString(R.string.pref_path_manual_key), getString(R.string.pref_path_default));
245 | }
246 | editor.apply();
247 |
248 |
249 | if (android.os.Build.VERSION.SDK_INT >= 26) { // Hard-CODED: Oreo
250 | findPreference(getString(R.string.pref_path_manual_key)).setSummary(getString(R.string.pref_path_default_oreo));
251 | } else {
252 | findPreference(getString(R.string.pref_path_manual_key)).setSummary(getString(R.string.pref_path_default));
253 | }
254 |
255 | //Refresh Preference Screen
256 | setPreferenceScreen(null);
257 | loadGeneralPreferences();
258 |
259 | }
260 |
261 |
262 | private void showResetWarningDialog() {
263 |
264 | String[] buttons = getResources().getStringArray(R.array.dialog_warning_reset_buttons);
265 |
266 | AlertDialog.Builder builder;
267 |
268 | if (MyApplication.sIsDark) {
269 | builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme_Dark);
270 | } else {
271 | builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme);
272 | }
273 |
274 | //Send Result Codes to target fragment according to button clicked
275 | builder.setMessage(R.string.dialog_warning_reset_message)
276 | .setTitle(R.string.dialog_warning_reset_title)
277 | .setPositiveButton(buttons[0], (dialog, which) -> {
278 | getActivity().setResult(RequestCodes.RESET_TO_DEFAULT);
279 | getActivity().finish();
280 | })
281 | .setNegativeButton(buttons[1], (dialog, which) -> {
282 | //Dismiss Dialog
283 | });
284 |
285 | builder.create().show();
286 | }
287 |
288 | }
289 | }
290 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | generateDebugSources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/recycler/WifiListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.recycler;
2 |
3 | import android.content.Context;
4 | import android.net.NetworkInfo;
5 | import android.net.wifi.WifiInfo;
6 | import android.net.wifi.WifiManager;
7 | import android.preference.PreferenceManager;
8 | import android.support.v4.content.res.ResourcesCompat;
9 | import android.support.v4.view.MotionEventCompat;
10 | import android.support.v7.widget.RecyclerView;
11 | import android.util.SparseBooleanArray;
12 | import android.view.LayoutInflater;
13 | import android.view.MotionEvent;
14 | import android.view.View;
15 | import android.view.ViewGroup;
16 | import android.view.animation.AnimationUtils;
17 | import android.widget.CheckBox;
18 | import android.widget.ImageView;
19 | import android.widget.LinearLayout;
20 | import android.widget.TextView;
21 |
22 | import com.pithsoftware.wifipasswords.R;
23 | import com.pithsoftware.wifipasswords.extras.MyApplication;
24 | import com.pithsoftware.wifipasswords.pojo.WifiEntry;
25 |
26 | import java.util.ArrayList;
27 | import java.util.Collections;
28 | import java.util.List;
29 |
30 | import butterknife.Bind;
31 | import butterknife.ButterKnife;
32 |
33 |
34 | public class WifiListAdapter extends RecyclerView.Adapter
35 | implements ItemTouchHelperAdapter {
36 |
37 | private LayoutInflater layoutInflater;
38 | private List mListWifi;
39 | private ItemDragListener mDragListener;
40 | private boolean mShowDragHandler;
41 | private Context mContext;
42 | private SparseBooleanArray mSelectedItems = new SparseBooleanArray();
43 | private boolean mShowPublic = false;
44 | private static int mShowPassPosition = -1;
45 |
46 | public WifiListAdapter(Context context, ItemDragListener dragListener) {
47 | layoutInflater = LayoutInflater.from(context);
48 | mContext = context;
49 | mDragListener = dragListener;
50 | mListWifi = new ArrayList<>();
51 | mShowDragHandler = false;
52 | }
53 |
54 | @Override
55 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
56 | View view = layoutInflater.inflate(R.layout.wifi_entry_row, parent, false);
57 |
58 | return new MyViewHolder(view);
59 | }
60 |
61 |
62 | @Override
63 | public void onBindViewHolder(final MyViewHolder holder, int position) {
64 | WifiEntry currentEntry = mListWifi.get(position);
65 |
66 | holder.mTitle.setText(currentEntry.getTitle());
67 | holder.mCurrentInd.setChecked(currentEntry.getConnectedInd());
68 | holder.mPassword.setText(currentEntry.getPassword(!MyApplication.sHidePwd || (mShowPassPosition == position)));
69 | if (mShowPassPosition == position) {
70 | mShowPassPosition = -1;
71 | }
72 | holder.mTagText.setText(currentEntry.getTag());
73 |
74 |
75 | //Selected Background
76 | if (mSelectedItems.get(position, false)) {
77 | holder.mBackground.setBackgroundResource(R.color.colorHighlight);
78 | } else {
79 | if (PreferenceManager.getDefaultSharedPreferences(mContext)
80 | .getBoolean(mContext.getString(R.string.pref_dark_theme_key), false)) {
81 | holder.mBackground.setBackground(ResourcesCompat.getDrawable(mContext.getResources(),
82 | R.drawable.highlight_selected_dark, mContext.getTheme()));
83 | } else {
84 | holder.mBackground.setBackgroundResource(R.drawable.highlight_selected);
85 | }
86 | }
87 |
88 | //Drag Icon
89 | holder.mDragHandler.setOnTouchListener((v, event) -> {
90 | if (MotionEventCompat.getActionMasked(event) ==
91 | MotionEvent.ACTION_DOWN) {
92 | mDragListener.onStartDrag(holder);
93 | }
94 | return false;
95 | });
96 |
97 | //Tag & Drag Handler Visibility
98 | toggleTagAndDrag(holder);
99 | }
100 |
101 |
102 | @Override
103 | public int getItemCount() {
104 | return mListWifi.size();
105 | }
106 |
107 |
108 | public void setWifiList(ArrayList listWifi, boolean showPublic) {
109 | mShowPublic = showPublic;
110 | mListWifi = listWifi;
111 | // Clean up the list
112 | validateAllEntries();
113 | notifyDataSetChanged();
114 | }
115 |
116 | public String getItemPassword(int position) {
117 | WifiEntry thisEntry = mListWifi.get(position);
118 |
119 | if (thisEntry != null) {
120 | return thisEntry.getPassword(true);
121 | }
122 | return "";
123 | }
124 |
125 | public void showItemPassword(int position) {
126 | WifiEntry thisEntry = mListWifi.get(position);
127 |
128 | if (thisEntry != null) {
129 | mShowPassPosition = position;
130 | notifyItemRangeChanged(position, 1);
131 | }
132 | }
133 |
134 |
135 | private void toggleTagAndDrag(MyViewHolder holder) {
136 | if (mShowDragHandler) {
137 | holder.mDragHandler.setVisibility(View.VISIBLE);
138 | holder.mDragHandler.startAnimation(AnimationUtils.loadAnimation(mContext, R.anim.simple_grow));
139 | holder.mTagText.setVisibility(View.GONE);
140 |
141 | } else {
142 | holder.mDragHandler.setVisibility(View.GONE);
143 |
144 | if (!holder.mTagText.getText().toString().replace(" ", "").isEmpty()) {
145 | holder.mTagText.setVisibility(View.VISIBLE);
146 |
147 | } else {
148 | holder.mTagText.setVisibility(View.GONE);
149 | }
150 | }
151 | }
152 |
153 | /*******************************************************/
154 | /************ Contextual Action Mode Methods ***********/
155 | /*******************************************************/
156 |
157 | public void toggleSelection(int position) {
158 |
159 | if (mSelectedItems.get(position, false)) {
160 | mSelectedItems.delete(position);
161 | } else {
162 | mSelectedItems.put(position, true);
163 | }
164 | notifyItemChanged(position);
165 | }
166 |
167 | public void clearSelection() {
168 |
169 | mSelectedItems.clear();
170 | notifyDataSetChanged();
171 | }
172 |
173 | public ArrayList getSelectedItems() {
174 |
175 | ArrayList items = new ArrayList<>(mSelectedItems.size());
176 |
177 | for (int i = 0; i < mSelectedItems.size(); i++) {
178 | items.add(mSelectedItems.keyAt(i));
179 | }
180 | return items;
181 | }
182 |
183 | // Remove the entry if it's got a blank password, and "open networks" not checked.
184 | // tick the entry if it's the current connection.
185 | private int validateAllEntries() {
186 | int result = 0;
187 | String currentSSID = getWifiName();
188 | try {
189 | for (int i = mListWifi.size() - 1; i >= 0; i--) {
190 | WifiEntry thisEntry = mListWifi.get(i);
191 | if (!mShowPublic && thisEntry.getPassword(true).equals(MyApplication.NO_PASSWORD_TEXT)) {
192 | removeItem(i);
193 | result++;
194 | } else {
195 | String title = thisEntry.getTitle();
196 | thisEntry.setConnectedInd(title.equals(currentSSID));
197 | }
198 | }
199 | } catch (Exception error) {
200 | if (error != null) {
201 |
202 | }
203 | }
204 | return result;
205 | }
206 |
207 | private String getWifiName() {
208 | WifiManager manager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
209 | if (manager.isWifiEnabled()) {
210 | WifiInfo wifiInfo = manager.getConnectionInfo();
211 | if (wifiInfo != null) {
212 | NetworkInfo.DetailedState state = WifiInfo.getDetailedStateOf(wifiInfo.getSupplicantState());
213 | if (state == NetworkInfo.DetailedState.CONNECTED || state == NetworkInfo.DetailedState.OBTAINING_IPADDR) {
214 | String result = wifiInfo.getSSID();
215 | if (Character.toString(result.charAt(0)).equals("\"")) {
216 | result = result.substring(1, result.length() - 1);
217 | }
218 | return result;
219 | }
220 | }
221 | }
222 | return null;
223 | }
224 |
225 |
226 | /**********************************************/
227 | /************ Items Changes Methods ***********/
228 | /**********************************************/
229 |
230 | public WifiEntry removeItem(int position) {
231 |
232 | final WifiEntry entry = mListWifi.remove(position);
233 |
234 | if (mSelectedItems.get(position, false)) {
235 | mSelectedItems.delete(position);
236 | }
237 |
238 | notifyItemRemoved(position);
239 | return entry;
240 | }
241 |
242 | public void addItem(int position, WifiEntry entry) {
243 |
244 | mListWifi.add(position, entry);
245 | notifyItemInserted(position);
246 | }
247 |
248 | private void moveItem(int fromPosition, int toPosition) {
249 |
250 | final WifiEntry entry = mListWifi.remove(fromPosition);
251 | mListWifi.add(toPosition, entry);
252 | notifyItemMoved(fromPosition, toPosition);
253 | }
254 |
255 |
256 | /*********************************************/
257 | /************ Animate Search Query ***********/
258 | /*********************************************/
259 |
260 | public void animateTo(ArrayList listWifi) {
261 | //Order is important
262 | applyAndAnimateRemovals(listWifi);
263 | applyAndAnimateAdditions(listWifi);
264 | applyAndAnimateMovedItems(listWifi);
265 | }
266 |
267 | private void applyAndAnimateRemovals(ArrayList newListWifi) {
268 |
269 | for (int i = mListWifi.size() - 1; i >= 0; i--) {
270 | final WifiEntry entry = mListWifi.get(i);
271 | if (!newListWifi.contains(entry)) {
272 | removeItem(i);
273 | }
274 | }
275 | }
276 |
277 | private void applyAndAnimateAdditions(ArrayList newListWifi) {
278 |
279 | for (int i = 0, count = newListWifi.size(); i < count; i++) {
280 | final WifiEntry entry = newListWifi.get(i);
281 | if (!mListWifi.contains(entry)) {
282 | addItem(i, entry);
283 | }
284 | }
285 | }
286 |
287 | private void applyAndAnimateMovedItems(ArrayList newListWifi) {
288 |
289 | for (int toPosition = newListWifi.size() - 1; toPosition >= 0; toPosition--) {
290 | final WifiEntry entry = newListWifi.get(toPosition);
291 | final int fromPosition = mListWifi.indexOf(entry);
292 | if (fromPosition >= 0 && fromPosition != toPosition) {
293 | moveItem(fromPosition, toPosition);
294 | }
295 | }
296 | }
297 |
298 | /*****************************************************/
299 | /************** ItemTouchHelper Methods***************/
300 | /*****************************************************/
301 |
302 | @Override
303 | public boolean onItemMove(int fromPosition, int toPosition) {
304 |
305 | if (fromPosition < toPosition) {
306 | for (int i = fromPosition; i < toPosition; i++) {
307 | Collections.swap(mListWifi, i, i + 1);
308 | }
309 | } else {
310 | for (int i = fromPosition; i > toPosition; i--) {
311 | Collections.swap(mListWifi, i, i - 1);
312 | }
313 | }
314 | notifyItemMoved(fromPosition, toPosition);
315 |
316 | return true;
317 | }
318 |
319 | @Override
320 | public WifiEntry onItemDismiss(int position) {
321 |
322 | return removeItem(position);
323 | }
324 |
325 | public void showDragHandler(boolean show) {
326 | mShowDragHandler = show;
327 | notifyDataSetChanged();
328 | }
329 |
330 |
331 | /*****************************************/
332 | /********** View Holder Sub-Class ********/
333 | /*****************************************/
334 |
335 | class MyViewHolder extends RecyclerView.ViewHolder {
336 |
337 | @Bind(R.id.title_wifi)
338 | TextView mTitle;
339 | @Bind(R.id.current_wifi)
340 | CheckBox mCurrentInd;
341 | @Bind(R.id.password_wifi)
342 | TextView mPassword;
343 | @Bind(R.id.drag_handler)
344 | ImageView mDragHandler;
345 | @Bind(R.id.wifi_entry_layout)
346 | LinearLayout mBackground;
347 | @Bind(R.id.tag_wifi_text)
348 | TextView mTagText;
349 |
350 | MyViewHolder(View itemView) {
351 | super(itemView);
352 |
353 | ButterKnife.bind(this, itemView);
354 | }
355 | }
356 | }
357 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pithsoftware/wifipasswords/database/PasswordDB.java:
--------------------------------------------------------------------------------
1 | package com.pithsoftware.wifipasswords.database;
2 |
3 | import android.content.ContentValues;
4 | import android.content.Context;
5 | import android.database.Cursor;
6 | import android.database.sqlite.SQLiteDatabase;
7 | import android.database.sqlite.SQLiteException;
8 | import android.database.sqlite.SQLiteOpenHelper;
9 | import android.preference.PreferenceManager;
10 |
11 | import com.pithsoftware.wifipasswords.R;
12 | import com.pithsoftware.wifipasswords.extras.MyApplication;
13 | import com.pithsoftware.wifipasswords.pojo.WifiEntry;
14 |
15 | import java.util.ArrayList;
16 |
17 |
18 | public class PasswordDB {
19 |
20 | PasswordHelper mHelper;
21 | SQLiteDatabase mDatabase;
22 |
23 | public static int mNewEntriesOnLastInsert = 0;
24 |
25 |
26 | public PasswordDB(Context context) {
27 | mHelper = new PasswordHelper(context);
28 | mDatabase = mHelper.getWritableDatabase();
29 |
30 | }
31 |
32 | /******************************************************/
33 | /****************** Update Methods ********************/
34 | /******************************************************/
35 |
36 | public void updateWifiTags(ArrayList listWifi, String tag) {
37 |
38 | ContentValues values = new ContentValues();
39 |
40 | values.put(PasswordHelper.COLUMN_TAG, tag);
41 |
42 | String[] columns = new String[]{PasswordHelper.COLUMN_UID, PasswordHelper.COLUMN_TITLE};
43 | String selection = PasswordHelper.COLUMN_TITLE + " = ?";
44 | String[] selectionArgs = new String[listWifi.size()];
45 |
46 | for (int i = 0; i < selectionArgs.length; i++) {
47 |
48 | if (i > 0) {
49 | selection += " OR " + PasswordHelper.COLUMN_TITLE + " = ?";
50 | }
51 | selectionArgs[i] = listWifi.get(i).getTitle();
52 | }
53 |
54 |
55 | Cursor cursor = mDatabase.query(PasswordHelper.TABLE_MAIN, columns, selection, selectionArgs, null, null, null);
56 |
57 | if (cursor != null && cursor.moveToFirst()) {
58 |
59 | do {
60 |
61 | int id = cursor.getInt(cursor.getColumnIndex(PasswordHelper.COLUMN_UID));
62 | mDatabase.update(PasswordHelper.TABLE_MAIN, values, PasswordHelper.COLUMN_UID + " = ?", new String[]{id + ""});
63 |
64 | } while (cursor.moveToNext());
65 |
66 | cursor.close();
67 | }
68 |
69 |
70 | }
71 |
72 |
73 | /******************************************************/
74 | /****************** Insert Methods ********************/
75 | /******************************************************/
76 |
77 | public void insertWifiEntries(ArrayList listWifi, boolean updateTags, boolean archive) {
78 | mNewEntriesOnLastInsert = 0;
79 |
80 | String table = archive ? PasswordHelper.TABLE_ARCHIVE : PasswordHelper.TABLE_MAIN;
81 |
82 | ContentValues values = new ContentValues();
83 |
84 | String[] columns = new String[]{PasswordHelper.COLUMN_UID, PasswordHelper.COLUMN_TITLE};
85 | String selection = PasswordHelper.COLUMN_TITLE + " = ?";
86 |
87 | if ((listWifi != null) && (listWifi.size() > 0)) {
88 | for (int i = 0; i < listWifi.size(); i++) {
89 | WifiEntry current = listWifi.get(i);
90 |
91 | values.clear();
92 | values.put(PasswordHelper.COLUMN_TITLE, current.getTitle());
93 | values.put(PasswordHelper.COLUMN_PASSWORD, current.getPassword(true));
94 |
95 | if (updateTags) {
96 | values.put(PasswordHelper.COLUMN_TAG, current.getTag());
97 | }
98 |
99 | if (!archive) {
100 | //Main Table - Check for duplicates
101 | String[] selectionArgs = new String[]{current.getTitle()};
102 | Cursor cursor = mDatabase.query(table, columns, selection, selectionArgs, null, null, null);
103 |
104 | if (cursor.moveToFirst()) {
105 | String thisPassword = current.getPassword(true);
106 | if (!thisPassword.equalsIgnoreCase("")
107 | && !thisPassword.equals(MyApplication.NO_PASSWORD_TEXT)) {
108 | int id = cursor.getInt(cursor.getColumnIndex(PasswordHelper.COLUMN_UID));
109 | mDatabase.update(table, values, PasswordHelper.COLUMN_UID + " = ?", new String[]{id + ""});
110 | }
111 | } else {
112 | mDatabase.insert(table, null, values);
113 | mNewEntriesOnLastInsert++;
114 | }
115 |
116 | cursor.close();
117 |
118 | } else {
119 | mDatabase.insert(table, null, values);
120 | }
121 | }
122 | }
123 |
124 | }
125 |
126 |
127 | //Holds Deleted Wifi Entries
128 | public void insertDeleted(ArrayList listWifi) {
129 |
130 | ContentValues values = new ContentValues();
131 |
132 | for (int i = 0; i < listWifi.size(); i++) {
133 | WifiEntry current = listWifi.get(i);
134 |
135 | values.clear();
136 | values.put(PasswordHelper.COLUMN_TITLE, current.getTitle());
137 | values.put(PasswordHelper.COLUMN_PASSWORD, current.getPassword(true));
138 | values.put(PasswordHelper.COLUMN_TAG, current.getTag());
139 |
140 | mDatabase.insert(PasswordHelper.TABLE_DELETED, null, values);
141 | }
142 | }
143 |
144 | /***************************************************/
145 | /****************** Get Methods ********************/
146 | /***************************************************/
147 |
148 | public ArrayList getAllWifiEntries(boolean archive) {
149 |
150 | String table = archive ? PasswordHelper.TABLE_ARCHIVE : PasswordHelper.TABLE_MAIN;
151 |
152 | String selection;
153 |
154 | if (!archive) {
155 | selection = PasswordHelper.COLUMN_TITLE + " NOT IN (SELECT "
156 | + PasswordHelper.COLUMN_TITLE
157 | + " FROM " + PasswordHelper.TABLE_ARCHIVE + ")";
158 |
159 | } else {
160 | selection = PasswordHelper.COLUMN_TITLE + " NOT IN (SELECT "
161 | + PasswordHelper.COLUMN_TITLE
162 | + " FROM " + PasswordHelper.TABLE_DELETED + ")";
163 | }
164 |
165 | ArrayList listWifi = new ArrayList<>();
166 |
167 |
168 | Cursor cursor = mDatabase.query(table, null, selection, null, null, null, null);
169 |
170 | if (cursor != null && cursor.moveToFirst()) {
171 |
172 | do {
173 |
174 | WifiEntry wifiEntry = new WifiEntry();
175 |
176 | wifiEntry.setTitle(cursor.getString(cursor.getColumnIndex(PasswordHelper.COLUMN_TITLE)));
177 | wifiEntry.setPassword(cursor.getString(cursor.getColumnIndex(PasswordHelper.COLUMN_PASSWORD)));
178 |
179 | String tag = cursor.getString(cursor.getColumnIndex(PasswordHelper.COLUMN_TAG));
180 | wifiEntry.setTag(tag == null ? "" : tag);
181 |
182 | boolean showNoPassword = PreferenceManager.getDefaultSharedPreferences(mHelper.mContext)
183 | .getBoolean(mHelper.mContext.getString(R.string.pref_show_no_password_key), true);
184 |
185 | if (!wifiEntry.getPassword(true).equals(MyApplication.NO_PASSWORD_TEXT) || showNoPassword) {
186 | listWifi.add(wifiEntry);
187 | }
188 |
189 | } while (cursor.moveToNext());
190 |
191 | cursor.close();
192 | }
193 | return listWifi;
194 | }
195 |
196 | public ArrayList getWifiEntries(String whereClause, String[] whereArgs, boolean archive) {
197 |
198 | String table = archive ? PasswordHelper.TABLE_ARCHIVE : PasswordHelper.TABLE_MAIN;
199 |
200 | ArrayList listWifi = new ArrayList<>();
201 |
202 | Cursor cursor = mDatabase.query(table, null, whereClause, whereArgs, null, null, null);
203 |
204 | if (cursor != null && cursor.moveToFirst()) {
205 |
206 | do {
207 | WifiEntry entry = new WifiEntry();
208 |
209 | entry.setTitle(cursor.getString(cursor.getColumnIndex(PasswordHelper.COLUMN_TITLE)));
210 | entry.setPassword(cursor.getString(cursor.getColumnIndex(PasswordHelper.COLUMN_PASSWORD)));
211 | entry.setTag(cursor.getString(cursor.getColumnIndex(PasswordHelper.COLUMN_TAG)));
212 |
213 | listWifi.add(entry);
214 |
215 | } while (cursor.moveToNext());
216 |
217 | cursor.close();
218 | }
219 |
220 | return listWifi;
221 | }
222 |
223 | /******************************************************/
224 | /****************** Delete Methods ********************/
225 | /******************************************************/
226 |
227 | public void purgeDatabase() {
228 |
229 | deleteAll(false);
230 | deleteAll(true);
231 | mDatabase.delete(PasswordHelper.TABLE_DELETED, null, null);
232 | }
233 |
234 | public void deleteAll(boolean archive) {
235 |
236 | String table = archive ? PasswordHelper.TABLE_ARCHIVE : PasswordHelper.TABLE_MAIN;
237 |
238 | mDatabase.delete(table, null, null);
239 | }
240 |
241 |
242 | public void deleteWifiEntries(ArrayList listWifi, boolean archive) {
243 |
244 | String table = archive ? PasswordHelper.TABLE_ARCHIVE : PasswordHelper.TABLE_MAIN;
245 |
246 | String whereClause = PasswordHelper.COLUMN_TITLE + " = ?";
247 | String[] whereArgs;
248 |
249 | for (int i = 0; i < listWifi.size(); i++) {
250 | WifiEntry current = listWifi.get(i);
251 | whereArgs = new String[]{current.getTitle()};
252 | mDatabase.delete(table, whereClause, whereArgs);
253 | }
254 |
255 | }
256 |
257 | public void close() {
258 | mDatabase.close();
259 | }
260 |
261 |
262 | /*************************************************************/
263 | /****************** Database Helper Class ********************/
264 | /*************************************************************/
265 | public static class PasswordHelper extends SQLiteOpenHelper {
266 |
267 | public static final String DB_NAME = "passwords_db";
268 | public static final int DB_VERSION = 1;
269 |
270 | public static final String TABLE_MAIN = "passwords_main";
271 | public static final String TABLE_ARCHIVE = "passwords_archive";
272 | public static final String TABLE_DELETED = "passwords_deleted";
273 |
274 | public static final String COLUMN_UID = "id";
275 | public static final String COLUMN_TITLE = "title";
276 | public static final String COLUMN_PASSWORD = "password";
277 | public static final String COLUMN_TAG = "tag";
278 |
279 | public static final String CREATE_TABLE_MAIN = "CREATE TABLE " + TABLE_MAIN
280 | + " ("
281 | + COLUMN_UID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
282 | + COLUMN_TITLE + " TEXT UNIQUE,"
283 | + COLUMN_PASSWORD + " TEXT,"
284 | + COLUMN_TAG + " TEXT"
285 | + ");";
286 |
287 | public static final String CREATE_TABLE_ARCHIVE = "CREATE TABLE " + TABLE_ARCHIVE
288 | + " ("
289 | + COLUMN_UID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
290 | + COLUMN_TITLE + " TEXT UNIQUE,"
291 | + COLUMN_PASSWORD + " TEXT,"
292 | + COLUMN_TAG + " TEXT"
293 | + ");";
294 |
295 | public static final String CREATE_TABLE_DELETED = "CREATE TABLE " + TABLE_DELETED
296 | + " ("
297 | + COLUMN_UID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
298 | + COLUMN_TITLE + " TEXT UNIQUE,"
299 | + COLUMN_PASSWORD + " TEXT,"
300 | + COLUMN_TAG + " TEXT"
301 | + ");";
302 |
303 | private Context mContext;
304 |
305 |
306 | public PasswordHelper(Context context) {
307 | super(context, DB_NAME, null, DB_VERSION);
308 | mContext = context;
309 |
310 | }
311 |
312 | @Override
313 | public void onCreate(SQLiteDatabase db) {
314 |
315 | try {
316 | db.execSQL(CREATE_TABLE_MAIN);
317 | db.execSQL(CREATE_TABLE_ARCHIVE);
318 | db.execSQL(CREATE_TABLE_DELETED);
319 |
320 | } catch (SQLiteException e) {
321 | e.printStackTrace();
322 | }
323 |
324 | }
325 |
326 | @Override
327 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
328 |
329 | try {
330 | db.execSQL("DROP TABLE " + TABLE_MAIN + " IF EXISTS;");
331 | db.execSQL("DROP TABLE " + TABLE_ARCHIVE + " IF EXISTS;");
332 | db.execSQL("DROP TABLE " + TABLE_DELETED + " IF EXISTS;");
333 | onCreate(db);
334 |
335 | } catch (SQLiteException e) {
336 | e.printStackTrace();
337 | }
338 |
339 | }
340 | }
341 |
342 |
343 | }
344 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | NA
4 | Requesting Root Permission…
5 | Please select at least 1 wifi password
6 |
7 |
8 |
9 |
10 | Oreo Wifi Passwords
11 | Settings
12 | Intro
13 |
14 |
15 |
16 |
17 | Welcome to \nOreo Wifi Passwords
18 | Using this app you can save, tag & share your saved Wifi Passwords
19 |
20 | Be Careful!
21 | Sharing a Wifi Network\'s password can compromise its security
22 | \n\nDo so at your own discretion!
23 |
24 | Grant Root Permission
25 | The app requires Root Permission to access your device saved wifi passwords
26 |
27 | Quick Copy
28 | To quickly copy a wifi password, simply Double-Tap it.
29 |
30 | Tag, Copy, Share, Hide
31 | Long press a wifi password & choose your desired action
32 | \n\nYou can select multiple wifi passwords
33 |
34 | Thank you for choosing \nOreo Wifi Passwords
35 |
36 |
37 |
38 |
39 |
40 | Wifi info Copied to Clipboard
41 | Copied to Clipboard
42 | Dismiss
43 | Undo
44 | Updating list
45 | Wifi Password already exists!
46 | Wifi Password
47 | Wifi Passwords
48 | No Wifi Passwords
49 | Wifi without passwords added
50 | Wifi without passwords removed
51 | Wifi Passwords moved to top
52 |
53 | Tap once to select
54 |
55 |
56 |
57 |
58 | collapsing header
59 | Drag Icon
60 | Tag Icon
61 |
62 |
63 |
64 |
65 |
66 | Settings
67 | Add Entry
68 | Help & Feedback
69 | Share
70 | Search
71 | Sort List
72 | Done Sorting
73 |
74 |
75 |
76 |
77 |
78 | Tag
79 | Copy
80 | Share
81 | Delete
82 |
83 |
84 |
85 |
86 |
87 | General
88 | Appearance & Behavior
89 | Privacy
90 | Reset to Default
91 |
92 | /data/misc/wifi/wpa_supplicant.conf
93 | /data/misc/wifi/WifiConfigStore.xml
94 | pref_path_manual
95 | Manual Location
96 | pref_path_list
97 | File Location
98 |
99 | pref_path_checkbox
100 | Enter file location manually
101 |
102 | pref_reset_manual
103 | restore default path
104 | Reset Manual Location
105 |
106 | pref_default
107 | Reset Data
108 | Delete all the data and reload it from your device
109 |
110 | pref_hide_pass
111 | Hide password until tap
112 | Hide the passwords until you tap on the row.
113 |
114 | pref_share_warning
115 | Show Share Warning
116 | a warning before sharing WiFi passwords
117 |
118 | pref_show_no_password
119 | Show open WiFi networks
120 | list networks that don\'t have a password
121 |
122 | pref_dark_theme
123 | Dark Theme
124 | Cause the app to restart & apply theme
125 |
126 | auto_update_list
127 | Auto-Update frequency
128 | 1
129 | Update WiFi list Once a day
130 | Update Wifi list
131 |
132 | - Disabled
133 | - Once a day
134 | - Once a week
135 |
136 |
137 | - -1
138 | - 1
139 | - 7
140 |
141 |
142 |
143 |
144 |
145 |
146 | dialog_error
147 | Error!
148 | Could not find Wifi Password list \nWould you like to enter the path manually through settings?
149 |
150 | - Settings
151 | - Dismiss
152 |
153 |
154 | dialog_warning_reset
155 | Warning!
156 | Reloading data from device will erase current list
157 | \n(manually entered passwords will be lost)
158 |
159 | - Reload
160 | - Cancel
161 |
162 |
163 | dialog_exit
164 | Exit
165 | Are you sure you want to close \nOreo Wifi Passwords?
166 |
167 | - Yes
168 | - No
169 |
170 |
171 | dialog_delete
172 | Delete
173 | Are you sure? \n\nDeleting these passwords will permanently remove them from Oreo Wifi Passwords
174 |
175 | - Confirm
176 | - Cancel
177 |
178 |
179 | dialog_warning_share
180 | Warning!
181 | Sharing a Wifi password can compromise its security!
182 |
183 | - OK
184 | - Cancel
185 |
186 |
187 | dialog_error_root
188 | Error! No Root Permission!
189 |
190 | The app cannot access your saved wifi passwords without Root Permission
191 | \n\nYou may still add wifi passwords manually
192 | \n\n(To try again please grant this app Root permission and tap \"Update List\" in the options menu)
193 |
194 | - Dismiss
195 |
196 |
197 |
198 |
199 |
200 |
201 | dialog_input_add
202 | Title
203 | Password
204 | Add Wifi Password
205 | One or More fields are blank
206 | Title cannot be empty
207 | Password cannot be empty
208 |
209 | - Add
210 | - Cancel
211 |
212 |
213 | dialog_input_tag
214 | Modify Tag
215 | Tag cannot be empty
216 | Tag
217 | Save
218 |
219 |
220 | dialog_about
221 | Help & Feedback
222 | Wifi Passwords by Nexxado (+Oreo by David Mawer) - Send Feedback
223 | GitHub Repo
224 | Version:
225 | Version: ###
226 | External Libraries Used:
227 | Butter Knife by Jake Wharton
228 | Gradle Retrolambda Plugin by Evan Tatarka
229 | MaterialProgressBar by Zhang Hai
230 | AppIntro by Paolo Rotolo
231 | RippleEffect by Robin Chutaux
232 | RootShell by Stephen Ericson
233 | Get Help:
234 | Show Intro
235 | Readme
236 | OK
237 |
238 |
239 | Rate Wifi Passwords
240 | If you enjoy using this app, please take a moment to rate it.\nit won\'t take more than a minute.\nThanks for your support.
241 | Rate now
242 | Remind later
243 | No, thanks
244 |
245 |
246 |
247 |
--------------------------------------------------------------------------------