Skip to content
Permalink
Browse files

Merge pull request #146 from amitshekhariitbhu/update

Reduce library size
  • Loading branch information...
amitshekhariitbhu committed Feb 18, 2019
2 parents e3c5471 + 6b4db14 commit d14adf9715fe9a5b84c74b04cbbcea11e6043ef1
Showing with 2,214 additions and 451 deletions.
  1. +15 −8 .gitignore
  2. +10 −1 CHANGELOG.md
  3. +1 −1 LICENSE
  4. +39 −17 README.md
  5. +0 −17 app/proguard-rules.pro
  6. +6 −11 build.gradle
  7. +48 −0 debug-db-base/build.gradle
  8. +104 −0 debug-db-base/debug-db-base-upload.gradle
  9. +78 −0 debug-db-base/proguard-rules.pro
  10. +1 −1 {debug-db → debug-db-base}/src/androidTest/java/com/amitshekhar/ExampleInstrumentedTest.java
  11. +26 −0 debug-db-base/src/main/AndroidManifest.xml
  12. +29 −13 {debug-db → debug-db-base}/src/main/assets/app.js
  13. +1 −1 {debug-db → debug-db-base}/src/main/assets/bootstrap.min.css
  14. +1 −1 {debug-db → debug-db-base}/src/main/assets/bootstrap.min.js
  15. 0 {debug-db → debug-db-base}/src/main/assets/buttons.dataTables.min.css
  16. +1 −1 {debug-db → debug-db-base}/src/main/assets/custom.css
  17. +1 −1 {debug-db → debug-db-base}/src/main/assets/dataTables.altEditor.free.js
  18. 0 {debug-db → debug-db-base}/src/main/assets/dataTables.buttons.min.js
  19. 0 {debug-db → debug-db-base}/src/main/assets/dataTables.responsive.min.js
  20. 0 {debug-db → debug-db-base}/src/main/assets/dataTables.select.min.js
  21. BIN {debug-db → debug-db-base}/src/main/assets/favicon.ico
  22. BIN {debug-db → debug-db-base}/src/main/assets/fonts/glyphicons-halflings-regular.ttf
  23. +10 −5 {debug-db → debug-db-base}/src/main/assets/index.html
  24. 0 {debug-db → debug-db-base}/src/main/assets/jquery.dataTables.min.css
  25. 0 {debug-db → debug-db-base}/src/main/assets/jquery.dataTables.min.js
  26. 0 {debug-db → debug-db-base}/src/main/assets/jquery.min.js
  27. 0 {debug-db → debug-db-base}/src/main/assets/responsive.dataTables.min.css
  28. 0 {debug-db → debug-db-base}/src/main/assets/select.dataTables.min.css
  29. +4 −3 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/DebugDB.java
  30. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/model/Response.java
  31. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/model/RowDataRequest.java
  32. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/model/TableDataResponse.java
  33. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/model/UpdateRowResponse.java
  34. +5 −4 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/server/ClientServer.java
  35. +35 −7 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/server/RequestHandler.java
  36. +9 −0 debug-db-base/src/main/java/com/amitshekhar/sqlite/DBFactory.java
  37. 0 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/sqlite/InMemoryDebugSQLiteDB.java
  38. 0 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/sqlite/SQLiteDB.java
  39. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/Constants.java
  40. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/ConverterUtils.java
  41. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/DataType.java
  42. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/DatabaseFileProvider.java
  43. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/DatabaseHelper.java
  44. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/NetworkUtils.java
  45. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/PrefHelper.java
  46. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/TableNameParser.java
  47. +1 −1 {debug-db → debug-db-base}/src/main/java/com/amitshekhar/utils/Utils.java
  48. +22 −0 debug-db-base/src/main/res/values/strings.xml
  49. +2 −2 {debug-db → debug-db-base}/src/test/java/com/amitshekhar/ExampleUnitTest.java
  50. 0 {app → debug-db-encrypt}/.gitignore
  51. +28 −0 debug-db-encrypt/build.gradle
  52. +104 −0 debug-db-encrypt/debug-db-encrypt-upload.gradle
  53. +21 −0 debug-db-encrypt/proguard-rules.pro
  54. +26 −0 debug-db-encrypt/src/androidTest/java/com/amitshekhar/debug/encrypt/ExampleInstrumentedTest.java
  55. +12 −0 debug-db-encrypt/src/main/AndroidManifest.xml
  56. +63 −0 debug-db-encrypt/src/main/java/com/amitshekhar/debug/encrypt/DebugDBEncryptInitProvider.java
  57. +18 −0 debug-db-encrypt/src/main/java/com/amitshekhar/debug/encrypt/sqlite/DebugDBEncryptFactory.java
  58. +62 −0 debug-db-encrypt/src/main/java/com/amitshekhar/debug/encrypt/sqlite/DebugEncryptSQLiteDB.java
  59. +3 −0 debug-db-encrypt/src/main/res/values/strings.xml
  60. +17 −0 debug-db-encrypt/src/test/java/com/amitshekhar/debug/encrypt/ExampleUnitTest.java
  61. +7 −36 debug-db/build.gradle
  62. +3 −2 debug-db/debug-db-upload.gradle
  63. +8 −62 debug-db/proguard-rules.pro
  64. +26 −0 debug-db/src/androidTest/java/com/amitshekhar/debug/ExampleInstrumentedTest.java
  65. +3 −25 debug-db/src/main/AndroidManifest.xml
  66. +7 −4 debug-db/src/main/java/com/amitshekhar/{ → debug}/DebugDBInitProvider.java
  67. +16 −0 debug-db/src/main/java/com/amitshekhar/debug/sqlite/DebugDBFactory.java
  68. +3 −6 debug-db/src/main/java/com/amitshekhar/{ → debug}/sqlite/DebugSQLiteDB.java
  69. +1 −20 debug-db/src/main/res/values/strings.xml
  70. +17 −0 debug-db/src/test/java/com/amitshekhar/debug/ExampleUnitTest.java
  71. +1 −1 gradle.properties
  72. BIN gradle/wrapper/gradle-wrapper.jar
  73. +1 −21 gradle/wrapper/gradle-wrapper.properties
  74. +42 −30 gradlew
  75. +84 −90 gradlew.bat
  76. +1 −0 sample-app-encrypt/.gitignore
  77. +35 −0 sample-app-encrypt/build.gradle
  78. +21 −0 sample-app-encrypt/proguard-rules.pro
  79. +26 −0 sample-app-encrypt/src/androidTest/java/com/sample/encrypt/ExampleInstrumentedTest.java
  80. +21 −0 sample-app-encrypt/src/main/AndroidManifest.xml
  81. +10 −10 ...src/main/java/com/sample → sample-app-encrypt/src/main/java/com/sample/encrypt}/MainActivity.java
  82. +134 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/CarDBHelper.java
  83. +136 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/ContactDBHelper.java
  84. +92 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/ExtTestDBHelper.java
  85. +3 −3 ...va/com/sample → sample-app-encrypt/src/main/java/com/sample/encrypt}/database/PersonDBHelper.java
  86. +14 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/room/AppDatabase.java
  87. +17 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/room/User.java
  88. +46 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/room/UserDBHelper.java
  89. +33 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/database/room/UserDao.java
  90. +91 −0 sample-app-encrypt/src/main/java/com/sample/encrypt/utils/Utils.java
  91. +34 −0 sample-app-encrypt/src/main/res/drawable-v24/ic_launcher_foreground.xml
  92. +170 −0 sample-app-encrypt/src/main/res/drawable/ic_launcher_background.xml
  93. +39 −0 sample-app-encrypt/src/main/res/layout/activity_main.xml
  94. +5 −0 sample-app-encrypt/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  95. +5 −0 sample-app-encrypt/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  96. BIN sample-app-encrypt/src/main/res/mipmap-hdpi/ic_launcher.png
  97. BIN sample-app-encrypt/src/main/res/mipmap-hdpi/ic_launcher_round.png
  98. BIN sample-app-encrypt/src/main/res/mipmap-mdpi/ic_launcher.png
  99. BIN sample-app-encrypt/src/main/res/mipmap-mdpi/ic_launcher_round.png
  100. BIN sample-app-encrypt/src/main/res/mipmap-xhdpi/ic_launcher.png
  101. BIN sample-app-encrypt/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  102. BIN sample-app-encrypt/src/main/res/mipmap-xxhdpi/ic_launcher.png
  103. BIN sample-app-encrypt/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  104. BIN sample-app-encrypt/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  105. BIN sample-app-encrypt/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  106. +6 −0 sample-app-encrypt/src/main/res/values/colors.xml
  107. +1 −1 {app → sample-app-encrypt}/src/main/res/values/dimens.xml
  108. +4 −0 sample-app-encrypt/src/main/res/values/strings.xml
  109. +11 −0 sample-app-encrypt/src/main/res/values/styles.xml
  110. +17 −0 sample-app-encrypt/src/test/java/com/sample/encrypt/ExampleUnitTest.java
  111. +10 −15 {app → sample-app}/build.gradle
  112. +21 −0 sample-app/proguard-rules.pro
  113. +1 −1 {app → sample-app}/src/androidTest/java/com/sample/ExampleInstrumentedTest.java
  114. +2 −2 {app → sample-app}/src/main/AndroidManifest.xml
  115. +135 −0 sample-app/src/main/java/com/sample/MainActivity.java
  116. +2 −2 {app → sample-app}/src/main/java/com/sample/database/CarDBHelper.java
  117. +2 −2 {app → sample-app}/src/main/java/com/sample/database/ContactDBHelper.java
  118. 0 {app → sample-app}/src/main/java/com/sample/database/ExtTestDBHelper.java
  119. +1 −1 {app → sample-app}/src/main/java/com/sample/database/room/AppDatabase.java
  120. 0 {app → sample-app}/src/main/java/com/sample/database/room/User.java
  121. 0 {app → sample-app}/src/main/java/com/sample/database/room/UserDBHelper.java
  122. 0 {app → sample-app}/src/main/java/com/sample/database/room/UserDao.java
  123. +1 −1 {app → sample-app}/src/main/java/com/sample/utils/Utils.java
  124. +1 −1 {app → sample-app}/src/main/res/layout/activity_main.xml
  125. BIN {app → sample-app}/src/main/res/mipmap-hdpi/ic_launcher.png
  126. BIN {app → sample-app}/src/main/res/mipmap-mdpi/ic_launcher.png
  127. BIN {app → sample-app}/src/main/res/mipmap-xhdpi/ic_launcher.png
  128. BIN {app → sample-app}/src/main/res/mipmap-xxhdpi/ic_launcher.png
  129. BIN {app → sample-app}/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  130. +1 −1 {app → sample-app}/src/main/res/values-w820dp/dimens.xml
  131. +1 −1 {app → sample-app}/src/main/res/values/colors.xml
  132. +24 −0 sample-app/src/main/res/values/dimens.xml
  133. +1 −1 {app → sample-app}/src/main/res/values/strings.xml
  134. +1 −1 {app → sample-app}/src/main/res/values/styles.xml
  135. +2 −2 {app → sample-app}/src/test/java/com/sample/ExampleUnitTest.java
  136. +2 −2 settings.gradle
