├── settings.gradle
├── app
├── src
│ └── main
│ │ ├── res
│ │ ├── drawable
│ │ │ ├── ic_italy.png
│ │ │ ├── header_day.png
│ │ │ ├── ic_poland.png
│ │ │ ├── header_night.png
│ │ │ ├── about_javiertoro.png
│ │ │ └── about_javiersantos.png
│ │ ├── drawable-hdpi
│ │ │ ├── ic_send.png
│ │ │ ├── ic_sort.png
│ │ │ ├── ic_star.png
│ │ │ ├── ic_android.png
│ │ │ ├── ic_archive.png
│ │ │ ├── ic_delete.png
│ │ │ ├── ic_person.png
│ │ │ ├── ic_search.png
│ │ │ ├── ic_settings.png
│ │ │ ├── ic_lock_open.png
│ │ │ ├── ic_visibility.png
│ │ │ ├── ic_filter_list.png
│ │ │ ├── ic_lock_outline.png
│ │ │ ├── ic_open_in_new.png
│ │ │ ├── ic_remove_circle.png
│ │ │ ├── ic_star_border.png
│ │ │ ├── ic_account_circle.png
│ │ │ ├── ic_visibility_off.png
│ │ │ └── ic_remove_circle_outline.png
│ │ ├── drawable-mdpi
│ │ │ ├── ic_send.png
│ │ │ ├── ic_sort.png
│ │ │ ├── ic_star.png
│ │ │ ├── ic_android.png
│ │ │ ├── ic_archive.png
│ │ │ ├── ic_delete.png
│ │ │ ├── ic_person.png
│ │ │ ├── ic_search.png
│ │ │ ├── ic_settings.png
│ │ │ ├── ic_lock_open.png
│ │ │ ├── ic_visibility.png
│ │ │ ├── ic_filter_list.png
│ │ │ ├── ic_lock_outline.png
│ │ │ ├── ic_open_in_new.png
│ │ │ ├── ic_remove_circle.png
│ │ │ ├── ic_star_border.png
│ │ │ ├── ic_account_circle.png
│ │ │ ├── ic_visibility_off.png
│ │ │ └── ic_remove_circle_outline.png
│ │ ├── drawable-xhdpi
│ │ │ ├── ic_send.png
│ │ │ ├── ic_sort.png
│ │ │ ├── ic_star.png
│ │ │ ├── ic_android.png
│ │ │ ├── ic_archive.png
│ │ │ ├── ic_delete.png
│ │ │ ├── ic_person.png
│ │ │ ├── ic_search.png
│ │ │ ├── ic_lock_open.png
│ │ │ ├── ic_settings.png
│ │ │ ├── ic_filter_list.png
│ │ │ ├── ic_lock_outline.png
│ │ │ ├── ic_open_in_new.png
│ │ │ ├── ic_star_border.png
│ │ │ ├── ic_visibility.png
│ │ │ ├── ic_account_circle.png
│ │ │ ├── ic_remove_circle.png
│ │ │ ├── ic_visibility_off.png
│ │ │ └── ic_remove_circle_outline.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── ic_delete.png
│ │ │ ├── ic_person.png
│ │ │ ├── ic_search.png
│ │ │ ├── ic_send.png
│ │ │ ├── ic_sort.png
│ │ │ ├── ic_star.png
│ │ │ ├── ic_android.png
│ │ │ ├── ic_archive.png
│ │ │ ├── ic_settings.png
│ │ │ ├── ic_filter_list.png
│ │ │ ├── ic_lock_open.png
│ │ │ ├── ic_open_in_new.png
│ │ │ ├── ic_star_border.png
│ │ │ ├── ic_visibility.png
│ │ │ ├── ic_lock_outline.png
│ │ │ ├── ic_remove_circle.png
│ │ │ ├── ic_account_circle.png
│ │ │ ├── ic_visibility_off.png
│ │ │ └── ic_remove_circle_outline.png
│ │ ├── drawable-xxxhdpi
│ │ │ ├── ic_send.png
│ │ │ ├── ic_sort.png
│ │ │ ├── ic_star.png
│ │ │ ├── ic_android.png
│ │ │ ├── ic_archive.png
│ │ │ ├── ic_delete.png
│ │ │ ├── ic_person.png
│ │ │ ├── ic_search.png
│ │ │ ├── ic_lock_open.png
│ │ │ ├── ic_settings.png
│ │ │ ├── ic_visibility.png
│ │ │ ├── ic_filter_list.png
│ │ │ ├── ic_lock_outline.png
│ │ │ ├── ic_open_in_new.png
│ │ │ ├── ic_star_border.png
│ │ │ ├── ic_account_circle.png
│ │ │ ├── ic_remove_circle.png
│ │ │ ├── ic_visibility_off.png
│ │ │ └── ic_remove_circle_outline.png
│ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── xml
│ │ │ ├── search.xml
│ │ │ └── settings.xml
│ │ ├── anim
│ │ │ ├── slide_in_right.xml
│ │ │ ├── slide_out_right.xml
│ │ │ ├── fade_back.xml
│ │ │ └── fade_forward.xml
│ │ ├── layout
│ │ │ ├── view_toolbar.xml
│ │ │ ├── activity_settings.xml
│ │ │ ├── view_information.xml
│ │ │ ├── view_quick_actions.xml
│ │ │ ├── view_button.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── view_button_switch.xml
│ │ │ ├── activity_storage.xml
│ │ │ ├── activity_app.xml
│ │ │ ├── adapter_app.xml
│ │ │ └── activity_about.xml
│ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ ├── menu
│ │ │ ├── menu_app.xml
│ │ │ └── menu_main.xml
│ │ ├── values
│ │ │ ├── dimens.xml
│ │ │ ├── arrays.xml
│ │ │ ├── colors.xml
│ │ │ ├── styles.xml
│ │ │ └── strings.xml
│ │ ├── values-v21
│ │ │ └── styles.xml
│ │ ├── values-pl
│ │ │ └── strings.xml
│ │ ├── values-ja
│ │ │ └── strings.xml
│ │ ├── values-pt
│ │ │ └── strings.xml
│ │ ├── values-es
│ │ │ └── strings.xml
│ │ ├── values-zh-rTW
│ │ │ └── strings.xml
│ │ ├── values-ro
│ │ │ └── strings.xml
│ │ ├── values-ru
│ │ │ └── strings.xml
│ │ └── values-it
│ │ │ └── strings.xml
│ │ ├── java
│ │ └── com
│ │ │ └── dkanada
│ │ │ └── openapk
│ │ │ ├── interfaces
│ │ │ └── PackageStatsListener.java
│ │ │ ├── views
│ │ │ ├── InformationView.java
│ │ │ ├── ButtonSwitchView.java
│ │ │ └── ButtonView.java
│ │ │ ├── activities
│ │ │ ├── ThemeActivity.java
│ │ │ ├── SettingsActivity.java
│ │ │ ├── AboutActivity.java
│ │ │ ├── StorageActivity.java
│ │ │ └── AppActivity.java
│ │ │ ├── App.java
│ │ │ ├── async
│ │ │ ├── DeleteFileAsync.java
│ │ │ └── CopyFileAsync.java
│ │ │ ├── utils
│ │ │ ├── PackageList.java
│ │ │ ├── PackageStatsHelper.java
│ │ │ ├── DialogUtils.java
│ │ │ ├── AppPreferences.java
│ │ │ ├── FileOperations.java
│ │ │ ├── ShellCommands.java
│ │ │ ├── OtherUtils.java
│ │ │ └── Actions.java
│ │ │ ├── models
│ │ │ └── AppItem.java
│ │ │ ├── fragments
│ │ │ └── SettingsFragment.java
│ │ │ └── adapters
│ │ │ └── AppAdapter.java
│ │ ├── aidl
│ │ └── android
│ │ │ └── content
│ │ │ └── pm
│ │ │ ├── PackageStats.aidl
│ │ │ └── IPackageStatsObserver.aidl
│ │ └── AndroidManifest.xml
└── build.gradle
├── .gitignore
├── docs
└── launcher.svg
├── README.md
└── CHANGELOG.md
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_italy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable/ic_italy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/header_day.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable/header_day.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_poland.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable/ic_poland.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_send.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_sort.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_send.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_sort.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_send.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_sort.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/header_night.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable/header_night.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_android.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_archive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_archive.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_android.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_archive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_archive.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_android.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_archive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_archive.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_send.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_sort.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_send.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_sort.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/about_javiertoro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable/about_javiertoro.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_lock_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_visibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_visibility.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_lock_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_visibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_visibility.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_lock_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_android.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_archive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_archive.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_android.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_archive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_archive.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/about_javiersantos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable/about_javiersantos.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_filter_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_filter_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_lock_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_lock_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_open_in_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_open_in_new.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_remove_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_remove_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_star_border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_star_border.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_filter_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_filter_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_lock_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_lock_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_open_in_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_open_in_new.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_remove_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_remove_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_star_border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_star_border.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_filter_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_filter_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_lock_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_lock_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_open_in_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_open_in_new.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_star_border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_star_border.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_visibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_visibility.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_filter_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_filter_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_lock_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_open_in_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_open_in_new.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_star_border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_star_border.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_visibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_visibility.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_lock_open.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_visibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_visibility.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_account_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_account_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_visibility_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_visibility_off.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_account_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_account_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_visibility_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_visibility_off.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_account_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_account_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_remove_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_remove_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_visibility_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_visibility_off.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_lock_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_lock_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_remove_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_remove_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_filter_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_filter_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_lock_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_lock_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_open_in_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_open_in_new.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_star_border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_star_border.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_account_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_account_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_visibility_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_visibility_off.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_account_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_account_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_remove_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_remove_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_visibility_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_visibility_off.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_remove_circle_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-hdpi/ic_remove_circle_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_remove_circle_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-mdpi/ic_remove_circle_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_remove_circle_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xhdpi/ic_remove_circle_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_remove_circle_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxhdpi/ic_remove_circle_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_remove_circle_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dkanada/openapk/HEAD/app/src/main/res/drawable-xxxhdpi/ic_remove_circle_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/xml/search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/interfaces/PackageStatsListener.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.interfaces;
2 |
3 | import android.content.pm.PackageStats;
4 |
5 | public interface PackageStatsListener {
6 | void onPackageStats(PackageStats packageStats);
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.apk
3 | *.class
4 | *.db
5 | *.log
6 | *.dex
7 | *.pro
8 | *.yml
9 |
10 | bin/
11 | build/
12 | gen/
13 | proguard/
14 | androidTest/
15 | test/
16 | gradle/
17 |
18 | .idea/
19 | .externalNativeBuild/
20 | .gradle/
21 |
22 | local.properties
23 | gradle.properties
24 | gradlew
25 | gradlew.bat
26 |
--------------------------------------------------------------------------------
/docs/launcher.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_app.xml:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 | 16dp
9 | 20dp
10 | 22dp
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_forward.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/aidl/android/content/pm/PackageStats.aidl:
--------------------------------------------------------------------------------
1 | /* //device/java/android/android/view/WindowManager.aidl
2 | **
3 | ** Copyright 2007, The Android Open Source Project
4 | **
5 | ** Licensed under the Apache License, Version 2.0 (the "License");
6 | ** you may not use this file except in compliance with the License.
7 | ** You may obtain a copy of the License at
8 | **
9 | ** http://www.apache.org/licenses/LICENSE-2.0
10 | **
11 | ** Unless required by applicable law or agreed to in writing, software
12 | ** distributed under the License is distributed on an "AS IS" BASIS,
13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | ** See the License for the specific language governing permissions and
15 | ** limitations under the License.
16 | */
17 |
18 | package android.content.pm;
19 |
20 | parcelable PackageStats;
21 |
--------------------------------------------------------------------------------
/app/src/main/aidl/android/content/pm/IPackageStatsObserver.aidl:
--------------------------------------------------------------------------------
1 | /*
2 | **
3 | ** Copyright 2007, The Android Open Source Project
4 | **
5 | ** Licensed under the Apache License, Version 2.0 (the "License");
6 | ** you may not use this file except in compliance with the License.
7 | ** You may obtain a copy of the License at
8 | **
9 | ** http://www.apache.org/licenses/LICENSE-2.0
10 | **
11 | ** Unless required by applicable law or agreed to in writing, software
12 | ** distributed under the License is distributed on an "AS IS" BASIS,
13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | ** See the License for the specific language governing permissions and
15 | ** limitations under the License.
16 | */
17 |
18 | package android.content.pm;
19 |
20 | import android.content.pm.PackageStats;
21 |
22 | /**
23 | * API for package data change related callbacks from the Package Manager.
24 | * Some usage scenarios include deletion of cache directory, generate
25 | * statistics related to code, data, cache usage(TODO)
26 | * {@hide}
27 | */
28 |
29 | oneway interface IPackageStatsObserver {
30 | void onGetStatsCompleted(in PackageStats pStats, boolean succeeded);
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_information.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - @string/layout_package
6 | - @string/layout_label
7 |
8 |
9 |
10 | - 0
11 | - 1
12 |
13 |
14 |
15 | - @string/layout_label
16 | - @string/layout_package
17 | - @string/layout_install
18 | - @string/layout_update
19 |
20 |
21 |
22 | - 0
23 | - 1
24 | - 2
25 | - 3
26 |
27 |
28 |
29 | - @string/light
30 | - @string/dark
31 |
32 |
33 |
34 | - 0
35 | - 1
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/views/InformationView.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.views;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.RelativeLayout;
7 | import android.widget.TextView;
8 |
9 | import com.dkanada.openapk.App;
10 | import com.dkanada.openapk.R;
11 |
12 | public class InformationView extends RelativeLayout {
13 | public InformationView(Context context, String title, String summary, boolean alternate) {
14 | super(context);
15 |
16 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
17 | View view = inflater.inflate(R.layout.view_information, null);
18 | addView(view);
19 |
20 | TextView titleView = (TextView) view.findViewById(R.id.title);
21 | TextView summaryView = (TextView) view.findViewById(R.id.summary);
22 | titleView.setText(title);
23 | summaryView.setText(summary);
24 |
25 | if (App.getAppPreferences().getTheme().equals("0") && alternate) {
26 | setBackgroundColor(getResources().getColor(R.color.grey_one));
27 | } else if (alternate) {
28 | setBackgroundColor(getResources().getColor(R.color.grey_three));
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/activities/ThemeActivity.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.activities;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.dkanada.openapk.App;
8 | import com.dkanada.openapk.R;
9 | import com.dkanada.openapk.utils.AppPreferences;
10 |
11 | public abstract class ThemeActivity extends AppCompatActivity {
12 |
13 | private AppPreferences appPreferences;
14 | private String currentTheme;
15 |
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | appPreferences = App.getAppPreferences();
19 | currentTheme = appPreferences.getTheme();
20 | if (appPreferences.getTheme().equals("0")) {
21 | setTheme(R.style.Light);
22 | } else {
23 | setTheme(R.style.Dark);
24 | setTheme(R.style.DrawerDark);
25 | }
26 | super.onCreate(savedInstanceState);
27 | }
28 |
29 | @Override
30 | protected void onResume() {
31 | super.onResume();
32 | if (!appPreferences.getTheme().equals(currentTheme)) {
33 | restart();
34 | }
35 | }
36 |
37 | protected void restart() {
38 | Intent intent = new Intent(this, getClass());
39 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
40 | overridePendingTransition(0, 0);
41 | startActivity(intent);
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/App.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk;
2 |
3 | import android.app.Application;
4 | import android.content.pm.PackageInfo;
5 | import android.content.pm.PackageManager;
6 | import android.graphics.drawable.Drawable;
7 |
8 | import com.dkanada.openapk.utils.AppPreferences;
9 | import com.mikepenz.google_material_typeface_library.GoogleMaterial;
10 | import com.mikepenz.iconics.Iconics;
11 |
12 | public class App extends Application {
13 | private static AppPreferences appPreferences;
14 | private static PackageManager packageManager;
15 | private static int currentAdapter;
16 |
17 | @Override
18 | public void onCreate() {
19 | super.onCreate();
20 |
21 | // set fields
22 | appPreferences = new AppPreferences(this);
23 | packageManager = getPackageManager();
24 | currentAdapter = 0;
25 |
26 | // register custom fonts
27 | Iconics.registerFont(new GoogleMaterial());
28 | }
29 |
30 | public static AppPreferences getAppPreferences() {
31 | return appPreferences;
32 | }
33 |
34 | public static String getPackageName(PackageInfo packageInfo) {
35 | return packageManager.getApplicationLabel(packageInfo.applicationInfo).toString();
36 | }
37 |
38 | public static Drawable getPackageIcon(PackageInfo packageInfo) {
39 | return packageManager.getApplicationIcon(packageInfo.applicationInfo);
40 | }
41 |
42 | public static int getCurrentAdapter() {
43 | return currentAdapter;
44 | }
45 |
46 | public static void setCurrentAdapter(int value) {
47 | currentAdapter = value;
48 | }
49 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/views/ButtonSwitchView.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.views;
2 |
3 | import android.content.Context;
4 | import android.support.constraint.ConstraintLayout;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 | import android.widget.TextView;
9 |
10 | import com.dkanada.openapk.App;
11 | import com.dkanada.openapk.R;
12 |
13 | public class ButtonSwitchView extends ConstraintLayout {
14 | public ButtonSwitchView(Context context, String title, String summary, View object) {
15 | super(context);
16 |
17 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
18 | View view = inflater.inflate(R.layout.view_button_switch, null);
19 | addView(view);
20 |
21 | LinearLayout container = (LinearLayout) findViewById(R.id.container);
22 | container.addView(object);
23 |
24 | TextView titleView = (TextView) view.findViewById(R.id.title);
25 | TextView summaryView = (TextView) view.findViewById(R.id.summary);
26 | titleView.setText(title);
27 | if (summary == null) {
28 | summaryView.setVisibility(GONE);
29 | } else {
30 | summaryView.setText(summary);
31 | }
32 |
33 | View divider = findViewById(R.id.divider);
34 | if (App.getAppPreferences().getTheme().equals("0")) {
35 | divider.setBackgroundColor(getResources().getColor(R.color.grey_one));
36 | } else {
37 | divider.setBackgroundColor(getResources().getColor(R.color.grey_three));
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/async/DeleteFileAsync.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.async;
2 |
3 | import android.content.Context;
4 | import android.os.AsyncTask;
5 |
6 | import com.afollestad.materialdialogs.MaterialDialog;
7 | import com.dkanada.openapk.R;
8 | import com.dkanada.openapk.utils.DialogUtils;
9 | import com.dkanada.openapk.utils.OtherUtils;
10 | import com.dkanada.openapk.utils.ShellCommands;
11 |
12 | public class DeleteFileAsync extends AsyncTask {
13 | private Context context;
14 | private MaterialDialog dialog;
15 | private String source;
16 |
17 | public DeleteFileAsync(Context context, MaterialDialog dialog, String source) {
18 | this.context = context;
19 | this.dialog = dialog;
20 | this.source = source;
21 | }
22 |
23 | @Override
24 | protected Boolean doInBackground(Void... voids) {
25 | Boolean status = false;
26 | if (OtherUtils.checkPermissions(context) && ShellCommands.isRoot()) {
27 | status = ShellCommands.rmDataPartition(source);
28 | }
29 | return status;
30 | }
31 |
32 | @Override
33 | protected void onPostExecute(Boolean status) {
34 | super.onPostExecute(status);
35 | dialog.dismiss();
36 | if (!ShellCommands.isRoot()) {
37 | DialogUtils.dialogMessage(context, context.getResources().getString(R.string.dialog_root_required), context.getResources().getString(R.string.dialog_root_required_description));
38 | } else if (!status) {
39 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #3F51B5
5 | #303F9F
6 | #1976D2
7 |
8 | #212121
9 | #FAFAFA
10 |
11 | #E0E0E0
12 | #424242
13 |
14 | #FFFFFF
15 | #00BED4
16 | #8CC24A
17 | #DE6262
18 | #FF7043
19 | #BDBDBD
20 | #616161
21 | #424242
22 | #212121
23 |
24 |
25 | @color/text_dark
26 | @color/text_dark
27 | @color/text_dark
28 | @color/text_dark
29 | @color/grey_two
30 |
31 |
32 | @color/md_dark_background
33 | @color/grey_four
34 | @color/text_dark
35 | @color/md_dark_background
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_quick_actions.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
31 |
32 |
39 |
40 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/async/CopyFileAsync.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.async;
2 |
3 | import android.content.Context;
4 | import android.os.AsyncTask;
5 |
6 | import com.afollestad.materialdialogs.MaterialDialog;
7 | import com.dkanada.openapk.R;
8 | import com.dkanada.openapk.utils.DialogUtils;
9 | import com.dkanada.openapk.utils.OtherUtils;
10 | import com.dkanada.openapk.utils.ShellCommands;
11 |
12 | public class CopyFileAsync extends AsyncTask {
13 | private Context context;
14 | private MaterialDialog dialog;
15 | private String source;
16 | private String destination;
17 |
18 | public CopyFileAsync(Context context, MaterialDialog dialog, String source, String destination) {
19 | this.context = context;
20 | this.dialog = dialog;
21 | this.source = source;
22 | this.destination = destination;
23 | }
24 |
25 | @Override
26 | protected Boolean doInBackground(Void... voids) {
27 | Boolean status = false;
28 | if (OtherUtils.checkPermissions(context) && ShellCommands.isRoot()) {
29 | status = ShellCommands.cpDataPartition(source, destination);
30 | }
31 | return status;
32 | }
33 |
34 | @Override
35 | protected void onPostExecute(Boolean status) {
36 | super.onPostExecute(status);
37 | dialog.dismiss();
38 | if (!ShellCommands.isRoot()) {
39 | DialogUtils.dialogMessage(context, context.getResources().getString(R.string.dialog_root_required), context.getResources().getString(R.string.dialog_root_required_description));
40 | } else if (!status) {
41 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/PackageList.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.content.Context;
4 |
5 | import com.dkanada.openapk.models.AppItem;
6 | import com.google.gson.Gson;
7 | import com.google.gson.stream.JsonReader;
8 |
9 | import java.io.File;
10 | import java.io.FileInputStream;
11 | import java.io.IOException;
12 | import java.io.InputStreamReader;
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | public class PackageList {
17 | private Context context;
18 |
19 | public PackageList(Context context) {
20 | this.context = context;
21 | }
22 |
23 | public List getHiddenList() {
24 | return getAppList(context.getCacheDir().toString() + "/hidden");
25 | }
26 |
27 | public void setHiddenList(List appList) {
28 | setAppList(context.getCacheDir().toString() + "/hidden", appList);
29 | }
30 |
31 | public List getAppList(String folder) {
32 | List appList = new ArrayList<>();
33 | File file = new File(folder);
34 | /*try {
35 | JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(folder)));
36 | reader.beginArray();
37 | while (reader.hasNext()) {
38 | Gson gson = new Gson();
39 | appList.add((AppItem) gson.fromJson(reader, AppItem.class));
40 | }
41 | } catch (IOException e) {
42 | e.printStackTrace();
43 | }*/
44 | return appList;
45 | }
46 |
47 | public void setAppList(String file, List appList) {
48 | Gson gson = new Gson();
49 | String content = gson.toJson(appList);
50 | FileOperations.writeToFile(context, file, content);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/views/ButtonView.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.views;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.RelativeLayout;
7 | import android.widget.TextView;
8 |
9 | import com.dkanada.openapk.App;
10 | import com.dkanada.openapk.R;
11 |
12 | public class ButtonView extends RelativeLayout {
13 | public ButtonView(Context context, String title, String summary, OnClickListener onClickListener) {
14 | super(context);
15 | this.setOnClickListener(onClickListener);
16 |
17 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
18 | View view = inflater.inflate(R.layout.view_button, null);
19 | addView(view);
20 |
21 | TextView titleView = (TextView) view.findViewById(R.id.title);
22 | TextView summaryView = (TextView) view.findViewById(R.id.summary);
23 | titleView.setText(title);
24 | if (summary == null) {
25 | summaryView.setVisibility(GONE);
26 | } else {
27 | summaryView.setText(summary);
28 | }
29 |
30 | View dividerTop = findViewById(R.id.divider_top);
31 | View dividerBottom = findViewById(R.id.divider_bottom);
32 | if (App.getAppPreferences().getTheme().equals("0")) {
33 | dividerTop.setBackgroundColor(getResources().getColor(R.color.grey_one));
34 | dividerBottom.setBackgroundColor(getResources().getColor(R.color.grey_one));
35 | } else {
36 | dividerTop.setBackgroundColor(getResources().getColor(R.color.grey_three));
37 | dividerBottom.setBackgroundColor(getResources().getColor(R.color.grey_three));
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion '25.0.3'
6 |
7 | defaultConfig {
8 | minSdkVersion 23
9 | targetSdkVersion 25
10 | versionCode 35
11 | versionName "1.2.1"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | debug {
20 | versionNameSuffix '-debug'
21 | }
22 | }
23 |
24 | lintOptions {
25 | disable 'MissingTranslation'
26 | }
27 |
28 | packagingOptions {
29 | exclude 'META-INF/LICENSE.txt'
30 | exclude 'META-INF/NOTICE.txt'
31 | }
32 | }
33 |
34 | repositories {
35 | mavenCentral()
36 | maven { url "https://jitpack.io" }
37 | }
38 |
39 | dependencies {
40 | compile fileTree(dir: 'libs', include: ['*.jar'])
41 | compile 'com.android.support:appcompat-v7:25.3.1'
42 | compile 'com.android.support:recyclerview-v7:25.3.1'
43 | compile 'com.android.support:cardview-v7:25.3.1'
44 | compile 'com.android.support:support-v4:25.3.1'
45 | compile 'commons-io:commons-io:2.4'
46 | compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
47 | compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') { transitive = true; }
48 | compile('com.github.afollestad.material-dialogs:commons:0.8.5.3@aar') { transitive = true; }
49 | compile('com.mikepenz:materialdrawer:4.6.1@aar') { transitive = true; }
50 | compile 'com.mikepenz:google-material-typeface:1.2.0.1@aar'
51 | compile 'com.jaredrummler:colorpicker:1.0.0'
52 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
53 | compile 'com.google.code.gson:gson:2.8.0'
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/PackageStatsHelper.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.pm.IPackageStatsObserver;
6 | import android.content.pm.PackageInfo;
7 | import android.content.pm.PackageManager;
8 | import android.content.pm.PackageStats;
9 | import android.os.RemoteException;
10 |
11 | import com.dkanada.openapk.interfaces.PackageStatsListener;
12 |
13 | import java.lang.reflect.InvocationTargetException;
14 | import java.lang.reflect.Method;
15 |
16 | public class PackageStatsHelper {
17 | public static void getPackageStats(Context context, PackageInfo packageInfo, final PackageStatsListener packageStatsListener) {
18 | try {
19 | final Activity activity = (Activity) context;
20 | Method getPackageSize = PackageManager.class.getMethod("getPackageSizeInfo", String.class, IPackageStatsObserver.class);
21 | getPackageSize.invoke(context.getPackageManager(), packageInfo.applicationInfo.packageName, new IPackageStatsObserver.Stub() {
22 | @Override
23 | public void onGetStatsCompleted(final android.content.pm.PackageStats pStats, final boolean succeeded) throws RemoteException {
24 | activity.runOnUiThread(new Runnable() {
25 | @Override
26 | public void run() {
27 | packageStatsListener.onPackageStats(pStats);
28 | }
29 | });
30 | }
31 | });
32 | } catch (NoSuchMethodException e) {
33 | e.printStackTrace();
34 | } catch (IllegalAccessException e) {
35 | e.printStackTrace();
36 | } catch (InvocationTargetException e) {
37 | e.printStackTrace();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
27 |
28 |
32 |
33 |
37 |
38 |
39 |
40 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
14 |
15 |
22 |
23 |
28 |
29 |
35 |
36 |
37 |
38 |
42 |
43 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_button_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
19 |
20 |
24 |
25 |
29 |
30 |
31 |
32 |
41 |
42 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/activities/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.activities;
2 |
3 | import android.app.FragmentManager;
4 | import android.app.FragmentTransaction;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 | import android.view.WindowManager;
10 |
11 | import com.dkanada.openapk.App;
12 | import com.dkanada.openapk.R;
13 | import com.dkanada.openapk.fragments.SettingsFragment;
14 | import com.dkanada.openapk.utils.AppPreferences;
15 | import com.dkanada.openapk.utils.OtherUtils;
16 |
17 | public class SettingsActivity extends ThemeActivity {
18 | @Override
19 | public void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_settings);
22 |
23 | setInitialConfiguration();
24 |
25 | FragmentManager fragmentManager = getFragmentManager();
26 | FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
27 | SettingsFragment fragment = new SettingsFragment();
28 | fragmentTransaction.add(R.id.fragment_container, fragment);
29 | fragmentTransaction.commit();
30 | }
31 |
32 | private void setInitialConfiguration() {
33 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
34 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
35 | @Override
36 | public void onClick(View view) {
37 | onBackPressed();
38 | }
39 | });
40 | toolbar.setBackgroundColor(AppPreferences.get(this).getPrimaryColor());
41 |
42 | setSupportActionBar(toolbar);
43 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
44 | getSupportActionBar().setTitle(R.string.settings);
45 |
46 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
47 | getWindow().setStatusBarColor(OtherUtils.dark(AppPreferences.get(this).getPrimaryColor(), 0.8));
48 | getWindow().setNavigationBarColor(AppPreferences.get(this).getPrimaryColor());
49 | }
50 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | OpenAPK
2 |
3 | 
4 | A modern, easy and customizable app manager for Android with root features and material design.
5 |
6 | This is a fork of MLManager 1.X made by Javier Santos, which is now unmaintained. If you have any ideas or feature requests add them to the issues page. Pull requests are welcome and a materialized app icon would be great from someone who knows how to create svg files.
7 |
8 |
9 |
10 | ## Features
11 | * Extract installed or system apps and save them locally.
12 | * Organize your applications and mark them as favorites.
13 | * Easily uninstall apps.
14 | * Customizations available in the settings.
15 | * No root required.
16 | * Material design interface.
17 |
18 | ## Root Features
19 | * Hide or disable apps from the device launcher.
20 | * Remove the cache for apps or remove all the data entirely.
21 | * Uninstall system apps.
22 |
23 | ## Translations
24 | Currently supported languages:
25 | * English
26 | * Spanish
27 | * Japanese
28 | * Portuguese
29 | * Italian
30 | * Polish
31 | * Russian
32 |
33 | ## Third Party Libraries
34 | * [Material Design Library](https://github.com/navasmdc/MaterialDesignLibrary)
35 | * [Material Dialogs](https://github.com/afollestad/material-dialogs)
36 | * [Material Drawer](https://github.com/mikepenz/MaterialDrawer)
37 |
38 | ## License
39 |
40 | Copyright 2015 Javier Santos
41 |
42 | This program is free software: you can redistribute it and/or modify
43 | it under the terms of the GNU General Public License as published by
44 | the Free Software Foundation, either version 3 of the License, or
45 | (at your option) any later version.
46 |
47 | This program is distributed in the hope that it will be useful,
48 | but WITHOUT ANY WARRANTY; without even the implied warranty of
49 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 | GNU General Public License for more details.
51 |
52 | You should have received a copy of the GNU General Public License
53 | along with this program. If not, see .
54 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
22 |
23 |
28 |
29 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/activities/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.activities;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.content.ContextCompat;
5 | import android.support.v7.widget.Toolbar;
6 | import android.view.View;
7 | import android.view.WindowManager;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.dkanada.openapk.R;
12 | import com.dkanada.openapk.utils.AppPreferences;
13 | import com.dkanada.openapk.utils.OtherUtils;
14 |
15 | public class AboutActivity extends ThemeActivity {
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_about);
20 |
21 | setInitialConfiguration();
22 | setScreenElements();
23 | }
24 |
25 | private void setInitialConfiguration() {
26 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
27 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View view) {
30 | onBackPressed();
31 | }
32 | });
33 | toolbar.setBackgroundColor(AppPreferences.get(this).getPrimaryColor());
34 |
35 | setSupportActionBar(toolbar);
36 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
37 | getSupportActionBar().setTitle(R.string.about);
38 |
39 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
40 | getWindow().setStatusBarColor(OtherUtils.dark(AppPreferences.get(this).getPrimaryColor(), 0.8));
41 | getWindow().setNavigationBarColor(AppPreferences.get(this).getPrimaryColor());
42 | }
43 |
44 | private void setScreenElements() {
45 | TextView header = (TextView) findViewById(R.id.header);
46 | TextView text = (TextView) findViewById(R.id.app_name);
47 | ImageView icon = (ImageView) findViewById(R.id.about_icon);
48 |
49 | header.setBackgroundColor(AppPreferences.get(this).getPrimaryColor());
50 | text.setText(String.format("%s %s", getResources().getString(R.string.app_name), OtherUtils.getAppVersionName(getApplicationContext())));
51 | if (AppPreferences.get(this).getTheme().equals("0")) {
52 | icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.grey_two));
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_storage.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
13 |
14 |
18 |
19 |
29 |
30 |
36 |
37 |
48 |
49 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/DialogUtils.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.view.View;
6 |
7 | import com.afollestad.materialdialogs.MaterialDialog;
8 | import com.dkanada.openapk.App;
9 | import com.gc.materialdesign.widgets.SnackBar;
10 | import com.dkanada.openapk.R;
11 |
12 | public class DialogUtils {
13 | public static MaterialDialog dialogMessage(Context context, String title, String content) {
14 | return dialogFixBackground(context, new MaterialDialog.Builder(context)
15 | .title(title)
16 | .content(content)
17 | .cancelable(true)
18 | .positiveText(context.getResources().getString(android.R.string.ok)));
19 | }
20 |
21 | public static MaterialDialog dialogProgress(Context context, String title, String content) {
22 | return dialogFixBackground(context, new MaterialDialog.Builder(context)
23 | .title(title)
24 | .content(content)
25 | .cancelable(false)
26 | .progress(true, 0));
27 | }
28 |
29 | public static void dialogSystemAction(Context context) {
30 | dialogFixBackground(context, new MaterialDialog.Builder(context)
31 | .title(context.getResources().getString(R.string.dialog_system_action))
32 | .content(context.getResources().getString(R.string.dialog_system_action_description))
33 | .positiveText(context.getResources().getString(android.R.string.ok))
34 | .negativeText(context.getResources().getString(android.R.string.cancel))
35 | .cancelable(false));
36 | }
37 |
38 | public static void toastMessage(Context context, String text) {
39 | new SnackBar((Activity) context, text, null, null).show();
40 | }
41 |
42 | public static void toastAction(Context context, String text, String buttonText, View.OnClickListener onClickListener) {
43 | new SnackBar((Activity) context, text, buttonText, onClickListener).show();
44 | }
45 |
46 | public static MaterialDialog dialogFixBackground(Context context, MaterialDialog.Builder dialog) {
47 | if (App.getAppPreferences().getTheme().equals("1")) {
48 | dialog.backgroundColor(context.getResources().getColor(R.color.grey_three));
49 | }
50 | return dialog.show();
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/res/values-pl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nowoczesny, łatwy w obsłudze i personalizowany menadżer aplikacji na Androida
4 | Ustawienia
5 | O
6 | Udostępnij
7 | Zainstalowane aplikacje
8 | Aplikacje systemowe
9 | Ulubione
10 | Ukryte aplikacje
11 | Ukryj
12 | Wyślij
13 | Szukaj
14 | Szukaj według nazwy…
15 | Nic nie znaleziono
16 | \"%1$s\" plik APK zapisano w folderze \"MLManager\" pod nazwą: %2$s
17 | Otwórz
18 | Usuń cache
19 | Pliki cache %s zostały usunięte
20 | Wyczyść dane
21 | Wszystkie dane aplikacji %s zostały usunięte
22 | Musisz uruchomić ponownie swoje urządzenie, aby zmiany zostały pokazane. Czy chcesz teraz uruchomić ponownie swoje urządzenie?
23 | Cofnij
24 | Uruchom ponownie
25 | Domyślna nazwa pliku dla rozpakowanych APK
26 | Sortuj aplikacje według
27 | Personalizacja
28 | Kolor podstawowy
29 | Ustal kolor podstawowy dla paska narzędzi i paska nawigacyjnego. Wymaga Androida 5.0+
30 | Kolor pływającego przycisku
31 | Ustal kolor dla pływającego przycisku akcji (FAB)
32 | Pokaż pasek nawigacji w kolorze czarnym
33 | Nie używaj własnego koloru dla paska nawigacyjnego.
34 | Utworzono z \u2665 w Hiszpanii
35 | Deweloper aplikacji
36 | Projektant ikon
37 | Dotknij ponownie aby zamknąć aplikację
38 |
--------------------------------------------------------------------------------
/app/src/main/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Android 用のモダンで、簡単、そしてカスタマイズ可能なアプリ マネージャー
4 | 設定
5 | アプリについて
6 | 共有
7 | インストール済みのアプリ
8 | システムアプリ
9 | お気に入り
10 | 非表示にするアプリ
11 | 非表示にする
12 | 次を使用して
13 | 検索
14 | 名前で検索…
15 | 検索条件に一致する結果が見つかりませんでした
16 | クリップボードにコピーしました
17 | \"%1$s\" APK は \"MLManager\" フォルダーに次の名前で保存されました: %2$s
18 | 開く
19 | キャッシュの削除
20 | %s のキャッシュを削除しました
21 | データの削除
22 | %s のデータをすべて削除しました
23 | root が必要です
24 | お使いのデバイスを root 化して、root 権限が必要です。アクセスが拒否された場合、SuperUser アプリで ML Manager にアクセス許可を与えてください。
25 | 変更を反映するには再起動が必要です。今すぐ再起動しますか?
26 | アンインストールしてもよろしいですか?
27 | システムアプリを削除しようとしています。システムに詳しくない人は削除しないでください。デバイスが誤動作する可能性があります。
28 | 抽出
29 | 元に戻す
30 | 再起動
31 | アンインストール
32 | 抽出された APK 用のユーザー設定フォルダー
33 | 抽出された APK のデフォルトのファイル名
34 | アプリを並び替え
35 | カスタマイズ
36 | プライマリ色
37 | ツールバー、ナビゲーション バーのプライマリ色を設定します。Android 5.0 以降が必要です
38 | フローティング ボタンの色
39 | フローティング アクション ボタン (FAB) の色を設定します
40 | ナビゲーション バーを黒で表示
41 | ナビゲーション バーにユーザー設定の色を使用しません。
42 | スペインの \u2665 で作りました
43 | アプリ開発者
44 | アイコン デザイナー
45 | もう一度タップすると、アプリを閉じます
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/AppPreferences.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.os.Environment;
6 | import android.preference.PreferenceManager;
7 |
8 | import com.dkanada.openapk.R;
9 |
10 | public class AppPreferences {
11 | private SharedPreferences sharedPreferences;
12 | private Context context;
13 |
14 | public static final int CODE_PERMISSION = 10;
15 | public static final int CODE_UNINSTALL = 11;
16 |
17 | public AppPreferences(Context context) {
18 | this.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
19 | this.context = context;
20 | }
21 |
22 | public static AppPreferences get(Context context) {
23 | return new AppPreferences(context);
24 | }
25 |
26 | public String getCustomPath() {
27 | return sharedPreferences.getString(context.getString(R.string.pref_custom_path), Environment.getExternalStorageDirectory() + "/" + context.getString(R.string.app_name));
28 | }
29 |
30 | public String getFilename() {
31 | return sharedPreferences.getString(context.getString(R.string.pref_custom_file), "0");
32 | }
33 |
34 | public String getSortMethod() {
35 | return sharedPreferences.getString(context.getString(R.string.pref_sort_method), "0");
36 | }
37 |
38 | public String getTheme() {
39 | return sharedPreferences.getString(context.getString(R.string.pref_theme), "1");
40 | }
41 |
42 | public int getPrimaryColor() {
43 | return sharedPreferences.getInt(context.getString(R.string.pref_primary_color), context.getResources().getColor(R.color.primary));
44 | }
45 |
46 | public int getAccentColor() {
47 | return sharedPreferences.getInt(context.getString(R.string.pref_accent_color), context.getResources().getColor(R.color.accent));
48 | }
49 |
50 | public Boolean getDoubleTap() {
51 | return sharedPreferences.getBoolean(context.getString(R.string.pref_double_tap), false);
52 | }
53 |
54 | public Boolean getRootEnabled() {
55 | return sharedPreferences.getBoolean(context.getString(R.string.pref_enable_root), false);
56 | }
57 |
58 | public boolean getInitialSetup() {
59 | return sharedPreferences.getBoolean(context.getString(R.string.pref_initial_setup), false);
60 | }
61 |
62 | public void setInitialSetup(boolean value) {
63 | SharedPreferences.Editor editor = sharedPreferences.edit();
64 | editor.putBoolean(context.getString(R.string.pref_initial_setup), value);
65 | editor.apply();
66 | }
67 |
68 | public int getRootStatus() {
69 | return sharedPreferences.getInt(context.getString(R.string.pref_root), 0);
70 | }
71 |
72 | public void setRootStatus(int value) {
73 | SharedPreferences.Editor editor = sharedPreferences.edit();
74 | editor.putInt(context.getString(R.string.pref_root), value);
75 | editor.apply();
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
11 |
12 |
18 |
19 |
25 |
26 |
27 |
28 |
29 |
30 |
36 |
37 |
44 |
45 |
52 |
53 |
54 |
55 |
56 |
57 |
62 |
63 |
68 |
69 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ### 1.2.1
2 | ###### Released: December 10, 2017
3 | * add russian translation
4 | * main activity updates on resume
5 | * fix sd card install issue
6 | * add detailed storage view
7 |
8 | ### 1.2
9 | ###### Released: August 14, 2017
10 | * fix extract filenames
11 | * add sort by package name
12 | * lots of changes behind the scenes
13 |
14 | ### 1.1.5
15 | ###### Released: July 26, 2017
16 | * add button to go to app settings
17 | * changes to the app activity for new features
18 | * speed up initial start and database refresh
19 | * add romanian translation
20 | * fix material dialogs in dark theme
21 |
22 | ### 1.1.4
23 | ###### Released: June 7, 2017
24 | * add scroll view in app activity for smaller devices
25 | * add material color picker in preferences
26 | * remove some async classes
27 |
28 | ### 1.1.3
29 | ###### Released: May 5, 2017
30 | * optimize some database queries
31 | * fix an issue checking certain database values
32 |
33 | ### 1.1.2
34 | ###### Released: April 20, 2017
35 | * fix some scaling issues on smaller screens
36 | * modify the quick action buttons for the light theme
37 |
38 | ### 1.1.1
39 | ###### Released: April 16, 2017
40 | * add option to use custom directory for saved files
41 | * changes to dialogs throughout the app
42 | * fix file name preference
43 | * add customization to quick actions
44 | * automatically update the database when opened
45 |
46 | ### 1.1
47 | ###### Released: March 17, 2017
48 | * complete redesign of the app layout
49 | * update settings page
50 | * fix broken root actions in async methods
51 | * fix build issue for f-droid release
52 | * fix sort by installation and update
53 | * bug fixes and other small changes
54 |
55 | ### 1.0.1
56 | ###### Released: March 9, 2017
57 | * all tasks are ran in the background now
58 | * fix for hidden apps getting removed from the database
59 | * minor changes to strings for new tasks
60 | * fix refresh animation ending too early
61 |
62 | ### 1.0
63 | ###### Released: March 3, 2017
64 | * lots of code optimizations
65 | * the app lists refresh much faster now
66 | * current app list is not reset on refresh
67 | * root must be manually enabled in settings
68 | * add setting for double tap to exit
69 | * change refresh animation
70 | * hidden and disabled apps no longer show up in normal lists
71 | * disabled apps persist even after database refresh
72 |
73 | ### 0.9
74 | ###### Released: February 5, 2017
75 | * include a dark theme
76 | * change animations for navigating through the app
77 | * modify some of the icons
78 | * fix progress bar for initial app list refresh
79 | * lots of bug fixes
80 |
81 | ### 0.8.3
82 | ###### Released: February 3, 2017
83 | * add a small text view to show that initial scan is happening
84 | * include more comments in code for clarity
85 |
86 | ### 0.8.2
87 | ###### Released: February 2, 2017
88 | * extraction folder not created until needed
89 | * fix important bug that broke disabling and hiding system apps
90 |
91 | ### 0.8.1
92 | ###### Released: February 1, 2017
93 | * set toolbar title to currently open adapter
94 | * update icons for lots of actions
95 | * remove custom extraction folder temporarily
96 |
97 | ### 0.8
98 | ###### Released: January 28, 2017
99 | * add option to disable apps in the app activity
100 | * change pull to refresh animation
101 | * merge the pro and basic versions
102 | * remove several libraries from the code
103 |
--------------------------------------------------------------------------------
/app/src/main/res/values-pt/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Um gestor de aplicações moderno e intuitivo para Android
4 | Definições
5 | Sobre
6 | Partilhar
7 | Aplicações instaladas
8 | Aplicações do sistema
9 | Favoritas
10 | Aplicações ocultas
11 | Ocultar
12 | Enviar
13 | Pesquisar
14 | Pesquisar por nome…
15 | Não foram encontrados resultados.
16 | Copiado para a área de transferência
17 | \"%1$s\" foi guardada no diretório \"ML Manager\" com o nome: %2$s
18 | Abrir
19 | Limpar cache
20 | A cache de %s foi limpa
21 | Limpar dados
22 | Todos os dados de %s foram removidos
23 | Requer root
24 | O seu dispositivo tem que ter root. Se alguma vez tiver recusado as permissões root ao ML Manager, aceda à aplicação SuperUser e conceda-nos as permissões de root.
25 | Tem que reiniciar o dispositivo para mostrar as alterações. Reiniciar agora?
26 | Tem a certeza de que quer desinstalar?
27 | Está prestes a remover uma aplicação do sistema. Não efetue esta ação, a não ser que tenha a certeza que a sua remoção não afeta o seu sistema.
28 | Extrair
29 | Desfazer
30 | Reiniciar
31 | Desinstalar
32 | Pasta personalizada para as APK
33 | Nome de ficheiro para APK extraídas
34 | Ordenar aplicações por
35 | Personalizações
36 | Cor primária
37 | Define a cor primária da barra de navegação e da barra de ferramentas. Apenas Android 5.0+
38 | Cor do botão flutuante
39 | Define a cor do botão flutuante (FAB)
40 | Mostrar barra de navegação a preto
41 | Não utilizar cor personalizada na barra de nagevação
42 | Criado com \u2665 de Espanha
43 | Programador da aplicação
44 | Criador do ícone
45 | Toque novamente para fechar
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
13 |
14 |
18 |
19 |
24 |
25 |
31 |
32 |
43 |
44 |
55 |
56 |
57 |
58 |
64 |
65 |
71 |
72 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/FileOperations.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapFactory;
6 | import android.graphics.drawable.BitmapDrawable;
7 | import android.graphics.drawable.Drawable;
8 |
9 | import com.dkanada.openapk.App;
10 | import com.dkanada.openapk.R;
11 |
12 | import java.io.File;
13 | import java.io.FileOutputStream;
14 | import java.io.IOException;
15 | import java.io.OutputStreamWriter;
16 |
17 | public class FileOperations {
18 | // copy files that do not require root access
19 | public static boolean cpExternalPartition(String input, String output) {
20 | createFolder(App.getAppPreferences().getCustomPath());
21 | File inputFile = new File(input);
22 | File outputFile = new File(output);
23 | try {
24 | org.apache.commons.io.FileUtils.copyFile(inputFile, outputFile);
25 | return true;
26 | } catch (IOException e) {
27 | e.printStackTrace();
28 | }
29 | return false;
30 | }
31 |
32 | public static void createFolder(String path) {
33 | File file = new File(path);
34 | if (!file.exists()) {
35 | file.mkdir();
36 | }
37 | }
38 |
39 | public static void deleteFolder(String path) {
40 | File file = new File(path);
41 | if (file.exists()) {
42 | file.delete();
43 | }
44 | }
45 |
46 | // save app icon to cache folder
47 | public static boolean saveIconToCache(Context context, String packageName) {
48 | boolean result = false;
49 | try {
50 | FileOutputStream out = new FileOutputStream(new File(context.getCacheDir(), packageName + ".png"));
51 | Drawable icon = context.getPackageManager().getApplicationIcon(packageName);
52 | BitmapDrawable iconBitmap = (BitmapDrawable) icon;
53 | iconBitmap.getBitmap().compress(Bitmap.CompressFormat.PNG, 100, out);
54 | result = true;
55 | } catch (Exception e) {
56 | e.printStackTrace();
57 | }
58 | return result;
59 | }
60 |
61 | // delete app icon from cache folder
62 | public static boolean removeIconFromCache(Context context, String packageName) {
63 | File file = new File(context.getCacheDir(), packageName + ".png");
64 | return file.delete();
65 | }
66 |
67 | // get app icon from cache folder
68 | public static Drawable getIconFromCache(Context context, String packageName) {
69 | Drawable result;
70 | try {
71 | File file = new File(context.getCacheDir(), packageName + ".png");
72 | Bitmap bitmap = BitmapFactory.decodeFile(file.getPath());
73 | result = new BitmapDrawable(context.getResources(), bitmap);
74 | } catch (Exception e) {
75 | e.printStackTrace();
76 | result = context.getResources().getDrawable(R.drawable.ic_android);
77 | }
78 | return result;
79 | }
80 |
81 | public static void writeToFile(Context context, String file, String content) {
82 | try {
83 | OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput(file, Context.MODE_PRIVATE));
84 | outputStreamWriter.write(content);
85 | outputStreamWriter.close();
86 | } catch (IOException e) {
87 | e.printStackTrace();
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/app/src/main/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Moderno, sencillo y personalizable gestor de aplicaciones para Android
4 | Ajustes
5 | Acerca de
6 | Compartir
7 | Aplicaciones Instaladas
8 | Aplicaciones del Sistema
9 | Favoritas
10 | Aplicaciones Ocultas
11 | Ocultar
12 | Enviar
13 | Buscar
14 | Buscar por nombre…
15 | No se encontraron resultados para esa búsqueda
16 | Copiado al portapapeles
17 | El APK \"%1$s\" ha sido guardado en la carpeta \"MLManager\" con nombre: %2$s
18 | Iniciar
19 | Eliminar caché
20 | La caché de %s ha sido eliminada
21 | Limpiar datos
22 | Todos los datos de %s han sido eliminados
23 | Acceso Root necesario
24 | Para eliminar datos del dispositivo necesitas root con los permisos dados. Si has rechazado el acceso una vez: dirígete a la app SuperUser para dar acceso a ML Manager.
25 | Es necesario reiniciar para mostrar los cambios. ¿Quieres reiniciar ahora?
26 | ¿Seguro que quieres desinstalar?
27 | Estás a un solo paso de eliminar una aplicación del sistema. No desinstales si no estás seguro, podría ocasionar un mal funcionamiento del dispositivo.
28 | Extraer
29 | Deshacer
30 | Reiniciar
31 | Desinstalar
32 | Carpeta personalizada para APK extraídos
33 | Nombre de los archivos APK extraídos
34 | Ordenar aplicaciones por
35 | Personalizaciones
36 | Color principal
37 | Ajustar el color primario para la barra de herramientas y navegación. Requiere Android 5.0 o superior
38 | Color del botón flotante
39 | Ajustar el color para el botón flotante (FAB)
40 | Mostrar barra de navegación en negro
41 | No usar un color personalizado para la barra de navegación.
42 | Hecho con \u2665 en España
43 | Desarrollador
44 | Icono
45 | Pulsa de nuevo para salir
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/models/AppItem.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.models;
2 |
3 | import android.content.pm.PackageInfo;
4 | import android.graphics.Bitmap;
5 | import android.os.Parcel;
6 | import android.os.Parcelable;
7 |
8 | import com.dkanada.openapk.App;
9 | import com.dkanada.openapk.utils.OtherUtils;
10 |
11 | public class AppItem implements Parcelable {
12 | private Bitmap icon;
13 | private String packageLabel;
14 | private String packageName;
15 | private String versionName;
16 | private String versionCode;
17 | private String data;
18 | private String source;
19 | private String install;
20 | private String update;
21 | public boolean system;
22 | public boolean disable;
23 | public boolean hide;
24 | public boolean favorite;
25 |
26 | public AppItem(PackageInfo packageInfo) {
27 | icon = OtherUtils.drawableToBitmap(App.getPackageIcon(packageInfo));
28 | packageLabel = App.getPackageName(packageInfo);
29 | packageName = packageInfo.packageName;
30 | versionName = packageInfo.versionName;
31 | versionCode = Integer.toString(packageInfo.versionCode);
32 | data = packageInfo.applicationInfo.dataDir;
33 | source = packageInfo.applicationInfo.sourceDir;
34 | install = Long.toString(packageInfo.firstInstallTime);
35 | update = Long.toString(packageInfo.lastUpdateTime);
36 | }
37 |
38 | public AppItem(Parcel parcel) {
39 | icon = parcel.readParcelable(getClass().getClassLoader());
40 | packageLabel = parcel.readString();
41 | packageName = parcel.readString();
42 | versionName = parcel.readString();
43 | versionCode = parcel.readString();
44 | data = parcel.readString();
45 | source = parcel.readString();
46 | install = parcel.readString();
47 | update = parcel.readString();
48 | boolean[] flags = new boolean[4];
49 | parcel.readBooleanArray(flags);
50 | system = flags[0];
51 | disable = flags[1];
52 | hide = flags[2];
53 | favorite = flags[3];
54 | }
55 |
56 | public Bitmap getIcon() {
57 | return icon;
58 | }
59 |
60 | public String getPackageLabel() {
61 | return packageLabel;
62 | }
63 |
64 | public String getPackageName() {
65 | return packageName;
66 | }
67 |
68 | public String getVersionName() {
69 | return versionName;
70 | }
71 |
72 | public String getVersionCode() {
73 | return versionCode;
74 | }
75 |
76 | public String getData() {
77 | return data;
78 | }
79 |
80 | public String getSource() {
81 | return source;
82 | }
83 |
84 | public String getInstall() {
85 | return install;
86 | }
87 |
88 | public String getUpdate() {
89 | return update;
90 | }
91 |
92 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
93 | public AppItem createFromParcel(Parcel parcel) {
94 | return new AppItem(parcel);
95 | }
96 | public AppItem[] newArray(int size) {
97 | return new AppItem[size];
98 | }
99 | };
100 |
101 | @Override
102 | public int describeContents() {
103 | return 0;
104 | }
105 |
106 | @Override
107 | public void writeToParcel(Parcel parcel, int flags) {
108 | parcel.writeParcelable(icon, flags);
109 | parcel.writeString(packageLabel);
110 | parcel.writeString(packageName);
111 | parcel.writeString(versionName);
112 | parcel.writeString(versionCode);
113 | parcel.writeString(data);
114 | parcel.writeString(source);
115 | parcel.writeString(install);
116 | parcel.writeString(update);
117 | parcel.writeBooleanArray(new boolean[]{ system, disable, hide, favorite });
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
16 |
17 |
29 |
30 |
42 |
43 |
55 |
56 |
62 |
63 |
74 |
75 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/fragments/SettingsFragment.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.fragments;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.preference.EditTextPreference;
8 | import android.preference.ListPreference;
9 | import android.preference.Preference;
10 | import android.preference.PreferenceFragment;
11 | import android.preference.PreferenceManager;
12 |
13 | import com.dkanada.openapk.App;
14 | import com.dkanada.openapk.R;
15 | import com.dkanada.openapk.utils.AppPreferences;
16 |
17 | public final class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
18 | private EditTextPreference prefCustomPath;
19 | private ListPreference prefCustomFile;
20 | private ListPreference prefSortMethod;
21 | private ListPreference prefTheme;
22 |
23 | AppPreferences appPreferences;
24 | Context context;
25 |
26 | @Override
27 | public void onCreate(Bundle savedInstanceState) {
28 | appPreferences = App.getAppPreferences();
29 | super.onCreate(savedInstanceState);
30 | addPreferencesFromResource(R.xml.settings);
31 | context = getActivity();
32 |
33 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
34 | prefs.registerOnSharedPreferenceChangeListener(this);
35 |
36 | prefCustomPath = (EditTextPreference) findPreference(getString(R.string.pref_custom_path));
37 | prefCustomFile = (ListPreference) findPreference(getString(R.string.pref_custom_file));
38 | prefSortMethod = (ListPreference) findPreference(getString(R.string.pref_sort_method));
39 | prefTheme = (ListPreference) findPreference(getString(R.string.pref_theme));
40 |
41 | // removes settings that wont work on lower versions
42 | Preference prefNavigationColor = findPreference(getString(R.string.pref_navigation_color));
43 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
44 | prefNavigationColor.setEnabled(false);
45 | }
46 |
47 | Preference prefReset = findPreference(getString(R.string.pref_reset));
48 | prefReset.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
49 | @Override
50 | public boolean onPreferenceClick(Preference preference) {
51 | SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
52 | sharedPreferences.edit().clear().apply();
53 | return true;
54 | }
55 | });
56 |
57 | setSortModeSummary();
58 | setThemeSummary();
59 | setCustomPathSummary();
60 | setFilenameSummary();
61 | }
62 |
63 | private void setCustomPathSummary() {
64 | prefCustomPath.setSummary(appPreferences.getCustomPath());
65 | }
66 |
67 | private void setFilenameSummary() {
68 | int filenameValue = Integer.valueOf(appPreferences.getFilename());
69 | prefCustomFile.setSummary(getResources().getStringArray(R.array.filenameEntries)[filenameValue]);
70 | }
71 |
72 | private void setSortModeSummary() {
73 | int sortValue = Integer.valueOf(appPreferences.getSortMethod());
74 | prefSortMethod.setSummary(getResources().getStringArray(R.array.sortEntries)[sortValue]);
75 | }
76 |
77 | private void setThemeSummary() {
78 | int themeValue = Integer.valueOf(appPreferences.getTheme());
79 | prefTheme.setSummary(getResources().getStringArray(R.array.themeEntries)[themeValue]);
80 | }
81 |
82 | @Override
83 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
84 | if (isAdded()) {
85 | Preference pref = findPreference(key);
86 | if (pref == prefCustomPath) {
87 | setCustomPathSummary();
88 | } else if (pref == prefCustomFile) {
89 | setFilenameSummary();
90 | } else if (pref == prefSortMethod) {
91 | setSortModeSummary();
92 | } else if (pref == prefTheme) {
93 | setThemeSummary();
94 | }
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/app/src/main/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 為Android打造,現代,簡單,可自訂的應用程式管理員
5 |
6 |
7 | 已安裝的App
8 | 系統應用程式
9 | 最愛的App
10 | 隱藏的App
11 | 已停用的App
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 | 沒有搜尋到任何結果
39 |
40 |
41 | 執行動作
42 | 等待一些程序以完成動作
43 | 系統動作
44 | 這個動作可能損壞你的手機。你確定要繼續?
45 | 需要權限
46 | 你必須允許權限來提取和分享安裝包,清除快取,還有清除資料。
47 | 需要root
48 | 要讓這個功能運作您必須root您的裝置且在設定裡啟用root功能。
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 | 啟用root功能
77 | 這可能會損壞你的手機但也可能沒事。
78 | 清除資料
79 | 刪除所有已儲存的安裝包,隱藏的應用程式還有其他資料。
80 | 重設偏好設定
81 | 還原偏好設定為預設值
82 |
83 |
84 | App維護者
85 | 最初開發者
86 | Icon設計師
87 |
88 |
89 | 應用程式名稱已複製到剪貼簿。
90 | 再按一次返回即可離開
91 | 可能需要重新開機以顯示改變。你想現在重新開機嗎?
92 | 發生錯誤且選擇的行動未完成
93 | 這個應用程式沒有使用者介面
94 | %1$s 已被另存為 %2$s 到特定的資料夾
95 | %s快取已清除
96 | %s 資料已被移除
97 |
98 |
99 | 明亮
100 | 黑暗
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/app/src/main/res/values-ro/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Manager de aplicații Android modern, simplu și customizabil.
5 |
6 |
7 | Aplicații instalate
8 | Aplicații de sistem
9 | Aplicații favorite
10 | Aplicații ascunse
11 | Aplicații dezactivate
12 | Setări
13 | Despre
14 |
15 | Deschide
16 | Extrage
17 | Distribuie
18 | Dezinstalează
19 | Șterge cache-ul
20 | Despre
21 | Ascunde
22 | Dezactivează
23 |
24 | Trimite
25 | Caută
26 | Caută după nume...
27 | Niciun rezultat nu a fost găsit la căutarea dvs.
28 |
29 |
30 | %1$s a fost salvat în folderul specificat cu numele: %2$s.
31 | Cache-ul pentru %s a fost eliminat.
32 | Toate datele pentru %s au fost eliminate.
33 | Permisiuni necesare
34 | Trebuie să acceptați permisiunile pentru a extrage și distribui APK-uri, șterge cache-ul și elimina datele aplicației.
35 | Root este necesar
36 | Dispozitivul dvs. trebuie să fie rootat pentru ca această funcție să meargă și funcțiile root să fie activate în setări.
37 | O repornire este necesară pentru a afișa modificările. Doriți să reporniți acum?
38 | Această aplicație nu deține o interfață cu utilizatorul.
39 | A apărut o eroare și acțiunea selectată nu poate fi completată.
40 |
41 |
42 | Repornește
43 | Anulează
44 |
45 |
46 | Pachet
47 | Versiune
48 | Mărime aplicație
49 | Folderul cu date
50 | Prima instalare
51 | Ultima actualizare
52 | În lucru
53 | 404
54 |
55 |
56 | Aplicații
57 | Culori
58 | Altele
59 | Director
60 | Nume fișier
61 | Metodă de sortare
62 | Temă
63 | Culoarea principală
64 | Setează culoarea pentru bara de unelte și bara de navigare.
65 | Culoare accent
66 | Setează culoarea de accent pentru acțiuni rapide și alte elemente.
67 | Colorează bara de navigare
68 | Folosește culoarea principală pentru bara de navigare.
69 | Apăsați înapoi pentru a ieși
70 | Apăsați butonul înapoi de două ori pentru a închide aplicația.
71 | Activează funcțiile root.
72 | Aceasta vă poate dăuna telefonului, dar cel mai probabil va fi în regulă.
73 | Resetează preferințe
74 | Resetează preferințele la valorile implicite.
75 |
76 |
77 | dkanada
78 | Javier Santos
79 | Javier Toro
80 | Lucian Sipos
81 | TykTak
82 | Responsabil aplicație
83 | Dezvoltatorul inițial
84 | Designerul pictogramei
85 |
86 |
87 | Nume aplicație copiat în clipboard.
88 | Apasă din nou pentru a închide aplicația.
89 |
90 |
91 |
--------------------------------------------------------------------------------
/app/src/main/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Современный, лёгкий и настраиваемый диспетчер приложений для Android.
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 | Требуется разрешение
39 | Вы должны принять разрешения на очистку кэша, удаление данных, извлечение и передачу пакетов.
40 | Требуется root
41 | Устройство должно иметь права root, и они должны быть включены в настройках.
42 |
43 |
44 | Метка
45 | Пакет
46 | Имя версии
47 | Код версии
48 | Размер
49 | Дата
50 | Источник
51 | Впервые установлено
52 | Последнее обновление
53 | В разработке
54 | 404
55 |
56 |
57 | Приложения
58 | Цвета
59 | Прочее
60 |
61 | Каталог
62 | Имя файла
63 | Способ сортировки
64 | Тема
65 | Основной цвет
66 | Установите цвет для панели инструментов и полосы навигации.
67 | Цвет выделения
68 | Установите цвет выделения для быстрых действий и других элементов.
69 | Цветная строка статуса
70 | Использовать основной цвет для строки статуса.
71 | Цветная полоса статуса
72 | Использовать основной цвет для полосы навигации.
73 | Нажмите Назад для выхода
74 | Нажмите Назад дважды для выхода из приложения.
75 | Использовать функции root
76 | Это может сломать телефон, но, возможно, будет прекрасно.
77 | Очистить данные
78 | Удалить все сохранённые пакеты, скрытые приложения и прочие данные.
79 | Сброс настроек
80 | Сбросить настройки на исходные.
81 |
82 |
83 | Разработка
84 | Автор оригинала
85 | Дизайн иконок
86 |
87 |
88 | Название программы скопировано в буфер обмена.
89 | Нажмите снова для выхода из приложения.
90 | Для принятия изменений устройство должно быть перезагружено. Перезагрузить сейчас?
91 | Произошла ошибка и выбранное действие не может быть выполнено.
92 | У этого приложения нет интерфейса.
93 | %1$s сохранено в указанное место под названием %2$s.
94 | Кэш %s очищен.
95 | Данные %s уничтожены.
96 |
97 |
98 | Светлая
99 | Тёмная
100 |
101 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/activities/StorageActivity.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.activities;
2 |
3 | import android.content.pm.PackageInfo;
4 | import android.content.pm.PackageManager;
5 | import android.content.pm.PackageStats;
6 | import android.os.Bundle;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 | import android.view.WindowManager;
10 | import android.widget.LinearLayout;
11 |
12 | import com.dkanada.openapk.R;
13 | import com.dkanada.openapk.interfaces.PackageStatsListener;
14 | import com.dkanada.openapk.models.AppItem;
15 | import com.dkanada.openapk.utils.AppPreferences;
16 | import com.dkanada.openapk.utils.OtherUtils;
17 | import com.dkanada.openapk.utils.PackageStatsHelper;
18 | import com.dkanada.openapk.views.InformationView;
19 |
20 | public class StorageActivity extends ThemeActivity implements PackageStatsListener {
21 | private AppItem appItem;
22 | private LinearLayout internal;
23 | private LinearLayout external;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_storage);
29 | AppItem appItem = getIntent().getParcelableExtra("package");
30 |
31 | setInitialConfiguration();
32 | setScreenElements();
33 | }
34 |
35 | private void setInitialConfiguration() {
36 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
37 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View view) {
40 | onBackPressed();
41 | }
42 | });
43 | toolbar.setBackgroundColor(AppPreferences.get(this).getPrimaryColor());
44 |
45 | setSupportActionBar(toolbar);
46 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
47 | getSupportActionBar().setTitle(R.string.storage);
48 |
49 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
50 | getWindow().setStatusBarColor(OtherUtils.dark(AppPreferences.get(this).getPrimaryColor(), 0.8));
51 | getWindow().setNavigationBarColor(AppPreferences.get(this).getPrimaryColor());
52 | }
53 |
54 | private void setScreenElements() {
55 | PackageInfo packageInfo = new PackageInfo();
56 | try {
57 | packageInfo = getPackageManager().getPackageInfo(appItem.getPackageName(), 0);
58 | } catch (PackageManager.NameNotFoundException e) {
59 | // do nothing
60 | }
61 | PackageStatsHelper.getPackageStats(this, packageInfo, this);
62 |
63 | internal = (LinearLayout) findViewById(R.id.internal);
64 | InformationView internalCode = new InformationView(this, getString(R.string.code), getString(R.string.layout_loading), true);
65 | InformationView internalData = new InformationView(this, getString(R.string.data), getString(R.string.layout_loading), false);
66 | InformationView internalCache = new InformationView(this, getString(R.string.cache), getString(R.string.layout_loading), true);
67 | internal.addView(internalCode);
68 | internal.addView(internalData);
69 | internal.addView(internalCache);
70 |
71 | external = (LinearLayout) findViewById(R.id.external);
72 | InformationView externalCode = new InformationView(this, getString(R.string.code), getString(R.string.layout_loading), true);
73 | InformationView externalData = new InformationView(this, getString(R.string.data), getString(R.string.layout_loading), false);
74 | InformationView externalCache = new InformationView(this, getString(R.string.cache), getString(R.string.layout_loading), true);
75 | InformationView externalObb = new InformationView(this, getString(R.string.obb), getString(R.string.layout_loading), false);
76 | InformationView externalMedia = new InformationView(this, getString(R.string.media), getString(R.string.layout_loading), true);
77 | external.addView(externalCode);
78 | external.addView(externalData);
79 | external.addView(externalCache);
80 | external.addView(externalObb);
81 | external.addView(externalMedia);
82 | }
83 |
84 | @Override
85 | public void onPackageStats(PackageStats packageStats) {
86 | internal.removeAllViews();
87 | InformationView internalCode = new InformationView(this, getString(R.string.code), OtherUtils.formatSize(packageStats.codeSize), true);
88 | InformationView internalData = new InformationView(this, getString(R.string.data), OtherUtils.formatSize(packageStats.dataSize), false);
89 | InformationView internalCache = new InformationView(this, getString(R.string.cache), OtherUtils.formatSize(packageStats.cacheSize), true);
90 | internal.addView(internalCode);
91 | internal.addView(internalData);
92 | internal.addView(internalCache);
93 |
94 | external.removeAllViews();
95 | external = (LinearLayout) findViewById(R.id.external);
96 | InformationView externalCode = new InformationView(this, getString(R.string.code), OtherUtils.formatSize(packageStats.externalCodeSize), true);
97 | InformationView externalData = new InformationView(this, getString(R.string.data), OtherUtils.formatSize(packageStats.externalDataSize), false);
98 | InformationView externalCache = new InformationView(this, getString(R.string.cache), OtherUtils.formatSize(packageStats.externalCacheSize), true);
99 | InformationView externalObb = new InformationView(this, getString(R.string.obb), OtherUtils.formatSize(packageStats.externalObbSize), false);
100 | InformationView externalMedia = new InformationView(this, getString(R.string.media), OtherUtils.formatSize(packageStats.externalMediaSize), true);
101 | external.addView(externalCode);
102 | external.addView(externalData);
103 | external.addView(externalCache);
104 | external.addView(externalObb);
105 | external.addView(externalMedia);
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/ShellCommands.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.os.Build;
4 |
5 | import com.dkanada.openapk.App;
6 | import com.dkanada.openapk.models.AppItem;
7 |
8 | import java.io.File;
9 |
10 | public class ShellCommands {
11 | private static final int ROOT_STATUS_NOT_CHECKED = 0;
12 | private static final int ROOT_STATUS_ROOTED = 1;
13 | private static final int ROOT_STATUS_NOT_ROOTED = 2;
14 |
15 | public static boolean isRoot() {
16 | int rootStatus = App.getAppPreferences().getRootStatus();
17 | boolean rootEnabled = App.getAppPreferences().getRootEnabled();
18 | boolean isRooted = false;
19 | if (rootEnabled) {
20 | if (rootStatus == ROOT_STATUS_NOT_CHECKED) {
21 | isRooted = isRootByBuildTag() || isRootedByFileSU() || isRootedByExecutingCommand();
22 | App.getAppPreferences().setRootStatus(isRooted ? ROOT_STATUS_ROOTED : ROOT_STATUS_NOT_ROOTED);
23 | } else if (rootStatus == ROOT_STATUS_ROOTED) {
24 | isRooted = true;
25 | }
26 | }
27 | return isRooted;
28 | }
29 |
30 | public static boolean isRootByBuildTag() {
31 | String buildTags = Build.TAGS;
32 | return ((buildTags != null && buildTags.contains("test-keys")));
33 | }
34 |
35 | public static boolean isRootedByFileSU() {
36 | try {
37 | File file = new File("/system/app/Superuser.apk");
38 | if (file.exists()) {
39 | return true;
40 | }
41 | } catch (Exception e) {
42 | }
43 | return false;
44 | }
45 |
46 | public static boolean isRootedByExecutingCommand() {
47 | return canExecuteCommand("/system/xbin/which su") ||
48 | canExecuteCommand("/system/bin/which su") ||
49 | canExecuteCommand("which su");
50 | }
51 |
52 | // copy files to the system partition
53 | public static boolean cpSystemPartition(String input, String output) {
54 | String[] command_write = new String[]{"su", "-c", "mount -o rw,remount /system"};
55 | String[] command_delete = new String[]{"su", "-c", "cp -R " + input + " " + output};
56 | String[] command_read = new String[]{"su", "-c", "mount -o ro,remount /system"};
57 | if (executeCommand(command_write) == 0 && executeCommand(command_delete) == 0 && executeCommand(command_read) == 0) {
58 | return true;
59 | }
60 | return false;
61 | }
62 |
63 | // copy files to the data partition
64 | public static boolean cpDataPartition(String input, String output) {
65 | String[] command = new String[]{"su", "-c", "cp -R " + input + " " + output};
66 | if (executeCommand(command) == 0) {
67 | return true;
68 | }
69 | return false;
70 | }
71 |
72 | // remove files from the system partition
73 | public static boolean rmSystemPartition(String directory) {
74 | String[] command_write = new String[]{"su", "-c", "mount -o rw,remount /system"};
75 | String[] command_delete = new String[]{"su", "-c", "rm -rf " + directory};
76 | String[] command_read = new String[]{"su", "-c", "mount -o ro,remount /system"};
77 | if (executeCommand(command_write) == 0 && executeCommand(command_delete) == 0 && executeCommand(command_read) == 0) {
78 | return true;
79 | }
80 | return false;
81 | }
82 |
83 | // remove files from the data partition
84 | public static boolean rmDataPartition(String directory) {
85 | String[] command = new String[]{"su", "-c", "rm -rf " + directory};
86 | if (executeCommand(command) == 0) {
87 | return true;
88 | }
89 | return false;
90 | }
91 |
92 | // use package manager to disable a package
93 | public static boolean disable(AppItem appItem) {
94 | String[] command = new String[]{"su", "-c", "pm disable " + appItem.getPackageName()};
95 | if (executeCommand(command) == 0) {
96 | return true;
97 | }
98 | return false;
99 | }
100 |
101 | // use package manager to enable a package
102 | public static boolean enable(AppItem appItem) {
103 | String[] command = new String[]{"su", "-c", "pm enable " + appItem.getPackageName()};
104 | if (executeCommand(command) == 0) {
105 | return true;
106 | }
107 | return false;
108 | }
109 |
110 | // use package manager to hide a package
111 | public static boolean hide(AppItem appItem) {
112 | String[] command = new String[]{"su", "-c", "pm hide " + appItem.getPackageName()};
113 | if (executeCommand(command) == 0) {
114 | return true;
115 | }
116 | return false;
117 | }
118 |
119 | // use package manager to unhide a package
120 | public static boolean unhide(AppItem appItem) {
121 | String[] command = new String[]{"su", "-c", "pm unhide " + appItem.getPackageName()};
122 | if (executeCommand(command) == 0) {
123 | return true;
124 | }
125 | return false;
126 | }
127 |
128 | public static boolean rebootSystem() {
129 | String[] command = new String[]{"su", "-c", "reboot"};
130 | if (executeCommand(command) == 0) {
131 | return true;
132 | }
133 | return false;
134 | }
135 |
136 | private static boolean canExecuteCommand(String command) {
137 | boolean isExecuted;
138 | try {
139 | Runtime.getRuntime().exec(command);
140 | isExecuted = true;
141 | } catch (Exception e) {
142 | isExecuted = false;
143 | }
144 | return isExecuted;
145 | }
146 |
147 | private static int executeCommand(String[] commands) {
148 | try {
149 | Process process = Runtime.getRuntime().exec(commands);
150 | process.waitFor();
151 | return process.exitValue();
152 | } catch (Exception e) {
153 | e.printStackTrace();
154 | }
155 | return -1;
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/OtherUtils.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.Manifest;
4 | import android.app.Activity;
5 | import android.content.ActivityNotFoundException;
6 | import android.content.ClipData;
7 | import android.content.ClipboardManager;
8 | import android.content.Context;
9 | import android.content.Intent;
10 | import android.content.pm.PackageInfo;
11 | import android.content.pm.PackageManager;
12 | import android.graphics.Bitmap;
13 | import android.graphics.Canvas;
14 | import android.graphics.Color;
15 | import android.graphics.drawable.Drawable;
16 | import android.net.Uri;
17 | import android.support.v4.content.ContextCompat;
18 | import android.support.v7.widget.Toolbar;
19 | import android.view.MenuItem;
20 |
21 | import com.dkanada.openapk.App;
22 | import com.dkanada.openapk.R;
23 | import com.dkanada.openapk.models.AppItem;
24 |
25 | import java.io.File;
26 | import java.text.SimpleDateFormat;
27 | import java.util.Locale;
28 |
29 | public class OtherUtils {
30 | // get the name of the extracted app
31 | public static String getAPKFilename(AppItem appItem) {
32 | AppPreferences appPreferences = App.getAppPreferences();
33 | switch (appPreferences.getFilename()) {
34 | case "0":
35 | return appItem.getPackageName() + ".apk";
36 | case "1":
37 | return appItem.getPackageLabel() + ".apk";
38 | default:
39 | return appItem.getPackageName() + ".apk";
40 | }
41 | }
42 |
43 | // open google play if installed otherwise open browser
44 | public static void goToGooglePlay(Context context, PackageInfo packageInfo) {
45 | try {
46 | context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageInfo.packageName)));
47 | } catch (ActivityNotFoundException e) {
48 | context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageInfo.packageName)));
49 | }
50 | }
51 |
52 | // save app name to clipboard
53 | public static void saveClipboard(Context context, PackageInfo packageInfo) {
54 | ClipData clipData;
55 | clipData = ClipData.newPlainText("text", packageInfo.packageName);
56 |
57 | ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
58 | clipboardManager.setPrimaryClip(clipData);
59 | }
60 |
61 | // get version number for this app
62 | public static String getAppVersionName(Context context) {
63 | String res = "0.0.0";
64 | try {
65 | res = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
66 | } catch (Exception e) {
67 | e.printStackTrace();
68 | }
69 | return res;
70 | }
71 |
72 | // get version code for this app
73 | public static int getAppVersionCode(Context context) {
74 | int res = 0;
75 | try {
76 | res = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
77 | } catch (Exception e) {
78 | e.printStackTrace();
79 | }
80 | return res;
81 | }
82 |
83 | // get intent to share app
84 | public static Intent getShareIntent(File file) {
85 | Intent intent = new Intent();
86 | intent.setAction(Intent.ACTION_SEND);
87 | intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
88 | intent.setType("application/vnd.android.package-archive");
89 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
90 | return intent;
91 | }
92 |
93 | public static boolean checkPermissions(Context context) {
94 | return ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
95 | && ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
96 | }
97 |
98 | public static void requestPermissions(Context context) {
99 | Activity activity = (Activity) context;
100 | if (!checkPermissions(context)) {
101 | activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, AppPreferences.CODE_PERMISSION);
102 | }
103 | }
104 |
105 | public static int dark(int color, double factor) {
106 | int a = Color.alpha(color);
107 | int r = Color.red(color);
108 | int g = Color.green(color);
109 | int b = Color.blue(color);
110 | return Color.argb(a, Math.max((int) (r * factor), 0), Math.max((int) (g * factor), 0), Math.max((int) (b * factor), 0));
111 | }
112 |
113 | // set the toolbar title with any string
114 | public static void setToolbarTitle(Context context, String title) {
115 | Activity activity = (Activity) context;
116 | Toolbar toolbar = (Toolbar) activity.findViewById(R.id.toolbar);
117 | toolbar.setTitle(title);
118 | }
119 |
120 | // update the state of the favorite icon
121 | public static void updateAppFavoriteIcon(Context context, MenuItem menuItem, PackageInfo packageInfo) {
122 | /*if (App.getAppPreferences().getFavoriteList().contains(packageInfo.packageName)) {
123 | menuItem.setIcon(context.getResources().getDrawable(R.drawable.ic_star));
124 | } else {
125 | menuItem.setIcon(context.getResources().getDrawable(R.drawable.ic_star_border));
126 | }*/
127 | }
128 |
129 | public static Bitmap drawableToBitmap(Drawable drawable) {
130 | Bitmap bitmap = Bitmap.createBitmap(150, 150, Bitmap.Config.ARGB_8888);
131 | Canvas canvas = new Canvas(bitmap);
132 | drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
133 | drawable.draw(canvas);
134 | return bitmap;
135 | }
136 |
137 | public static String formatDate(long date) {
138 | return new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a", Locale.US).format(date);
139 | }
140 |
141 | public static String formatSize(long size) {
142 | if (size < 1024) {
143 | return Long.toString(size) + "B";
144 | } else if (size < 1048576) {
145 | size = size / 1024;
146 | return Long.toString(size) + "KB";
147 | } else if (size < 1073741824) {
148 | size = size / 1048576;
149 | return Long.toString(size) + "MB";
150 | } else {
151 | size = size / 1073741824;
152 | return Long.toString(size) + "GB";
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/adapters/AppAdapter.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.adapters;
2 |
3 | import android.app.Activity;
4 | import android.app.ActivityOptions;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.graphics.drawable.BitmapDrawable;
8 | import android.support.v7.widget.CardView;
9 | import android.support.v7.widget.RecyclerView;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 | import android.widget.Button;
14 | import android.widget.Filter;
15 | import android.widget.Filterable;
16 | import android.widget.ImageView;
17 | import android.widget.TextView;
18 |
19 | import com.dkanada.openapk.App;
20 | import com.dkanada.openapk.models.AppItem;
21 | import com.dkanada.openapk.utils.Actions;
22 | import com.dkanada.openapk.activities.AppActivity;
23 | import com.dkanada.openapk.R;
24 | import com.dkanada.openapk.utils.FileOperations;
25 | import com.dkanada.openapk.utils.OtherUtils;
26 |
27 | import java.util.ArrayList;
28 | import java.util.List;
29 |
30 | public class AppAdapter extends RecyclerView.Adapter implements Filterable {
31 | private List appList;
32 | private List appListSearch;
33 | private Context context;
34 |
35 | public AppAdapter(Context context, List appList) {
36 | this.appList = appList;
37 | this.context = context;
38 | }
39 |
40 | @Override
41 | public int getItemCount() {
42 | return appList.size();
43 | }
44 |
45 | @Override
46 | public void onBindViewHolder(AppViewHolder appViewHolder, int i) {
47 | AppItem appItem = appList.get(i);
48 | appViewHolder.vName.setText(appItem.getPackageLabel());
49 | appViewHolder.vPackage.setText(appItem.getPackageName());
50 | appViewHolder.vIcon.setImageDrawable(new BitmapDrawable(context.getResources(), appItem.getIcon()));
51 | setButtonEvents(appViewHolder, appItem);
52 | }
53 |
54 | private void setButtonEvents(AppViewHolder appViewHolder, final AppItem appItem) {
55 | Button btnOpen = appViewHolder.vOpen;
56 | Button btnShare = appViewHolder.vShare;
57 | final ImageView appIcon = appViewHolder.vIcon;
58 | final CardView cardView = appViewHolder.vCard;
59 |
60 | btnOpen.setTextColor(App.getAppPreferences().getAccentColor());
61 | btnShare.setTextColor(App.getAppPreferences().getAccentColor());
62 |
63 | if (App.getAppPreferences().getTheme().equals("0")) {
64 | btnOpen.setBackgroundColor(context.getResources().getColor(R.color.white));
65 | btnShare.setBackgroundColor(context.getResources().getColor(R.color.white));
66 | } else {
67 | btnOpen.setBackgroundColor(context.getResources().getColor(R.color.grey_three));
68 | btnShare.setBackgroundColor(context.getResources().getColor(R.color.grey_three));
69 | }
70 |
71 | btnOpen.setText(context.getString(R.string.action_open));
72 | btnOpen.setOnClickListener(new View.OnClickListener() {
73 | @Override
74 | public void onClick(View view) {
75 | Actions.open(context, appItem);
76 | }
77 | });
78 | btnShare.setText(context.getString(R.string.action_share));
79 | btnShare.setOnClickListener(new View.OnClickListener() {
80 | @Override
81 | public void onClick(View view) {
82 | Actions.share(context, appItem);
83 | }
84 | });
85 |
86 | cardView.setOnClickListener(new View.OnClickListener() {
87 | @Override
88 | public void onClick(View view) {
89 | Activity activity = (Activity) context;
90 | Intent intent = new Intent(context, AppActivity.class);
91 | intent.putExtra("appItem", appItem);
92 |
93 | // the icon will smoothly transition to its new location if version is above lollipop
94 | String transitionName = context.getResources().getString(R.string.transition);
95 | ActivityOptions transitionActivityOptions = ActivityOptions.makeSceneTransitionAnimation(activity, appIcon, transitionName);
96 | context.startActivity(intent, transitionActivityOptions.toBundle());
97 | }
98 | });
99 | }
100 |
101 | public Filter getFilter() {
102 | return new Filter() {
103 | @Override
104 | protected FilterResults performFiltering(CharSequence charSequence) {
105 | final FilterResults filterResults = new FilterResults();
106 | final List results = new ArrayList<>();
107 | if (appListSearch == null) {
108 | appListSearch = appList;
109 | }
110 | if (charSequence != null) {
111 | if (appListSearch != null && appListSearch.size() > 0) {
112 | for (final AppItem appItem : appListSearch) {
113 | if (appItem.getPackageLabel().toLowerCase().contains(charSequence.toString())) {
114 | results.add(appItem);
115 | }
116 | }
117 | }
118 | filterResults.values = results;
119 | filterResults.count = results.size();
120 | }
121 | return filterResults;
122 | }
123 |
124 | @Override
125 | protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
126 | appList = (ArrayList) filterResults.values;
127 | notifyDataSetChanged();
128 | }
129 | };
130 | }
131 |
132 | @Override
133 | public AppViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
134 | View appAdapterView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.adapter_app, viewGroup, false);
135 | return new AppViewHolder(appAdapterView);
136 | }
137 |
138 | public static class AppViewHolder extends RecyclerView.ViewHolder {
139 | private CardView vCard;
140 | private TextView vName;
141 | private TextView vPackage;
142 | private ImageView vIcon;
143 |
144 | private Button vOpen;
145 | private Button vShare;
146 |
147 | public AppViewHolder(View view) {
148 | super(view);
149 | vCard = (CardView) view.findViewById(R.id.app_card);
150 | vName = (TextView) view.findViewById(R.id.txtName);
151 | vPackage = (TextView) view.findViewById(R.id.txtApk);
152 | vIcon = (ImageView) view.findViewById(R.id.imgIcon);
153 |
154 | vOpen = (Button) view.findViewById(R.id.btnOpen);
155 | vShare = (Button) view.findViewById(R.id.btnShare);
156 | }
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/utils/Actions.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.utils;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.pm.PackageInfo;
6 | import android.net.Uri;
7 | import android.provider.Settings;
8 | import android.view.View;
9 |
10 | import com.dkanada.openapk.App;
11 | import com.dkanada.openapk.R;
12 | import com.dkanada.openapk.models.AppItem;
13 |
14 | import java.io.File;
15 | import java.util.List;
16 |
17 | public class Actions {
18 | public static void open(Context context, AppItem appItem) {
19 | final Intent intent = context.getPackageManager().getLaunchIntentForPackage(appItem.getPackageName());
20 | if (intent != null) {
21 | context.startActivity(intent);
22 | } else {
23 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_open));
24 | }
25 | }
26 |
27 | public static void extract(Context context, final AppItem appItem) {
28 | boolean status = FileOperations.cpExternalPartition(appItem.getSource(), App.getAppPreferences().getCustomPath() + "/" + OtherUtils.getAPKFilename(appItem));
29 | if (!status && !OtherUtils.checkPermissions(context)) {
30 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.dialog_permissions));
31 | } else if (!status) {
32 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
33 | } else {
34 | DialogUtils.toastAction(context, String.format(context.getResources().getString(R.string.success_extract), appItem.getPackageName(), OtherUtils.getAPKFilename(appItem)), context.getResources().getString(R.string.undo), new View.OnClickListener() {
35 | @Override
36 | public void onClick(View v) {
37 | new File(App.getAppPreferences().getCustomPath() + OtherUtils.getAPKFilename(appItem)).delete();
38 | }
39 | });
40 | }
41 | }
42 |
43 | public static void uninstall(Context context, AppItem appItem) {
44 | boolean status = ShellCommands.rmSystemPartition(appItem.getSource());
45 | if (!status && !ShellCommands.isRoot()) {
46 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.dialog_root_required_description));
47 | } else if (!status) {
48 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
49 | } else {
50 | DialogUtils.toastAction(context, context.getResources().getString(R.string.reboot_query), context.getResources().getString(R.string.reboot), new View.OnClickListener() {
51 | @Override
52 | public void onClick(View v) {
53 | ShellCommands.rebootSystem();
54 | }
55 | });
56 | }
57 | }
58 |
59 | public static void share(Context context, AppItem appItem) {
60 | boolean status = FileOperations.cpExternalPartition(appItem.getSource(), App.getAppPreferences().getCustomPath() + "/" + OtherUtils.getAPKFilename(appItem));
61 | if (!status && !OtherUtils.checkPermissions(context)) {
62 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.dialog_permissions_description));
63 | } else if (!status) {
64 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
65 | } else {
66 | Intent shareIntent = OtherUtils.getShareIntent(new File(App.getAppPreferences().getCustomPath() + "/" + OtherUtils.getAPKFilename(appItem)));
67 | context.startActivity(Intent.createChooser(shareIntent, context.getResources().getString(R.string.send)));
68 | }
69 | }
70 |
71 | public static void settings(Context context, AppItem appItem) {
72 | Intent intent = new Intent();
73 | intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
74 | intent.setData(Uri.parse("package:" + appItem.getPackageName()));
75 | context.startActivity(intent);
76 | }
77 |
78 | public static void disable(Context context, AppItem appItem) {
79 | boolean status;
80 | if (!appItem.disable) {
81 | status = ShellCommands.disable(appItem);
82 | } else {
83 | status = ShellCommands.enable(appItem);
84 | }
85 | if (!status && !ShellCommands.isRoot()) {
86 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.dialog_root_required_description));
87 | } else if (!status) {
88 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
89 | } else {
90 | DialogUtils.toastAction(context, context.getResources().getString(R.string.reboot_query), context.getResources().getString(R.string.reboot), new View.OnClickListener() {
91 | @Override
92 | public void onClick(View v) {
93 | ShellCommands.rebootSystem();
94 | }
95 | });
96 | }
97 | }
98 |
99 | public static void hide(Context context, AppItem appItem) {
100 | boolean status;
101 | PackageList packageList = new PackageList(context);
102 | List appList = packageList.getHiddenList();
103 | if (!appItem.hide) {
104 | status = ShellCommands.hide(appItem);
105 | appList.add(appItem);
106 | } else {
107 | status = ShellCommands.unhide(appItem);
108 | appList.remove(appItem);
109 | }
110 | if (!status && !ShellCommands.isRoot()) {
111 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.dialog_root_required_description));
112 | } else if (!status) {
113 | DialogUtils.toastMessage(context, context.getResources().getString(R.string.error_generic));
114 | } else {
115 | packageList.setHiddenList(appList);
116 | DialogUtils.toastAction(context, context.getResources().getString(R.string.reboot_query), context.getResources().getString(R.string.reboot), new View.OnClickListener() {
117 | @Override
118 | public void onClick(View v) {
119 | ShellCommands.rebootSystem();
120 | }
121 | });
122 | }
123 | }
124 |
125 | public static void favorite(PackageInfo packageInfo) {
126 | /*if (App.getAppPreferences().getFavoriteList().contains(packageInfo.packageName)) {
127 | List list = App.getAppPreferences().getFavoriteList();
128 | list.remove(packageInfo.packageName);
129 | App.getAppPreferences().setFavoriteList(list);
130 | } else {
131 | List list = App.getAppPreferences().getFavoriteList();
132 | list.add(packageInfo.packageName);
133 | App.getAppPreferences().setFavoriteList(list);
134 | }*/
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/app/src/main/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Un\'app manager semplice, moderno e personalizzabile
5 |
6 |
7 | App installate
8 | App di sistema
9 | Preferiti
10 | App nascoste
11 | App disattivate
12 | Impostazioni
13 | Info
14 |
15 | Apri
16 | Estrai
17 | Condividi
18 | Disinstalla
19 | Nascondi
20 | Disattiva
21 | Sistema
22 | Cancella Cache
23 | Cancella dati
24 |
25 | Memoria
26 | Interna
27 | Esterna
28 | Code
29 | Data
30 | Cache
31 | Obb
32 | Media
33 | Ordina
34 | Invia
35 | Riavvia
36 | Annulla
37 | Cerca
38 | Cerca per nome...
39 | Nessun risultato in seguito alla ricerca.
40 |
41 |
42 | Performing action
43 | Waiting for some tasks to finish executing.
44 | Sei sicuro di voler disinstallare?
45 | Stai per rimuovere un\'applicazione di sistema. Non rimuovere niente se non sei sicuro di quello che fai; il dispositivo potrebbe subire dei danni.
46 | Autorizzazione necessaria
47 | Devi accettare l\'autorizzazione per estrarre e condividere i pacchetti, pulire la cache ed eliminare i dati.
48 | Root necessario
49 | Il dispositivo deve disporre dei permessi di root. Se non sono stati concessi, utilizza l\'app SuperUser per concedere l\'accesso a ML Manager.
50 |
51 |
52 | Etichetta
53 | Pacchetto
54 | Versione
55 | Version Codice
56 | Dimensione
57 | Dati
58 | Source
59 | Installazione
60 | Ultimo aggiornamento
61 | In sviluppo
62 | ...
63 | 404
64 |
65 |
66 | Applicazioni
67 | Personalizzazione
68 | Altro
69 |
70 | Cartella predefinita per gli APK estratti
71 | Nome predefinito per gli APK estratti
72 | Ordina le app per...
73 | Tema
74 | Colore primario
75 | Imposta il colore principale per la barra di navigazione e per quella degli strumenti. Richiede Android 5.0+
76 | Colore del Floating Button
77 | Imposta il colore del Floating Action Button.
78 | Colorful Status Bar
79 | Use the primary color for the status bar.
80 | Mostra la barra di navigazione in nero
81 | Non utilizzare un colore personalizzato per la barra di navigazione.
82 | Premi indietro per uscire
83 | Premi due volte indietro per uscire dall\'app.
84 | Abilita funzioni Root
85 | Può danneggiare il dispositivo ma forse andrà tutto bene.
86 | Clear Data
87 | Delete all saved packages, hidden apps, and other data.
88 | Ripristina impostazioni predefinite
89 | Ripristina le preferenze ai loro valori predefiniti.
90 |
91 |
92 | dkanada
93 | Javier Santos
94 | Javier Toro
95 | Lucian Sipos
96 | TykTak
97 | App Maintainer
98 | Original Developer
99 | Icon Designer
100 |
101 |
102 | Nome app copiato negli appunti.
103 | Tocca ancora per chiudere l\'app.
104 | Per visualizzare i cambiamenti è necessario riavviare il dispositivo. Riavviare adesso?
105 | There was an error and the selected action was not successfully completed.
106 | Quest\'app non ha un\'interfaccia grafica.
107 | APK \"%1$s\" salvato nella cartella \"MLManager\" con il nome: %2$s.
108 | Le cache di %s sono state eliminate.
109 | Tutti i dati di %s sono stati rimossi.
110 |
111 |
112 | Chiaro
113 | Scuro
114 |
115 |
116 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenAPK
5 | Modern, easy and customizable app manager for Android.
6 | transition
7 |
8 |
9 | Installed Apps
10 | System Apps
11 | Favorite Apps
12 | Hidden Apps
13 | Disabled Apps
14 | Settings
15 | About
16 |
17 | Open
18 | Extract
19 | Share
20 | Uninstall
21 | Hide
22 | Disable
23 | System
24 | Remove Cache
25 | Remove Data
26 |
27 | Storage
28 | Internal
29 | External
30 | Code
31 | Data
32 | Cache
33 | Obb
34 | Media
35 | Sort
36 | Send
37 | Reboot
38 | Undo
39 | Search
40 | Search by name...
41 | No results were found for your search.
42 |
43 |
44 | Performing action
45 | Waiting for some tasks to finish executing.
46 | System action
47 | This action could possibly break your phone. Are you sure you want to continue?
48 | Permissions required
49 | You must accept the permissions to extract and share packages, clean the cache, and remove data.
50 | Root required
51 | Your device must be rooted for this feature to work and root features must be enabled in the settings.
52 |
53 |
54 | Label
55 | Package
56 | Version Name
57 | Version Code
58 | Size
59 | Data
60 | Source
61 | First Installed
62 | Last Updated
63 | In Development
64 | ...
65 | 404
66 |
67 |
68 | Applications
69 | Colors
70 | Other
71 |
72 | Directory
73 | Filename
74 | Sort Method
75 | Theme
76 | Primary Color
77 | Set the color for the toolbar and navigation bar.
78 | Accent Color
79 | Set the accent color for the quick actions and other elements.
80 | Colorful Status Bar
81 | Use the primary color for the status bar.
82 | Colorful Navigation Bar
83 | Use the primary color for the navigation bar.
84 | Press Back to Exit
85 | Press the back button twice to close the app.
86 | Enable Root Features
87 | This could break your phone but it will probably be fine.
88 | Clear Data
89 | Delete all saved packages, hidden apps, and other data.
90 | Reset Preferences
91 | Reset the preferences to their default values.
92 |
93 |
94 | dkanada
95 | Javier Santos
96 | Javier Toro
97 | Lucian Sipos
98 | TykTak
99 | App Maintainer
100 | Original Developer
101 | Icon Designer
102 |
103 |
104 | App name copied to clipboard.
105 | Tap again to close the app.
106 | A reboot might be necessary to display the changes. Do you want to reboot now?
107 | There was an error and the selected action was not successfully completed.
108 | This app does not have a user interface.
109 | %1$s has been saved into the specified folder with name: %2$s.
110 | The cache for %s has been removed.
111 | The data for %s has been removed.
112 |
113 |
114 | Light
115 | Dark
116 |
117 |
118 | pref_custom_path
119 | pref_custom_file
120 | pref_sort_method
121 | pref_theme
122 | pref_primary_color
123 | pref_accent_color
124 | pref_status_color
125 | pref_navigation_color
126 | pref_double_tap
127 | pref_enable_root
128 | pref_initial_setup
129 | pref_root
130 | pref_reset
131 | pref_hidden_list
132 | pref_favorite_list
133 |
134 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dkanada/openapk/activities/AppActivity.java:
--------------------------------------------------------------------------------
1 | package com.dkanada.openapk.activities;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.graphics.drawable.BitmapDrawable;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.support.v7.widget.Toolbar;
9 | import android.util.Log;
10 | import android.view.Menu;
11 | import android.view.MenuItem;
12 | import android.view.View;
13 | import android.view.WindowManager;
14 | import android.widget.CompoundButton;
15 | import android.widget.ImageView;
16 | import android.widget.LinearLayout;
17 | import android.widget.Switch;
18 | import android.widget.TextView;
19 |
20 | import com.afollestad.materialdialogs.MaterialDialog;
21 | import com.dkanada.openapk.async.DeleteFileAsync;
22 | import com.dkanada.openapk.models.AppItem;
23 | import com.dkanada.openapk.utils.Actions;
24 | import com.dkanada.openapk.App;
25 | import com.dkanada.openapk.R;
26 | import com.dkanada.openapk.utils.AppPreferences;
27 | import com.dkanada.openapk.utils.DialogUtils;
28 | import com.dkanada.openapk.utils.OtherUtils;
29 | import com.dkanada.openapk.views.ButtonSwitchView;
30 | import com.dkanada.openapk.views.ButtonView;
31 | import com.dkanada.openapk.views.InformationView;
32 |
33 | import java.io.File;
34 |
35 | public class AppActivity extends ThemeActivity {
36 | private Context context;
37 | private AppItem appItem;
38 | private MenuItem favorite;
39 |
40 | @Override
41 | protected void onCreate(Bundle savedInstanceState) {
42 | super.onCreate(savedInstanceState);
43 | setContentView(R.layout.activity_app);
44 | appItem = getIntent().getParcelableExtra("appItem");
45 | context = this;
46 |
47 | setInitialConfiguration();
48 | setScreenElements();
49 | }
50 |
51 | private void setInitialConfiguration() {
52 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
53 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
54 | @Override
55 | public void onClick(View view) {
56 | onBackPressed();
57 | }
58 | });
59 | toolbar.setBackgroundColor(AppPreferences.get(context).getPrimaryColor());
60 |
61 | setSupportActionBar(toolbar);
62 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
63 | getSupportActionBar().setTitle("");
64 |
65 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
66 | getWindow().setStatusBarColor(OtherUtils.dark(AppPreferences.get(context).getPrimaryColor(), 0.8));
67 | getWindow().setNavigationBarColor(AppPreferences.get(context).getPrimaryColor());
68 | }
69 |
70 | private void setScreenElements() {
71 | TextView header = (TextView) findViewById(R.id.header);
72 | ImageView icon = (ImageView) findViewById(R.id.app_icon);
73 | TextView name = (TextView) findViewById(R.id.app_name);
74 |
75 | header.setBackgroundColor(AppPreferences.get(context).getPrimaryColor());
76 | icon.setImageDrawable(new BitmapDrawable(getResources(), appItem.getIcon()));
77 | name.setText(appItem.getPackageLabel());
78 |
79 | ImageView open = (ImageView) findViewById(R.id.open);
80 | ImageView extract = (ImageView) findViewById(R.id.extract);
81 | ImageView uninstall = (ImageView) findViewById(R.id.uninstall);
82 | ImageView share = (ImageView) findViewById(R.id.share);
83 | ImageView settings = (ImageView) findViewById(R.id.settings);
84 |
85 | if (App.getAppPreferences().getTheme().equals("0")) {
86 | open.setColorFilter(getResources().getColor(R.color.grey_two));
87 | extract.setColorFilter(getResources().getColor(R.color.grey_two));
88 | uninstall.setColorFilter(getResources().getColor(R.color.grey_two));
89 | share.setColorFilter(getResources().getColor(R.color.grey_two));
90 | settings.setColorFilter(getResources().getColor(R.color.grey_two));
91 | }
92 |
93 | open.setOnClickListener(new View.OnClickListener() {
94 | @Override
95 | public void onClick(View view) {
96 | Actions.open(context, appItem);
97 | }
98 | });
99 | extract.setOnClickListener(new View.OnClickListener() {
100 | @Override
101 | public void onClick(View view) {
102 | Actions.extract(context, appItem);
103 | }
104 | });
105 | uninstall.setOnClickListener(new View.OnClickListener() {
106 | @Override
107 | public void onClick(View view) {
108 | if (appItem.system) {
109 | Actions.uninstall(context, appItem);
110 | } else {
111 | Intent intent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE);
112 | intent.setData(Uri.parse("package:" + appItem.getPackageName()));
113 | intent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
114 | startActivityForResult(intent, AppPreferences.CODE_UNINSTALL);
115 | }
116 | }
117 | });
118 | share.setOnClickListener(new View.OnClickListener() {
119 | @Override
120 | public void onClick(View view) {
121 | Actions.share(context, appItem);
122 | }
123 | });
124 | settings.setOnClickListener(new View.OnClickListener() {
125 | @Override
126 | public void onClick(View view) {
127 | Actions.settings(context, appItem);
128 | }
129 | });
130 |
131 | LinearLayout information = (LinearLayout) findViewById(R.id.information);
132 | InformationView packageInformation = new InformationView(context, getString(R.string.layout_package), appItem.getPackageName(), true);
133 | InformationView versionNameInformation = new InformationView(context, getString(R.string.layout_version_name), appItem.getVersionName(), false);
134 | InformationView versionCodeInformation = new InformationView(context, getString(R.string.layout_version_code), appItem.getVersionCode(), true);
135 | InformationView dataFolderInformation = new InformationView(context, getString(R.string.layout_data), new File(appItem.getData()).getParent(), false);
136 | InformationView sourceFolderInformation = new InformationView(context, getString(R.string.layout_source), new File(new File(appItem.getSource()).getParent()).getParent(), true);
137 | InformationView installInformation = new InformationView(context, getString(R.string.layout_install), OtherUtils.formatDate(Long.valueOf(appItem.getInstall())), false);
138 | InformationView updateInformation = new InformationView(context, getString(R.string.layout_update), OtherUtils.formatDate(Long.valueOf(appItem.getUpdate())), true);
139 | information.addView(packageInformation);
140 | information.addView(versionNameInformation);
141 | information.addView(versionCodeInformation);
142 | information.addView(dataFolderInformation);
143 | information.addView(sourceFolderInformation);
144 | information.addView(installInformation);
145 | information.addView(updateInformation);
146 |
147 | LinearLayout buttons = (LinearLayout) findViewById(R.id.buttons);
148 | Switch hideSwitch = new Switch(context);
149 | hideSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
150 | @Override
151 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
152 | Actions.hide(context, appItem);
153 | }
154 | });
155 | Switch disableSwitch = new Switch(context);
156 | if (appItem.disable) {
157 | disableSwitch.setChecked(true);
158 | }
159 | disableSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
160 | @Override
161 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
162 | Actions.disable(context, appItem);
163 | }
164 | });
165 | Switch systemSwitch = new Switch(context);
166 | ButtonSwitchView hide = new ButtonSwitchView(context, getResources().getString(R.string.action_hide), null, hideSwitch);
167 | ButtonSwitchView disable = new ButtonSwitchView(context, getResources().getString(R.string.action_disable), null, disableSwitch);
168 | ButtonSwitchView system = new ButtonSwitchView(context, getResources().getString(R.string.action_system), null, systemSwitch);
169 | buttons.addView(hide);
170 | buttons.addView(disable);
171 | buttons.addView(system);
172 |
173 | ButtonView storage = new ButtonView(context, getString(R.string.storage), null, new View.OnClickListener() {
174 | @Override
175 | public void onClick(View v) {
176 | Intent intent = new Intent(context, StorageActivity.class);
177 | intent.putExtra("appItem", appItem);
178 | context.startActivity(intent);
179 | }
180 | });
181 | ButtonView removeCache = new ButtonView(context, getString(R.string.action_remove_cache), null, new View.OnClickListener() {
182 | @Override
183 | public void onClick(View v) {
184 | MaterialDialog dialog = DialogUtils.dialogProgress(context
185 | , getResources().getString(R.string.dialog_progress)
186 | , getResources().getString(R.string.dialog_progress_description));
187 | new DeleteFileAsync(context, dialog, appItem.getData() + "/cache").execute();
188 | }
189 | });
190 | ButtonView removeData = new ButtonView(context, getString(R.string.action_remove_data), null, new View.OnClickListener() {
191 | @Override
192 | public void onClick(View v) {
193 | MaterialDialog dialog = DialogUtils.dialogProgress(context
194 | , getResources().getString(R.string.dialog_progress)
195 | , getResources().getString(R.string.dialog_progress_description));
196 | new DeleteFileAsync(context, dialog, appItem.getData()).execute();
197 | }
198 | });
199 | buttons.addView(storage);
200 | buttons.addView(removeCache);
201 | buttons.addView(removeData);
202 | }
203 |
204 | @Override
205 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
206 | super.onActivityResult(requestCode, resultCode, data);
207 | if (requestCode == AppPreferences.CODE_UNINSTALL) {
208 | if (resultCode == RESULT_OK) {
209 | Log.i("UNINSTALL: ", appItem.getPackageName() + " SUCCESS");
210 | Intent intent = new Intent(context, MainActivity.class);
211 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
212 | startActivity(intent);
213 | } else if (resultCode == RESULT_CANCELED) {
214 | Log.i("UNINSTALL: ", appItem.getPackageName() + " FAILURE");
215 | }
216 | }
217 | }
218 |
219 | @Override
220 | public boolean onCreateOptionsMenu(Menu menu) {
221 | getMenuInflater().inflate(R.menu.menu_app, menu);
222 | return true;
223 | }
224 |
225 | @Override
226 | public boolean onPrepareOptionsMenu(Menu menu) {
227 | favorite = menu.findItem(R.id.action_favorite);
228 | //OtherUtils.updateAppFavoriteIcon(context, favorite, packageInfo);
229 | return super.onPrepareOptionsMenu(menu);
230 | }
231 |
232 | @Override
233 | public boolean onOptionsItemSelected(MenuItem item) {
234 | switch (item.getItemId()) {
235 | case R.id.home:
236 | finish();
237 | return true;
238 | case R.id.action_favorite:
239 | //Actions.favorite(packageInfo);
240 | //OtherUtils.updateAppFavoriteIcon(context, favorite, packageInfo);
241 | return true;
242 | }
243 | return super.onOptionsItemSelected(item);
244 | }
245 | }
246 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
14 |
15 |
21 |
22 |
29 |
30 |
41 |
42 |
55 |
56 |
57 |
58 |
62 |
63 |
68 |
69 |
75 |
76 |
87 |
88 |
98 |
99 |
108 |
109 |
110 |
111 |
118 |
119 |
129 |
130 |
140 |
141 |
150 |
151 |
152 |
153 |
160 |
161 |
171 |
172 |
182 |
183 |
192 |
193 |
194 |
195 |
201 |
202 |
207 |
208 |
215 |
216 |
225 |
226 |
227 |
228 |
233 |
234 |
241 |
242 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
--------------------------------------------------------------------------------