@@ -1,10 +1,17 @@
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Android Studio generated folders
captures/
.externalNativeBuild

# IntelliJ project files
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.idea/

# Misc
.DS_Store
/build
/captures
.externalNativeBuild
/.idea
@@ -1,6 +1,15 @@
Change Log
==========

Version 1.0.5 *(2019-02-18)*
----------------------------

* Reduce size by taking out encrypted database library as a separate module
* New: Add support for database delete
* Changed compile to implementation
* Fix: Minor bug fixes


Version 1.0.4 *(2018-06-23)*
----------------------------

@@ -48,7 +57,7 @@ Version 0.5.0 *(2017-01-21)*

* New: Export DB
* New: Method to get DB version
* Fix: Fix prouard issue and other minor issues
* Fix: Fix proguard issue and other minor issues


Version 0.4.0 *(2016-11-29)*
@@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
@@ -10,11 +10,12 @@
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/amitshekhariitbhu/Android-Debug-Database/blob/master/LICENSE)
## Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications.
## Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications
### Android Debug Database allows you to view databases and shared preferences directly in your browser in a very simple way.
### Android Debug Database allows you to view databases and shared preferences directly in your browser in a very simple way
### What can Android Debug Database do?
* See all the databases.
* See all the data in the shared preferences used in your application.
* Run any sql query on the given database to update and delete your data.
@@ -30,13 +31,22 @@
### All these features work without rooting your device -> No need of rooted device
### Check out another awesome library for fast and simple networking in Android.
### Check out another awesome library for fast and simple networking in Android
* [Fast Android Networking Library](https://github.com/amitshekhariitbhu/Fast-Android-Networking)
### Using Android Debug Database Library in your application
Add this to your app's build.gradle
```groovy
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.5'
```
Using the Android Debug Database with encrypted database
```groovy
debugImplementation 'com.amitshekhar.android:debug-db-encrypt:1.0.5'
```
Use `debugImplementation` so that it will only compile in your debug build and not in your release build.
@@ -50,10 +60,11 @@ That’s all, just start the application, you will see in the logcat an entry li
Now open the provided link in your browser.
Important:
- Your Android phone and laptop should be connected to the same Network (Wifi or LAN).
- If you are using it over usb, run `adb forward tcp:8080 tcp:8080`
Note : If you want use different port other than 8080.
* Your Android phone and laptop should be connected to the same Network (Wifi or LAN).
* If you are using it over usb, run `adb forward tcp:8080 tcp:8080`
Note : If you want use different port other than 8080.
In the app build.gradle file under buildTypes do the following change
```groovy
@@ -62,23 +73,25 @@ debug {
}
```
You will see something like this :
### Seeing values
<img src=https://raw.githubusercontent.com/amitshekhariitbhu/Android-Debug-Database/master/assets/debugdb.png >
### Editing values
<img src=https://raw.githubusercontent.com/amitshekhariitbhu/Android-Debug-Database/master/assets/debugdb_edit.png >
### Working with emulator
- Android Default Emulator: Run the command in the terminal - `adb forward tcp:8080 tcp:8080` and open http://localhost:8080
- Genymotion Emulator: Enable bridge from configure virtual device (option available in genymotion)
* Android Default Emulator: Run the command in the terminal - `adb forward tcp:8080 tcp:8080` and open http://localhost:8080
* Genymotion Emulator: Enable bridge from configure virtual device (option available in genymotion)
### Getting address with toast, in case you missed the address log in logcat
As this library is auto-initialize, if you want to get the address log, add the following method and call (we have to do like this to avoid build error in release build as this library will not be included in the release build) using reflection.
```java
public static void showDebugDBAddressLogToast(Context context) {
if (BuildConfig.DEBUG) {
@@ -95,7 +108,9 @@ public static void showDebugDBAddressLogToast(Context context) {
```
### Adding custom database files
As this library is auto-initialize, if you want to debug custom database files, add the following method and call
```java
public static void setCustomDatabaseFiles(Context context) {
if (BuildConfig.DEBUG) {
@@ -117,7 +132,9 @@ public static void setCustomDatabaseFiles(Context context) {
```
### Adding InMemory Room databases
As this library is auto-initialize, if you want to debug inMemory Room databases, add the following method and call
```java
public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
if (BuildConfig.DEBUG) {
@@ -137,23 +154,27 @@ public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
```
### Find this project useful ? :heart:
* Support it by clicking the :star: button on the upper right of this page. :v:
### TODO
* Simplify emulator issue [Issue Link](https://github.com/amitshekhariitbhu/Android-Debug-Database/issues/6)
* And of course many more features and bug fixes.
### [Check out Mindorks awesome open source projects here](https://mindorks.com/open-source-projects)
### Contact - Let's become friends
- [Twitter](https://twitter.com/amitiitbhu)
- [Github](https://github.com/amitshekhariitbhu)
- [Medium](https://medium.com/@amitshekhar)
- [Facebook](https://www.facebook.com/amit.shekhar.iitbhu)
* [Twitter](https://twitter.com/amitiitbhu)
* [GitHub](https://github.com/amitshekhariitbhu)
* [Medium](https://medium.com/@amitshekhar)
* [Facebook](https://www.facebook.com/amit.shekhar.iitbhu)
### License
```
Copyright (C) 2016 Amit Shekhar
Copyright (C) 2019 Amit Shekhar
Copyright (C) 2011 Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -170,5 +191,6 @@ public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
```
### Contributing to Android Debug Database
All pull requests are welcome, make sure to follow the [contribution guidelines](CONTRIBUTING.md)
when you submit pull request.

This file was deleted.

Oops, something went wrong.
@@ -1,6 +1,6 @@
/*
*
* * Copyright (C) 2016 Amit Shekhar
* * Copyright (C) 2019 Amit Shekhar
* * Copyright (C) 2011 Android Open Source Project
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,27 +17,22 @@
*
*/

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

allprojects {
repositories {
jcenter()
google()
jcenter()
}
}

@@ -0,0 +1,48 @@
/*
*
* * Copyright (C) 2019 Amit Shekhar
* * Copyright (C) 2011 Android Open Source Project
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

apply plugin: 'com.android.library'

android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue("string", "PORT_NUMBER", "8080")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'android.arch.persistence.room:runtime:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

//apply from: 'debug-db-base-upload.gradle'
Oops, something went wrong.

0 comments on commit d14adf9

Please sign in to comment.
You can’t perform that action at this time.