├── .gitignore ├── API ├── addDataToDb.md ├── addDataToSp.md ├── deleteDataFromDb.md ├── deleteDataFromSp.md ├── deleteFile.md ├── downloadFile.md ├── getDataFromDbTable.md ├── getDataFromSpFile.md ├── getDbList.md ├── getFileList.md ├── getSpList.md ├── getTableList.md ├── query.md ├── updateDataToDb.md └── updateDataToSp.md ├── LICENSE ├── LICENSE 2 ├── README.md ├── RemoteDataControllerAndroid ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── itgowo │ │ │ └── tool │ │ │ └── remotedatacontroller │ │ │ ├── DBManager.java │ │ │ └── MainActivity.java │ │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── images ├── 1.png ├── 10.png ├── 11.png ├── 12.png ├── 13.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # IntelliJ 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/assetWizardSettings.xml 41 | .idea/dictionaries 42 | .idea/libraries 43 | .idea/caches 44 | 45 | # Keystore files 46 | # Uncomment the following line if you do not want to check your keystore files in. 47 | #*.jks 48 | 49 | # External native build folder generated in Android Studio 2.2 and later 50 | .externalNativeBuild 51 | 52 | # Google Services (e.g. APIs or Firebase) 53 | google-services.json 54 | 55 | # Freeline 56 | freeline.py 57 | freeline/ 58 | freeline_project_description.json 59 | 60 | # fastlane 61 | fastlane/report.xml 62 | fastlane/Preview.html 63 | fastlane/screenshots 64 | fastlane/test_output 65 | fastlane/readme.md 66 | -------------------------------------------------------------------------------- /API/addDataToDb.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 向数据库表内添加数据,一次只能添加一条数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: addDataToDb, 16 | database: appinfo.db, 17 | tableName: historycache, 18 | RowDataRequests: 19 | [ 20 | { 21 | primary: true, 22 | title: id, 23 | value: 1, 24 | dataType: integer 25 | } 26 | { 27 | primary: false, 28 | title: key, 29 | value: GetHomeInfo, 30 | dataType: text 31 | }, 32 | { 33 | primary: false, 34 | title: value, 35 | value: , 36 | dataType: text 37 | }, 38 | { 39 | primary: false, 40 | title: bak, 41 | value: lll, 42 | dataType: 43 | } 44 | ] 45 | } 46 | 47 | ``` 48 | 49 | 50 | |参数名|必选|类型|说明| 51 | |:---- |:---|:----- |----- | 52 | |action |是 |string |执行动作 | 53 | |database |是 |string | 待操作数据库名称 | 54 | |tableName |是 |string | 待操作表名称 | 55 | |RowDataRequests |是 |array |需要添加的数据数组 | 56 | |title |是 |String | 列名称 | 57 | |primary |否 |boolean | 是否是主键 | 58 | |value |是 |String | 对应列要添加的数据 | 59 | |dataType |是 |String | 数据类型 | 60 | 61 | **返回示例** 62 | 63 | ``` 64 | { 65 | code: 200, 66 | msg: success 67 | } 68 | ``` 69 | 70 | **返回参数说明** 71 | 72 | |参数名|类型|说明| 73 | |:----- |:-----|----- | 74 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 75 | |msg |String |返回状态文本,code不是200则提示msg信息 | 76 | 77 | 78 | **备注** 79 | 80 | - 更多返回错误代码请看首页的错误代码描述 81 | 82 | 83 | -------------------------------------------------------------------------------- /API/addDataToSp.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 向数据库表内添加数据,一次只能添加一条数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: addDataToSp, 16 | spFileName: appinfo, 17 | RowDataRequests: 18 | [ 19 | { 20 | primary: true, 21 | title: id, 22 | value: 1, 23 | dataType: integer 24 | } 25 | { 26 | primary: false, 27 | title: key, 28 | value: GetHomeInfo, 29 | dataType: text 30 | }, 31 | { 32 | primary: false, 33 | title: value, 34 | value: , 35 | dataType: text 36 | }, 37 | { 38 | primary: false, 39 | title: bak, 40 | value: lll, 41 | dataType: 42 | } 43 | ] 44 | } 45 | 46 | 47 | ``` 48 | 49 | 50 | |参数名|必选|类型|说明| 51 | |:---- |:---|:----- |----- | 52 | |action |是 |string |执行动作 | 53 | |fileName |是 |string | 共享参数文件名称 | 54 | |RowDataRequests |是 |array |需要添加的数据数组 | 55 | |title |是 |String | 列名称 | 56 | |primary |否 |boolean | 是否是主键 | 57 | |value |是 |String | 对应列要添加的数据 | 58 | |dataType |是 |String | 数据类型 | 59 | 60 | **返回示例** 61 | 62 | ``` 63 | { 64 | code: 200, 65 | msg: success 66 | } 67 | ``` 68 | 69 | **返回参数说明** 70 | 71 | |参数名|类型|说明| 72 | |:----- |:-----|----- | 73 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 74 | |msg |String |返回状态文本,code不是200则提示msg信息 | 75 | 76 | 77 | **备注** 78 | 79 | - 更多返回错误代码请看首页的错误代码描述 80 | 81 | 82 | -------------------------------------------------------------------------------- /API/deleteDataFromDb.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 删除数据库表内数据,一次只能删除一条数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: deleteDataFromDb, 16 | database: appinfo.db, 17 | tableName: historycache, 18 | RowDataRequests: 19 | [ 20 | { 21 | primary: true, 22 | title: id, 23 | value: 3, 24 | dataType: integer 25 | } 26 | ] 27 | } 28 | 29 | ``` 30 | 31 | 32 | |参数名|必选|类型|说明| 33 | |:---- |:---|:----- |----- | 34 | |action |是 |string |执行动作 | 35 | |database |是 |string | 待操作数据库名称 | 36 | |tableName |是 |string | 待操作表名称 | 37 | |RowDataRequests |是 |array |需要添加的数据数组 | 38 | |title |是 |String | 列名称 | 39 | |primary |是 |boolean | 是否是主键 | 40 | |value |是 |String | 对应列要添加的数据 | 41 | |dataType |是 |String | 数据类型 | 42 | 43 | **返回示例** 44 | 45 | ``` 46 | { 47 | code: 200, 48 | msg: success 49 | } 50 | ``` 51 | 52 | **返回参数说明** 53 | 54 | |参数名|类型|说明| 55 | |:----- |:-----|----- | 56 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 57 | |msg |String |返回状态文本,code不是200则提示msg信息 | 58 | 59 | 60 | **备注** 61 | 62 | - 更多返回错误代码请看首页的错误代码描述 63 | 64 | 65 | -------------------------------------------------------------------------------- /API/deleteDataFromSp.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 删除共享参数文件中的数据,一次只能删除一条数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: deleteDataFromSp, 16 | spFileName:appinfo, 17 | RowDataRequests: 18 | [ 19 | { 20 | primary: true, 21 | title: id, 22 | value: 3, 23 | dataType: integer 24 | } 25 | ] 26 | } 27 | 28 | ``` 29 | 30 | 31 | |参数名|必选|类型|说明| 32 | |:---- |:---|:----- |----- | 33 | |action |是 |string |执行动作 | 34 | |database |是 |string | 待操作数据库名称 | 35 | |tableName |是 |string | 待操作表名称 | 36 | |RowDataRequests |是 |array |需要添加的数据数组 | 37 | |title |是 |String | 列名称 | 38 | |primary |否 |boolean | 是否是主键 | 39 | |value |是 |String | 对应列要添加的数据 | 40 | |dataType |是 |String | 数据类型 | 41 | 42 | **返回示例** 43 | 44 | ``` 45 | { 46 | code: 200, 47 | msg: success 48 | } 49 | ``` 50 | 51 | **返回参数说明** 52 | 53 | |参数名|类型|说明| 54 | |:----- |:-----|----- | 55 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 56 | |msg |String |返回状态文本,code不是200则提示msg信息 | 57 | 58 | 59 | **备注** 60 | 61 | - 更多返回错误代码请看首页的错误代码描述 62 | 63 | 64 | -------------------------------------------------------------------------------- /API/deleteFile.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 删除文件 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | "action": "deleteFile", 16 | "data": "/data/user/0/com.itgowo.tool.android_debugdata_webtool/databases" 17 | } 18 | 19 | ``` 20 | 21 | |参数名|必选|类型|说明| 22 | |:---- |:---|:----- |----- | 23 | |action |是 |string |执行动作| 24 | |data |否 |string | 要获取列表的根目录,不传则返回app根目录, | 25 | 26 | **返回示例** 27 | 28 | ``` 29 | { 30 | "code": 200, 31 | "msg": "success" 32 | } 33 | 34 | ``` 35 | 36 | 37 | **返回参数说明** 38 | 39 | |参数名|类型|说明| 40 | |:----- |:-----|----- | 41 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 42 | |msg |String |返回状态文本,code不是200则提示msg信息 | 43 | 44 | 45 | 46 | **备注** 47 | 48 | - 更多返回错误代码请看首页的错误代码描述 49 | 50 | 51 | -------------------------------------------------------------------------------- /API/downloadFile.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 文件下载 4 | 5 | **请求URL:** 6 | - ` /downloadFile?downloadFile=/data/user/0/com.itgowo.tool.android_debugdata_webtool/databases/appinfo.db ` 7 | 8 | **请求方式:** 9 | - GET 10 | 11 | **参数:** 12 | 13 | |参数名|必选|类型|说明| 14 | |:---- |:---|:----- |----- | 15 | |downloadFile |是 |string |要下载的数据库名称 | 16 | 17 | 18 | 19 | **返回参数说明** 20 | 21 | 返回文件 22 | 23 | 24 | 25 | 26 | 27 | 28 | **简要描述:** 29 | 30 | - 数据库文件下载 31 | 32 | **请求URL:** 33 | - ` /downloadFile?downloadFile=/data/user/0/com.itgowo.tool.android_debugdata_webtool/databases/appinfo.db ` 34 | 35 | **请求方式:** 36 | - GET 37 | 38 | **参数:** 39 | 40 | |参数名|必选|类型|说明| 41 | |:---- |:---|:----- |----- | 42 | |downloadFile |是 |string |要下载的数据库名称 | 43 | 44 | 45 | 46 | **返回参数说明** 47 | 48 | 返回文件 49 | 50 | 51 | 52 | 53 | 54 | 55 | **简要描述:** 56 | 57 | - 共享参数文件下载 58 | 59 | **请求URL:** 60 | - ` /downloadFile?downloadFile=/data/user/0/com.itgowo.tool.android_debugdata_webtool/shared_prefs/appinfo.xml ` 61 | 62 | **请求方式:** 63 | - GET 64 | 65 | **参数:** 66 | 67 | |参数名|必选|类型|说明| 68 | |:---- |:---|:----- |----- | 69 | |downloadFile |是 |string |要下载的共享参数文件path路径 | 70 | 71 | 72 | 73 | **返回参数说明** 74 | 75 | 返回文件 76 | 77 | 78 | **备注** 79 | 80 | - 更多返回错误代码请看首页的错误代码描述 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /API/getDataFromDbTable.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 获取表内所有数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action : getDataFromDbTable, 16 | database:appinfo.db, 17 | tableName : historycache, 18 | pageIndex:1, 19 | pageSize:10 20 | } 21 | 22 | ``` 23 | 24 | 25 | |参数名|必选|类型|说明| 26 | |:---- |:---|:----- |----- | 27 | |action |是 |string |执行动作 | 28 | |database |是 |string | 待查数据库名称 | 29 | |tableName |是 |string | 待查表名称 | 30 | |pageIndex |否 |int |页面索引,从1开始,默认为null,获取全部数据 | 31 | |pageSize |否 |int | 数据多少,默认null,获取全部数据 | 32 | 33 | **返回示例** 34 | 35 | ``` 36 | { 37 | code: 200, 38 | editable: true, 39 | msg: success, 40 | tableData: { 41 | tableColumns: [ 42 | { 43 | dataType: integer, 44 | notNull: false, 45 | primary: true, 46 | title: id 47 | }, 48 | { 49 | dataType: text, 50 | notNull: false, 51 | primary: false, 52 | title: key 53 | }, 54 | { 55 | dataType: text, 56 | notNull: false, 57 | primary: false, 58 | title: value 59 | }, 60 | { 61 | dataType: long, 62 | notNull: false, 63 | primary: false, 64 | title: lasttime 65 | }, 66 | { 67 | dataType: text, 68 | notNull: false, 69 | primary: false, 70 | title: bak 71 | }, 72 | { 73 | dataType: text, 74 | notNull: false, 75 | primary: false, 76 | title: flag 77 | } 78 | ], 79 | tableDatas: [ 80 | [ 81 | 16, 82 | 1503476474752, 83 | bbbbbbbb, 84 | 1503476474752, 85 | , 86 | 87 | ], 88 | [ 89 | 17, 90 | 1503893038974, 91 | aaaaaaaaaaaaaaaa, 92 | 1503893038978, 93 | , 94 | 95 | ], 96 | [ 97 | 18, 98 | 1503893038983, 99 | bbbbbbbb, 100 | 1503893038983, 101 | , 102 | 103 | ], 104 | [ 105 | 19, 106 | 1503897959943, 107 | aaaaaaaaaaaaaaaa, 108 | 1503897959946, 109 | , 110 | 111 | ], 112 | [ 113 | 20, 114 | 1503897959948, 115 | bbbbbbbb, 116 | 1503897959948, 117 | , 118 | 119 | ] 120 | ], 121 | dataCount: 20 122 | } 123 | } 124 | ``` 125 | 126 | **返回参数说明** 127 | 128 | |参数名|类型|说明| 129 | |:----- |:-----|----- | 130 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 131 | |msg |String |返回状态文本,code不是200则提示msg信息 | 132 | |editable |boolean |是否可以编辑 | 133 | |tableData |对象 |返回的数据对象 | 134 | |tableColumns |Array |返回表结构信息 | 135 | |dataType |String |数据类型 | 136 | |notNull |boolean |是否可以为null | 137 | |primary |boolean |是否是主键 | 138 | |title |String |列名称 | 139 | |tableDatas |array |对应的一条记录数据 | 140 | |dataCount |int |数据库表中的数据总数 | 141 | 142 | **备注** 143 | 144 | - 更多返回错误代码请看首页的错误代码描述 145 | 146 | 147 | -------------------------------------------------------------------------------- /API/getDataFromSpFile.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 获取共享参数所有数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | 14 | 15 | 16 | ``` 17 | 18 | { 19 | action : getDataFromSpFile, 20 | spFileName : appinfo 21 | } 22 | 23 | ``` 24 | 25 | 26 | |参数名|必选|类型|说明| 27 | |:---- |:---|:----- |----- | 28 | |action |是 |string |执行动作 | 29 | |spFileName |是 |string | 待查共享参数文件名称 | 30 | 31 | 32 | **返回示例** 33 | 34 | 35 | ``` 36 | { 37 | code: 200, 38 | editable: true, 39 | msg: success, 40 | tableData: { 41 | tableColumns: [ 42 | { 43 | primary: true, 44 | title: Key 45 | }, 46 | { 47 | primary: false, 48 | title: Value 49 | }, 50 | { 51 | primary: false, 52 | title: DataType 53 | } 54 | ], 55 | tableDatas: [ 56 | [ 57 | Int, 58 | 1234, 59 | integer 60 | ], 61 | [ 62 | ggg, 63 | teddddst, 64 | text 65 | ], 66 | [ 67 | aaaasdfsafee3aa, 68 | tadsfsadfest, 69 | text 70 | ], 71 | [ 72 | Float, 73 | 1.5, 74 | float 75 | ], 76 | [ 77 | Booblean, 78 | true, 79 | boolean 80 | ], 81 | [ 82 | aaaaa, 83 | test, 84 | text 85 | ], 86 | [ 87 | Long, 88 | 1232131231, 89 | long 90 | ], 91 | [ 92 | adfs, 93 | 1505489963276, 94 | text 95 | ], 96 | [ 97 | String, 98 | tadsfsadfest, 99 | text 100 | ] 101 | ] 102 | } 103 | } 104 | 105 | ``` 106 | 107 | 108 | **返回参数说明** 109 | 110 | |参数名|类型|说明| 111 | |:----- |:-----|----- | 112 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 113 | |msg |String |返回状态文本,code不是200则提示msg信息 | 114 | |editable |boolean |是否可以编辑 | 115 | |tableData |对象 |返回的数据对象 | 116 | |tableColumns |Array |返回表结构信息 | 117 | |dataType |String |数据类型 | 118 | |notNull |boolean |是否可以为null | 119 | |primary |boolean |是否是主键 | 120 | |title |String |列名称 | 121 | |tableDatas |array |对应的一条记录数据 | 122 | |dataCount |int |数据总数 | 123 | 124 | **备注** 125 | 126 | - 更多返回错误代码请看首页的错误代码描述 127 | 128 | 129 | -------------------------------------------------------------------------------- /API/getDbList.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 获取数据库列表 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action : getDbList 16 | } 17 | 18 | ``` 19 | 20 | |参数名|必选|类型|说明| 21 | |:---- |:---|:----- |----- | 22 | |action |是 |string |执行动作| 23 | 24 | 25 | **返回示例** 26 | 27 | ``` 28 | { 29 | code : 200, 30 | msg : success, 31 | dbList : [ 32 | { 33 | fileName: appinfo.db, 34 | path: /data/user/0/com.itgowo.tool.android_debugdata_webtool/databases/appinfo.db 35 | } 36 | ] 37 | } 38 | 39 | ``` 40 | 41 | 42 | **返回参数说明** 43 | 44 | |参数名|类型|说明| 45 | |:----- |:-----|----- | 46 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 47 | |msg |String |返回状态文本,code不是200则提示msg信息 | 48 | |dbList |array |返回结果,数据库文件对象数组 | 49 | |fileName |String |返回结果,文件名 | 50 | |path |String |返回结果,文件路径 | 51 | 52 | **备注** 53 | 54 | - 更多返回错误代码请看首页的错误代码描述 55 | 56 | 57 | -------------------------------------------------------------------------------- /API/getFileList.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 获取文件列表 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: getFileList, 16 | data: /data/user/0/com.itgowo.tool.android_debugdata_webtool/databases 17 | } 18 | 19 | ``` 20 | 21 | |参数名|必选|类型|说明| 22 | |:---- |:---|:----- |----- | 23 | |action |是 |string |执行动作| 24 | |data |否 |string | 要获取列表的根目录,不传则返回app根目录, | 25 | 26 | **返回示例** 27 | 28 | ``` 29 | { 30 | code: 200, 31 | msg: success, 32 | fileList: [ 33 | { 34 | dir: false, 35 | fileName: appinfo.db, 36 | fileSize: 20.00KB, 37 | fileTime: 2017-09-17 23:19:32, 38 | path: /data/user/0/com.itgowo.tool.android_debugdata_webtool/databases/appinfo.db, 39 | rootPath: /data/user/0/com.itgowo.tool.android_debugdata_webtool 40 | }, 41 | { 42 | dir: false, 43 | fileName: appinfo.db-journal, 44 | fileSize: 12.52KB, 45 | fileTime: 2017-09-17 23:19:32, 46 | path: /data/user/0/com.itgowo.tool.android_debugdata_webtool/databases/appinfo.db-journal, 47 | rootPath: /data/user/0/com.itgowo.tool.android_debugdata_webtool 48 | } 49 | ] 50 | } 51 | 52 | ``` 53 | 54 | 55 | **返回参数说明** 56 | 57 | |参数名|类型|说明| 58 | |:----- |:-----|----- | 59 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 60 | |msg |String |返回状态文本,code不是200则提示msg信息 | 61 | |fileList |array |返回结果,文件对象数组 | 62 | |dir |array |返回结果,是否是文件夹 | 63 | |fileName |String |返回结果,文件名 | 64 | |fileSize |String |返回结果,文件大小 | 65 | |fileTime |String |返回结果,文件最后编辑时间 | 66 | |path |String |返回结果,文件路径 | 67 | |rootPath |String |返回结果,文件所在的上级目录地址,返回上级传这个参数,如果为空则是请求首页,及data为空 | 68 | 69 | 70 | **备注** 71 | 72 | - 更多返回错误代码请看首页的错误代码描述 73 | 74 | 75 | -------------------------------------------------------------------------------- /API/getSpList.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 获取共享参数列表 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action : getSpList 16 | } 17 | 18 | ``` 19 | 20 | |参数名|必选|类型|说明| 21 | |:---- |:---|:----- |----- | 22 | |action |是 |string |执行动作| 23 | 24 | 25 | **返回示例** 26 | 27 | ``` 28 | { 29 | code : 200, 30 | msg : success, 31 | SpList : [ 32 | { 33 | fileName: WebViewChromiumPrefs, 34 | path: /data/user/0/com.itgowo.tool.android_debugdata_webtool/shared_prefs/WebViewChromiumPrefs.xml 35 | }, 36 | { 37 | fileName: appinfo, 38 | path: /data/user/0/com.itgowo.tool.android_debugdata_webtool/shared_prefs/appinfo.xml 39 | }, 40 | { 41 | fileName: appinfo11, 42 | path: /data/user/0/com.itgowo.tool.android_debugdata_webtool/shared_prefs/appinfo11.xml 43 | } 44 | ] 45 | } 46 | 47 | ``` 48 | 49 | 50 | **返回参数说明** 51 | 52 | |参数名|类型|说明| 53 | |:----- |:-----|----- | 54 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 55 | |msg |String |返回状态文本,code不是200则提示msg信息 | 56 | |SpList |array |返回结果,数据库文件对象数组 | 57 | |fileName |String |返回结果,文件名 | 58 | |path |String |返回结果,文件路径 | 59 | 60 | **备注** 61 | 62 | - 更多返回错误代码请看首页的错误代码描述 63 | 64 | 65 | -------------------------------------------------------------------------------- /API/getTableList.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 获取数据库表列表 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | 14 | ``` 15 | { 16 | action : getTableList, 17 | database : appinfo.db 18 | } 19 | 20 | ``` 21 | 22 | 23 | 24 | |参数名|必选|类型|说明| 25 | |:---- |:---|:----- |----- | 26 | |action |是 |string |请求参数| 27 | |database |是 |string | 请求参数 | 28 | 29 | 30 | **返回示例** 31 | 32 | ``` 33 | 34 | { 35 | code : 200, 36 | msg : success, 37 | dbVersion : 1, 38 | tableList :[ 39 | android_metadata, 40 | historycache, 41 | sqlite_sequence 42 | ] 43 | } 44 | 45 | ``` 46 | 47 | **返回参数说明** 48 | 49 | |参数名|类型|说明| 50 | |:----- |:-----|----- | 51 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 52 | |msg |String |返回状态文本,code不是200则提示msg信息 | 53 | |dbVersion |int |数据库版本 | 54 | |tableList |array |数据表名字列表数组 | 55 | 56 | **备注** 57 | 58 | - 更多返回错误代码请看首页的错误代码描述 59 | 60 | 61 | -------------------------------------------------------------------------------- /API/query.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 执行SQL数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: query, 16 | database: appinfo.db, 17 | data: select * from historycache where key like '%Home%' 18 | } 19 | 20 | ``` 21 | 22 | 23 | |参数名|必选|类型|说明| 24 | |:---- |:---|:----- |----- | 25 | |action |是 |string |执行动作 | 26 | |database |是 |string | 待操作数据库名称 | 27 | |data |是 |string | SQL语句 | 28 | 29 | **返回示例** 30 | 31 | ``` 32 | { 33 | code: 200, 34 | editable: true, 35 | msg: success, 36 | tableData: { 37 | dataCount: 12, 38 | tableColumns: [ 39 | { 40 | dataType: integer, 41 | notNull: false, 42 | primary: true, 43 | title: id 44 | }, 45 | { 46 | dataType: text, 47 | notNull: false, 48 | primary: false, 49 | title: key 50 | }, 51 | { 52 | dataType: text, 53 | notNull: false, 54 | primary: false, 55 | title: value 56 | }, 57 | { 58 | dataType: long, 59 | notNull: false, 60 | primary: false, 61 | title: lasttime 62 | }, 63 | { 64 | dataType: text, 65 | notNull: false, 66 | primary: false, 67 | title: bak 68 | }, 69 | { 70 | dataType: text, 71 | notNull: false, 72 | primary: false, 73 | title: flag 74 | } 75 | ], 76 | tableDatas: [ 77 | [ 78 | 1, 79 | GetHomeInfo, 80 | llljk, 81 | 1505489911016, 82 | , 83 | 84 | ] 85 | ] 86 | } 87 | } 88 | 89 | ``` 90 | 91 | **返回参数说明** 92 | 93 | |参数名|类型|说明| 94 | |:----- |:-----|----- | 95 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 96 | |msg |String |返回状态文本,code不是200则提示msg信息 | 97 | |editable |boolean |是否可以编辑 | 98 | |tableData |对象 |返回的数据对象 | 99 | |tableColumns |Array |返回表结构信息 | 100 | |dataType |String |数据类型 | 101 | |notNull |boolean |是否可以为null | 102 | |primary |boolean |是否是主键 | 103 | |title |String |列名称 | 104 | |tableDatas |array |对应的一条记录数据 | 105 | |dataCount |int |数据库表中的数据总数 | 106 | 107 | 108 | **备注** 109 | 110 | - 更多返回错误代码请看首页的错误代码描述 111 | 112 | 113 | -------------------------------------------------------------------------------- /API/updateDataToDb.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 更新数据库表内数据,一次只能更新一条数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: updateDataToDb, 16 | database: appinfo.db, 17 | tableName: historycache, 18 | RowDataRequests: 19 | [ 20 | { 21 | primary: true, 22 | title: id, 23 | value: 1, 24 | dataType: integer 25 | } 26 | { 27 | primary: false, 28 | title: key, 29 | value: GetHomeInfo, 30 | dataType: text 31 | }, 32 | { 33 | primary: false, 34 | title: value, 35 | value: , 36 | dataType: text 37 | }, 38 | { 39 | primary: false, 40 | title: bak, 41 | value: lll, 42 | dataType: 43 | } 44 | ] 45 | } 46 | 47 | ``` 48 | 49 | 50 | |参数名|必选|类型|说明| 51 | |:---- |:---|:----- |----- | 52 | |action |是 |string |执行动作 | 53 | |database |是 |string | 待操作数据库名称 | 54 | |tableName |是 |string | 待操作表名称 | 55 | |RowDataRequests |是 |array |需要添加的数据数组 | 56 | |title |是 |String | 列名称 | 57 | |primary |是 |boolean | 是否是主键 | 58 | |value |是 |String | 对应列要添加的数据 | 59 | |dataType |是 |String | 数据类型 | 60 | 61 | **返回示例** 62 | 63 | ``` 64 | { 65 | code: 200, 66 | msg: success 67 | } 68 | ``` 69 | 70 | **返回参数说明** 71 | 72 | |参数名|类型|说明| 73 | |:----- |:-----|----- | 74 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 75 | |msg |String |返回状态文本,code不是200则提示msg信息 | 76 | 77 | 78 | **备注** 79 | 80 | - 更多返回错误代码请看首页的错误代码描述 81 | 82 | 83 | -------------------------------------------------------------------------------- /API/updateDataToSp.md: -------------------------------------------------------------------------------- 1 | **简要描述:** 2 | 3 | - 更新数据库表内数据,一次只能更新一条数据 4 | 5 | **请求URL:** 6 | - ` / ` 7 | 8 | **请求方式:** 9 | - POST 10 | 11 | **参数:** 12 | 13 | ``` 14 | { 15 | action: updateDataToSp, 16 | spFileName: appinfo, 17 | RowDataRequests: 18 | [ 19 | { 20 | primary: true, 21 | title: key, 22 | value: ggg, 23 | dataType: text 24 | }, 25 | { 26 | primary: false, 27 | title: value, 28 | value: 啦啦啦, 29 | dataType: text 30 | } 31 | ] 32 | } 33 | 34 | ``` 35 | 36 | 37 | |参数名|必选|类型|说明| 38 | |:---- |:---|:----- |----- | 39 | |action |是 |string |执行动作 | 40 | |fileName |是 |string | 共享参数文件名称 | 41 | |RowDataRequests |是 |array |需要添加的数据数组 | 42 | |title |是 |String | 列名称 | 43 | |primary |否 |boolean | 是否是主键 | 44 | |value |是 |String | 对应列要添加的数据 | 45 | |dataType |是 |String | 数据类型 | 46 | 47 | **返回示例** 48 | 49 | ``` 50 | { 51 | code: 200, 52 | msg: success 53 | } 54 | ``` 55 | 56 | **返回参数说明** 57 | 58 | |参数名|类型|说明| 59 | |:----- |:-----|----- | 60 | |code |int |返回结果状态 200表示成功,不是200则提示msg信息 | 61 | |msg |String |返回状态文本,code不是200则提示msg信息 | 62 | 63 | 64 | **备注** 65 | 66 | - 更多返回错误代码请看首页的错误代码描述 67 | 68 | 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE 2: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [GitHub](https://github.com/itgowo/RemoteDataControllerForAndroid) 2 | 3 | ### 一:开发环境 4 | Mac OS 10、Android Studio3.2.1 5 | ### 二:介绍 6 | 1. 基于互联网技术的效率工具。 7 | 2. 提高开发与测试人员效率的辅助工具。 8 | 3. 新人培训快速熟悉项目。 9 | 4. 线上数据问题紧急修复工具。 10 | 11 | ##### 提醒,库里不集成Json框架,利用反射查找项目内Json框架,优先使用FastJson其次Gson,其他暂不支持。如果写demo,请先引入任何一个支持的Json框架。 12 | ### 二:介绍 13 | 1. 作为项目的核心项目,除了提供数据库管理、共享参数管理和文件管理外,还集成新版内置Http解析框架,增加远程服务框架,实现TCP长连接方案,解决粘包分包问题。三重认证连接保证授权安全,关闭本地调试开关状态下启动云控功能,本地服务虽然会被启动,但是只接受远程控制服务的命令,来自局域网的请求会被拒绝,安全保证+1。 14 | 15 | 2. Android端项目云端版可以独立运行,[第一版](https://github.com/hnsugar/android-debugdata-webtool)只支持局域网功能。作为独立使用库,依然保持局域网访问功能,方便开发阶段调试。如果是上线应用,需要将本地功能关闭,需要使用时再打开本地服务,在云服务中,手机远程服务被启动后会启动本地服务,默认只有远程服务可以访问本地服务,保证接口不被未授权使用。 16 | 17 | 3. 内置[MiniHttpServer](https://www.jianshu.com/p/de98fa07140d)服务是自开发微型服务框架,支持解析Http报文信息,常见的如普通接口请求或者文件上传下载等都能正常识别,具体可看[MiniHttpServer](https://www.jianshu.com/p/de98fa07140d)。 18 | 19 | 4. 内置[MiniHttpClient](https://www.jianshu.com/p/41b0917271d3)作为网络请求框架,基于HttpURLConnection实现异步同步请求,也支持文件上传下载和扩展。 20 | 21 | 5. POST请求接口逻辑定义为Action框架方式,即用Action作为Key,处理器对象作为Value放到map中,当收到接口请求时,从map中获取对应处理器,利用hash算法提高接口辨别。 22 | 23 | 6. 在第二版中重点解决了第一版([2017年项目](https://github.com/hnsugar/android-debugdata-webtool))中出现的各种问题,并添加了很多实用功能。DataTables等也使用最新版本,也遇到了问题[dataTables.altEditor.free](https://www.jianshu.com/p/a28d5a4c333b)兼容性问题,经过修改源码已支持此项目。 24 | 25 | 7. 所有管理页面表格都增加了自定义显示字段功能,同时提供数据导出到CSV和打印功能,方便用Excel等工具管理。 26 | 27 | 8. 在远程模式下,token只在客户端存在,认证是服务端向客户端确认是否成功,客户端的远程服务框架会向本地服务发送时携带本地服务的认证信息,每次启动生成一次,增强安全性。 28 | 29 | ### 三:引入依赖 30 | 31 | ``` 32 | implementation 'com.itgowo:RemoteDataControllerForAndroid:1.0.1' 33 | ``` 34 | 35 | ### 四:特点 36 | 37 | * 纯Java API实现,性能好。 38 | * 体积小,依赖包不到400kb。 39 | * 统一接口。 40 | * 兼容性好。 41 | * 使用简单,无侵入性。 42 | ### 五:说明 43 | 分为数据库管理、共享参数管理和文件管理三个模块, 依赖库提供接口服务,通过访问服务端口,可以静态获取资源文件;支持跨域请求;采用web页面控制台控制,页面操作请看[RemoteDataControllerForWeb](https://www.jianshu.com/p/75747ff4667f)。服务启动后会检查本地服务文件,默认服务器目录为***app_MiniHttpServer***目录,通过遍历zip包内文件信息,及zip内文件最后更新时间大于***app_MiniHttpServer***目录内相对文件的更新日期,会替换成新文件,从而达到依赖库升级后web静态文件升级。 44 | 45 | ### 六:接入本地服务 46 | 1. 最简单初始化本地服务,傻瓜式无代码方式我弃用了,自动启动太无耻了🤔。 47 | 2. 最简单的初始化本地服务 48 | ``` 49 | DebugDataTool.initLocalServer(application, 8089, null); 50 | ``` 51 | 3. 添加服务回调方式 52 | ##### 回调如果不为null,那么必须实现这两个方法: 53 | ``` 54 | public String onObjectToJson(Object o); 55 | public T onJsonStringToObject(String s, Class aClass); 56 | ``` 57 | ##### 如果为null,会自动用反射查找当前项目的Json工具,优先用FastJson,其次是Gson。 58 | ``` 59 | DebugDataTool.initLocalServer(application, 8089, new onLocalServerListener() { 60 | @Override 61 | public void onServerStared(String address, int port, String proxyAuthenticate) { 62 | System.out.println("XSLApplicationLike.onServerStared:"+port); 63 | } 64 | 65 | @Override 66 | public void onSystemMsg(String s) { 67 | System.out.println(s); 68 | } 69 | 70 | @Override 71 | public String onObjectToJson(Object o) { 72 | return JSON.toJSONString(o); 73 | } 74 | 75 | @Override 76 | public T onJsonStringToObject(String s, Class aClass) { 77 | return JSON.parseObject(s, aClass); 78 | } 79 | 80 | @Override 81 | public void onGetRequest(String s, HttpRequest httpRequest) { 82 | //收到的请求,文件请求只显示部分信息,不会打印整个文件。 83 | System.out.println("s = [" + s + "], httpRequest = [" + httpRequest + "]"); 84 | } 85 | 86 | @Override 87 | public void onResponse(String s) { 88 | //返回的结果,文件只显示部分标识信息。 89 | System.out.println("s = [" + s + "]"); 90 | } 91 | 92 | @Override 93 | public void onError(String s, Throwable throwable) { 94 | throwable.printStackTrace(); 95 | } 96 | }); 97 | ``` 98 | ### 六:接入云控服务 99 | 可以看库中[RDCConfigActivity](https://github.com/itgowo/RemoteDataControllerForAndroid/blob/master/RemoteDataControllerAndroid/RemoteDataControllerForAndroidLibrary/src/main/java/com/itgowo/tool/rdc/androidlibrary/RDCConfigActivity.java)演示,RDCConfigActivity.go(Context)可以直接跳转。 100 | 界面上的TitleBar可以通过配置下面资源改变主题: 101 | 102 | ``` 103 | #443333 104 | #FFFFFF 105 | 30sp 106 | ``` 107 | ##### 1.RemoteInfo类为配置信息类如下: 108 | ``` 109 | RemoteInfo remoteInfo1 = new RemoteInfo().setRemoteHost("rdc.itgowo.com").setRemoteServerPort(16671).setClientId(clientId).setToken(code).setLocalServerPort(-1).setContext(this); 110 | ``` 111 | |变量|类型|举例|说明| 112 | |---|---|---|---| 113 | |clientId|String|10086|设备id,APP唯一标识,一般用用户id或者其他简单文本,不宜复杂| 114 | |context|Context|application|上下文对象| 115 | |remoteHost|String|rdc.itgowo.com|云服务器地址| 116 | |remoteServerPort|Integer|16671|远程服务端口| 117 | |localServerPort|Integer|-1|本地服务端口,为了安全请用-1,使用随机端口方式,端口号<1024则自动随机| 118 | 119 | ##### 2.初始化服务 120 | 121 | |参数|类型|举例|说明| 122 | |---|---|---|---| 123 | |remoteInfo1|RemoteInfo||远程服务配置信息| 124 | |enableLANAccess|Boolean|false|启动远程服务后是否允许本地网络访问,如果是线上环境一定设为false,安全考虑,即使知道本地服务端口也会提示403权限拒绝| 125 | |onRemoteServerListener|onRemoteServerListener||服务信息回调,继承自onLocalServerListener| 126 | 127 | 建议clientId用userid,如果没有,token和ClientID可以用以下方法生成: 128 | ``` 129 | String clientId = DebugDataTool.getRandomClientId(); 130 | String token = DebugDataTool.getRandomToken(); 131 | ``` 132 | ##### 3.快速使用 133 | 134 | ``` 135 | DebugDataTool.initRemoteServer(remoteInfo1,true, null); 136 | ``` 137 | ##### 4.添加回调,回调如果不为null,那么必须实现这两个方法: 138 | ``` 139 | public String onObjectToJson(Object o); 140 | public T onJsonStringToObject(String s, Class aClass); 141 | ``` 142 | ##### 注意事项与本地服务一致 143 | ``` 144 | DebugDataTool.initRemoteServer(remoteInfo1,true, new onRemoteServerListener() { 145 | @Override 146 | public void onConnectRemoteServer(final RemoteInfo remoteInfo) { 147 | StringBuilder builder = new StringBuilder(remoteInfo.getRemoteHost() + ":" + remoteInfo.getRemoteServerPort() + "\r\n\r\n"); 148 | builder.append("本机设备ID:" + remoteInfo.getClientId() + "\r\n"); 149 | builder.append("本机设备验证码:" + remoteInfo.getToken() + "\r\n"); 150 | printTv(Color.BLUE, "远程服务器已连接", builder.toString()); 151 | } 152 | 153 | @Override 154 | public void onAuthRemoteServer(final RemoteInfo remoteInfo) { 155 | printTv(Color.GREEN, "远程服务器认证通过", remoteInfo.getRemoteHost() + ":" + remoteInfo.getRemoteServerPort()); 156 | } 157 | 158 | @Override 159 | public void onError(final RemoteInfo remoteInfo, final Throwable throwable) { 160 | printTv(Color.RED, "服务异常", throwable.getMessage()); 161 | } 162 | 163 | @Override 164 | public void onStop() { 165 | printTv(Color.BLUE, "RDC服务停止", "连接中断"); 166 | } 167 | 168 | @Override 169 | public void onServerStared(String address, int port,String proxyAuthenticate) { 170 | printTv(Color.GREEN, "本地服务已启动", ""); 171 | } 172 | 173 | @Override 174 | public void onSystemMsg(final String mS) { 175 | printTv(Color.GREEN, "onSystemMsg", mS); 176 | } 177 | 178 | @Override 179 | public String onObjectToJson(Object mObject) { 180 | return JSON.toJSONString(mObject); 181 | } 182 | 183 | @Override 184 | public T onJsonStringToObject(String mJsonString, Class mClass) { 185 | return JSON.parseObject(mJsonString, mClass); 186 | } 187 | 188 | @Override 189 | public void onGetRequest(String mRequest, final HttpRequest mHttpRequest) { 190 | printTv(Color.BLUE, "onGetRequest", mHttpRequest.toString()); 191 | Log.d("onGetRequest", mHttpRequest.toString()); 192 | } 193 | 194 | 195 | @Override 196 | public void onResponse(final String mResponse) { 197 | printTv(Color.BLUE, "onResponse", mResponse); 198 | Log.d("onResponse", mResponse); 199 | } 200 | 201 | @Override 202 | public void onError(final String mTip, final Throwable mThrowable) { 203 | printTv(Color.RED, "onError", mTip + " " + mThrowable.getMessage()); 204 | Log.e("DebugDataWebTool", mTip + " " + mThrowable.getMessage()); 205 | mThrowable.printStackTrace(); 206 | } 207 | }); 208 | } 209 | ``` 210 | ### 七:数据库管理 211 | 212 | 1. 作为最初提供的功能,数据库管理一直是重点。界面采取分区设计,最左测试数据库列表,点击可以切换数据库文件;其次是当前打开数据库的表列表,点击表可以显示数据库数据,并且支持分页查询和显示数量调整。 213 | 214 | 2. 目前通过Web页面已经实现数据的增删改查基本功能,同时扩展了SQL执行功能,ALTER 功能可以通过SQL执行框输入,几乎支持所有没有直接提供的SQL功能。 215 | 216 | 3. 新升级的Web组件DataTables增加了扩展,支持数据直接导出。例如:打开一个表,数据显示100项,选择导出CSV,这时浏览器会下载一个CSV表格文件,表格数据就是当前显示数据。如果想导出特别逻辑的表格,可以通过SQL语句Select出某些条件的数据,此时数据表内数据与直接点开表不同,此时不是分页数据,及所有数据都是一次性加载的,选择显示所有数据再导出就是SQL查出的所有数据了。 217 | 218 | 4. 新添加的功能还包括数据列过多自动隐藏功能,左侧会有一个+号,点击+号会展开未显示数据列;通过选择显示列也可控制显示哪些列,只保留感兴趣的可以提高阅读查找速度。 219 | 220 | 5. 删除表可以通过SQL执行ALTER语句,那删除数据库可以通过文件管理,找到内部目录的database目录,里面就有app的所有数据库文件,点击删除即可。点击数据库文件下载亦可。 221 | 222 | 6. 每次选择数据库时上方会有提示,提示下载的文案会变化,点击此文案也可下载当前数据库。 223 | 224 | ### 八:共享参数管理 225 | 226 | 1. 使用方式基本与数据库管理相同,只要知道共享参数是XML文件即可,也有数据编辑导出等功能。 227 | 228 | ### 九:文件管理 229 | 230 | 1. 默认显示app内部存储目录,可以执行文件的上传与下载,也可以删除和重命名。 231 | 232 | 2. 文件夹会显示文件夹大小和文件数量,方便我们查看。 233 | 234 | 3. 快速过滤可以帮助我们快速找到想要的文件或目录。 235 | 236 | 4. 文件管理数据不支持分页,所以打开外部存储时第一次会很慢,以后会缓存较大目录的信息,从而提高响应速度。 237 | 238 | ### 十:简单图片例子,具体使用请看主项目 239 | ![web-17.jpg](https://upload-images.jianshu.io/upload_images/3213604-4ebbaf4ae86e8c5f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 240 | 241 | ![web-12.jpg](https://upload-images.jianshu.io/upload_images/3213604-4e0e67c769b68ebe.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 242 | 243 | ![web-13.jpg](https://upload-images.jianshu.io/upload_images/3213604-68bb15bfd45dc875.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 244 | 245 | ![web-14.jpg](https://upload-images.jianshu.io/upload_images/3213604-d053818f207f7ee3.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 246 | 247 | ![web-15.jpg](https://upload-images.jianshu.io/upload_images/3213604-c5c2e7c6692a6779.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 248 | 249 | ![web-16.jpg](https://upload-images.jianshu.io/upload_images/3213604-a57dc9cb7f6239c1.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 250 | 251 | ![app-1.png](https://upload-images.jianshu.io/upload_images/3213604-b6fe0507f155e3a3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 252 | 253 | ![app-2.png](https://upload-images.jianshu.io/upload_images/3213604-f09e2595f80c0069.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 254 | 255 | ![app-3.png](https://upload-images.jianshu.io/upload_images/3213604-feb546a294ae50ca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 256 | 257 | ![app-4.png](https://upload-images.jianshu.io/upload_images/3213604-7b39b066b45d106b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 258 | 259 | ![app-5.png](https://upload-images.jianshu.io/upload_images/3213604-a1b948b955025e5e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 260 | 261 | ![app-6.png](https://upload-images.jianshu.io/upload_images/3213604-3dadfcd57764ca3a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 262 | 263 | ![app-7.png](https://upload-images.jianshu.io/upload_images/3213604-07a3ac96b7d583f5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 264 | 265 | ![web-1.jpg](https://upload-images.jianshu.io/upload_images/3213604-dd192f6782b77ee4.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 266 | 267 | ![web-2.jpg](https://upload-images.jianshu.io/upload_images/3213604-11c7f4ece5321749.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 268 | 269 | ![web-3.jpg](https://upload-images.jianshu.io/upload_images/3213604-1cf8a6b521d993be.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 270 | 271 | ![web-4.jpg](https://upload-images.jianshu.io/upload_images/3213604-5db5abbdbab85b43.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 272 | 273 | ![web-5.jpg](https://upload-images.jianshu.io/upload_images/3213604-14ca87699e2b2370.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 274 | 275 | ![web-6.jpg](https://upload-images.jianshu.io/upload_images/3213604-b7f960bc35591d9f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 276 | 277 | ![web-7.jpg](https://upload-images.jianshu.io/upload_images/3213604-d035732515258324.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 278 | 279 | ![web-8.jpg](https://upload-images.jianshu.io/upload_images/3213604-2641fb229372191f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 280 | 281 | ![web-9.jpg](https://upload-images.jianshu.io/upload_images/3213604-29cca589a435d1bb.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 282 | 283 | ![web-10.jpg](https://upload-images.jianshu.io/upload_images/3213604-0c68b32f74436a0b.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 284 | 285 | ![web-11.jpg](https://upload-images.jianshu.io/upload_images/3213604-5abadee852e46b6c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 286 | 287 | 288 | 289 | 290 | ### 十一:小期待 291 | 292 | 以下项目都是我围绕远程控制写的项目和子项目。都给star一遍吧。😍 293 | 294 | |项目(Github)|语言|其他地址|运行环境|项目说明| 295 | |---|---|---|---|---| 296 | |[RemoteDataControllerForWeb](https://github.com/itgowo/RemoteDataControllerForWeb)|JavaScript|[简书](https://www.jianshu.com/p/75747ff4667f)|浏览器|远程数据调试控制台Web端| 297 | |[RemoteDataControllerForAndroid](https://github.com/itgowo/RemoteDataControllerForAndroid)|Java|[简书](https://www.jianshu.com/p/eb692f5709e3)|Android设备|远程数据调试Android端| 298 | |[RemoteDataControllerForServer](https://github.com/itgowo/RemoteDataControllerForServer)|Java|[简书](https://www.jianshu.com/p/3858c7e26a98)|运行Java的设备|远程数据调试Server端| 299 | |[MiniHttpClient](https://github.com/itgowo/MiniHttpClient)|Java|[简书](https://www.jianshu.com/p/41b0917271d3)|运行Java的设备|精简的HttpClient| 300 | |[MiniHttpServer](https://github.com/itgowo/MiniHttpServer)|Java|[简书](https://www.jianshu.com/p/de98fa07140d)|运行Java的设备|支持部分Http协议的Server| 301 | |[MiniTCPClient](https://github.com/itgowo/MiniTCPClient)|Java|[简书](https://www.jianshu.com/p/4b993100eae5)|运行Java的设备|TCP长连接库,支持粘包拆包处理| 302 | |[PackageMessage](https://github.com/itgowo/PackageMessage)|Java|[简书](https://www.jianshu.com/p/8a4a0ba2f54a)|运行Java的设备|TCP粘包与半包解决方案| 303 | |[ByteBuffer](https://github.com/itgowo/ByteBuffer)|Java|[简书](https://www.jianshu.com/p/ba68224f30e4)|运行Java的设备|二进制处理工具类| 304 | |[DataTables.AltEditor](https://github.com/itgowo/DataTables.AltEditor)|JavaScript|[简书](https://www.jianshu.com/p/a28d5a4c333b)|浏览器|Web端表格编辑组件| 305 | 306 | [我的小站:IT狗窝](http://itgowo.com) 307 | 技术联系QQ:1264957104 -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion '28.0.3' 6 | defaultConfig { 7 | applicationId "com.itgowo.tool.remotedatacontroller" 8 | minSdkVersion 19 9 | targetSdkVersion 27 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | lintOptions { 20 | abortOnError false 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation fileTree(include: ['*.jar'], dir: 'libs') 26 | implementation 'com.android.support:appcompat-v7:27.1.1' 27 | implementation 'com.itgowo:RemoteDataControllerForAndroid:1.0.1' 28 | implementation 'com.alibaba:fastjson:1.1.67.android' 29 | } 30 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/src/main/java/com/itgowo/tool/remotedatacontroller/DBManager.java: -------------------------------------------------------------------------------- 1 | package com.itgowo.tool.remotedatacontroller; 2 | 3 | import android.app.Application; 4 | import android.content.ContentValues; 5 | import android.content.Context; 6 | import android.database.Cursor; 7 | import android.database.sqlite.SQLiteDatabase; 8 | import android.database.sqlite.SQLiteOpenHelper; 9 | 10 | import java.lang.reflect.Field; 11 | import java.util.ArrayList; 12 | import java.util.Iterator; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by lujianchao on 2017/6/14. 17 | */ 18 | 19 | public class DBManager { 20 | private static Application sApp; 21 | 22 | public static String DBName = "appinfo.db"; 23 | public static Class TableClass = HistoryCache.class; 24 | 25 | public static void init(Application mApplication,String mDBName,Class mTableClass) { 26 | DBName=mDBName; 27 | sApp = mApplication; 28 | if (mTableClass!=null){ 29 | TableClass=mTableClass; 30 | } 31 | } 32 | 33 | 34 | private static final String CREATE_CacheTABLE = "create table "+TableClass.getSimpleName()+" (id integer primary key autoincrement, key text, value text, lasttime long, bak text, flag text)"; 35 | /** 36 | * 更改类文件必须更改版本号,否则不会更新缓存结构 37 | */ 38 | public static final int DBVersion = 1; 39 | private static DBHelper mCacheDBHelper; 40 | private static SQLiteDatabase mSQLiteDatabase; 41 | 42 | /** 43 | * 删除数据库 44 | */ 45 | public synchronized static void deleteDB() { 46 | sApp.deleteDatabase(DBName); 47 | } 48 | 49 | /** 50 | * 更新缓存 51 | * 52 | * @param key 预定义名称 53 | * @param value 待缓存数据 54 | */ 55 | public synchronized static void updateCache(String key, String value) { 56 | if (mCacheDBHelper == null) { 57 | mCacheDBHelper = new DBHelper(sApp, DBName, null, DBVersion); 58 | } 59 | if (mSQLiteDatabase == null) { 60 | mSQLiteDatabase = mCacheDBHelper.getWritableDatabase(); 61 | } 62 | ContentValues m = new ContentValues(); 63 | m.put("value", value); 64 | m.put("lasttime", System.currentTimeMillis()); 65 | try { 66 | mSQLiteDatabase.update(HistoryCache.class.getSimpleName(), m, "key=?", new String[]{key}); 67 | } catch (Exception mE) { 68 | mE.printStackTrace(); 69 | } 70 | } 71 | 72 | /** 73 | * 尽量不用,数据会越来越多 74 | * 75 | * @param key 76 | * @param value 77 | */ 78 | public synchronized static void addCache(String key, String value) { 79 | if (mCacheDBHelper == null) { 80 | mCacheDBHelper = new DBHelper(sApp, DBName, null, DBVersion); 81 | } 82 | if (mSQLiteDatabase == null) { 83 | mSQLiteDatabase = mCacheDBHelper.getWritableDatabase(); 84 | } 85 | ContentValues m = new ContentValues(); 86 | m.put("key", key); 87 | m.put("value", value); 88 | m.put("lasttime", System.currentTimeMillis()); 89 | try { 90 | mSQLiteDatabase.insert(HistoryCache.class.getSimpleName(), null, m); 91 | } catch (Exception mE) { 92 | mE.printStackTrace(); 93 | } 94 | } 95 | 96 | /** 97 | * 获取缓存数据 98 | * 99 | * @param key 预定义名称 100 | * @return 缓存数据,异常或者不存在则返回null 101 | */ 102 | public static String getCache(String key) { 103 | String string = null; 104 | if (mCacheDBHelper == null) { 105 | mCacheDBHelper = new DBHelper(sApp, DBName, null, DBVersion); 106 | } 107 | if (mSQLiteDatabase == null) { 108 | mSQLiteDatabase = mCacheDBHelper.getWritableDatabase(); 109 | } 110 | Cursor mCursor = null; 111 | try { 112 | mCursor = mSQLiteDatabase.rawQuery("select * from " + HistoryCache.class.getSimpleName() + " where key=?", new String[]{key}); 113 | if (mCursor != null && mCursor.getCount() == 1) { 114 | mCursor.moveToNext(); 115 | string = mCursor.getString(2); 116 | } 117 | } catch (Exception mE) { 118 | mE.printStackTrace(); 119 | } finally { 120 | if (mCursor != null) { 121 | mCursor.close(); 122 | } 123 | return string; 124 | 125 | } 126 | 127 | } 128 | 129 | /** 130 | * Created by lujianchao on 2016/11/29. 131 | * SQLiteOpenHelper 132 | * 133 | * @author lujianchao 134 | */ 135 | public static class DBHelper extends SQLiteOpenHelper { 136 | 137 | 138 | public DBHelper(final Context context, final String name, final SQLiteDatabase.CursorFactory factory, final int version) { 139 | super(context, name, factory, version); 140 | } 141 | 142 | @Override 143 | public void onCreate(final SQLiteDatabase db) { 144 | db.execSQL(CREATE_CacheTABLE); 145 | updatetable(db, TableClass); 146 | } 147 | 148 | @Override 149 | public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { 150 | updatetable(db, TableClass); 151 | } 152 | 153 | /** 154 | * 传入的类名即为表名,传入的类的属性即为表内的记录,字段固定,用来实现动态增减记录,记录为缓存内容,所以数量较少, 155 | * 只需要更改实体类属性,就可以管理数据库了,动态升级。 156 | * 157 | * @param db 158 | * @param mClass 159 | */ 160 | private void updatetable(final SQLiteDatabase db, Class mClass) { 161 | /** 162 | * 通过反射拿到当前所有cache名 163 | */ 164 | List mList = new ArrayList<>(); 165 | Field[] fields = mClass.getDeclaredFields(); 166 | for (Field fd : fields) { 167 | fd.setAccessible(true); 168 | if (!fd.getName().equals("serialVersionUID") && !fd.getName().equals("$change")) { 169 | mList.add(fd.getName()); 170 | } 171 | } 172 | Cursor mCursor = db.rawQuery("select * from " + mClass.getSimpleName(), null); 173 | while (mCursor.moveToNext()) { 174 | boolean ishave = false; 175 | String string = mCursor.getString(1); 176 | Iterator mStringIterator = mList.iterator(); 177 | while (mStringIterator.hasNext()) { 178 | if (mStringIterator.next().equals(string)) { 179 | ishave = true; 180 | mStringIterator.remove(); 181 | break; 182 | } 183 | } 184 | /** 185 | * 类里没有这个缓存名就将其删掉 186 | */ 187 | if (!ishave) { 188 | db.delete(mClass.getSimpleName(), "key=?", new String[]{string}); 189 | } 190 | } 191 | mCursor.close(); 192 | for (int mI = 0; mI < mList.size(); mI++) { 193 | ContentValues values = new ContentValues(); 194 | values.put("key", mList.get(mI)); 195 | values.put("lasttime", System.currentTimeMillis()); 196 | db.insert(mClass.getSimpleName(), null, values); 197 | } 198 | } 199 | } 200 | 201 | /** 202 | * Created by lujianchao on 2016/11/29. 203 | * 数据结构 204 | * 添加或者删除属性变量值,都必须更改数据库版本号,否则不会修改 205 | * 206 | * @author lujianchao 207 | */ 208 | 209 | public static class HistoryCache { 210 | /** 211 | * 新派队首页 212 | */ 213 | public static String GetHomeInfo = "GetHomeInfo"; 214 | 215 | /** 216 | * 运动项目列表 217 | */ 218 | public static String getSportItemListByParams = "getSportItemListByParams"; 219 | public static String TestA = "TestA"; 220 | public static String TestB = "TestB"; 221 | public static String TestC = "TestC"; 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/src/main/java/com/itgowo/tool/remotedatacontroller/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.itgowo.tool.remotedatacontroller; 2 | 3 | import android.graphics.Color; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.text.SpannableStringBuilder; 7 | import android.text.Spanned; 8 | import android.text.method.ScrollingMovementMethod; 9 | import android.text.style.ForegroundColorSpan; 10 | import android.util.Log; 11 | import android.view.View; 12 | import android.widget.Button; 13 | import android.widget.EditText; 14 | import android.widget.TextView; 15 | import android.widget.Toast; 16 | 17 | import com.alibaba.fastjson.JSON; 18 | import com.itgowo.httpserver.HttpRequest; 19 | import com.itgowo.tool.rdc.androidlibrary.DebugDataTool; 20 | import com.itgowo.tool.rdc.androidlibrary.RemoteInfo; 21 | import com.itgowo.tool.rdc.androidlibrary.onLocalServerListener; 22 | import com.itgowo.tool.rdc.androidlibrary.onRemoteServerListener; 23 | import com.itgowo.tool.rdc.androidlibrary.view.SuperDialog; 24 | 25 | 26 | public class MainActivity extends AppCompatActivity { 27 | private TextView logTV; 28 | private Button startRDCBtn; 29 | private Button startLDCBtn; 30 | private Button clearLogBtn; 31 | private Button stopBtn; 32 | private Button openConsole; 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_main); 38 | initView(); 39 | initListener(); 40 | if (getSharedPreferences("appinfo", MODE_PRIVATE).getBoolean("Booblean", false) == false) { 41 | getSharedPreferences("appinfo", MODE_PRIVATE).edit().putBoolean("Booblean", true).commit(); 42 | getSharedPreferences("appinfo", MODE_PRIVATE).edit().putFloat("Float", 1.5f).commit(); 43 | getSharedPreferences("appinfo", MODE_PRIVATE).edit().putLong("Long", 1232131231).commit(); 44 | getSharedPreferences("appinfo", MODE_PRIVATE).edit().putString("String", "tadsfsadfest").commit(); 45 | getSharedPreferences("appinfo", MODE_PRIVATE).edit().putInt("Int", 1234).commit(); 46 | DBManager.init(getApplication(), "appinfo.db", null); 47 | DBManager.updateCache("first", "yes"); 48 | DBManager.updateCache("second", "no"); 49 | DBManager.updateCache("haha", "hehe"); 50 | for (int i = 0; i < 50; i++) { 51 | DBManager.addCache("haha" + i, "hehe"); 52 | } 53 | } 54 | 55 | } 56 | 57 | private void initListener() { 58 | startRDCBtn.setOnClickListener(new View.OnClickListener() { 59 | @Override 60 | public void onClick(View v) { 61 | initRemoteServerPre(); 62 | } 63 | }); 64 | startLDCBtn.setOnClickListener(new View.OnClickListener() { 65 | @Override 66 | public void onClick(View v) { 67 | initLocal(); 68 | } 69 | }); 70 | clearLogBtn.setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | logTV.setText(""); 74 | } 75 | }); 76 | stopBtn.setOnClickListener(new View.OnClickListener() { 77 | @Override 78 | public void onClick(View v) { 79 | DebugDataTool.shutDown(); 80 | } 81 | }); 82 | openConsole.setOnClickListener(new View.OnClickListener() { 83 | @Override 84 | public void onClick(View v) { 85 | DebugDataTool.goConfigActivity(MainActivity.this); 86 | } 87 | }); 88 | } 89 | 90 | private void initView() { 91 | clearLogBtn = findViewById(R.id.clear); 92 | startLDCBtn = findViewById(R.id.startLDC); 93 | startRDCBtn = findViewById(R.id.startRDC); 94 | stopBtn = findViewById(R.id.stop); 95 | logTV = findViewById(R.id.msg); 96 | openConsole = findViewById(R.id.openConsole); 97 | logTV.setMovementMethod(ScrollingMovementMethod.getInstance()); 98 | logTV.setMaxEms(1024 * 10); 99 | } 100 | 101 | private void initLocal() { 102 | DebugDataTool.initLocalServer(this, 8088, new onLocalServerListener() { 103 | 104 | @Override 105 | public void onServerStared(final String address, final int port, String proxyAuthenticate) { 106 | // DebugDataTool.downloadWebData(MainActivity.this); 107 | runOnUiThread(new Runnable() { 108 | @Override 109 | public void run() { 110 | Toast.makeText(MainActivity.this, address + ":" + port, Toast.LENGTH_LONG).show(); 111 | } 112 | }); 113 | printTv(Color.GREEN, "本地服务启动", "port" + port); 114 | } 115 | 116 | @Override 117 | public void onSystemMsg(final String s) { 118 | printTv(Color.GREEN, "系统信息", s); 119 | } 120 | 121 | @Override 122 | public String onObjectToJson(Object object) { 123 | return JSON.toJSONString(object); 124 | } 125 | 126 | @Override 127 | public T onJsonStringToObject(String jsonString, Class tClass) { 128 | return JSON.parseObject(jsonString, tClass); 129 | } 130 | 131 | @Override 132 | public void onGetRequest(String request, final HttpRequest httpRequest) { 133 | printTv(Color.BLUE, "onGetRequest", httpRequest.toString()); 134 | Log.d("onGetRequest", httpRequest.toString()); 135 | } 136 | 137 | 138 | @Override 139 | public void onResponse(final String response) { 140 | printTv(Color.BLUE, "onResponse", response); 141 | Log.d("onResponse", response); 142 | } 143 | 144 | @Override 145 | public void onError(final String tip, final Throwable throwable) { 146 | printTv(Color.RED, "onError", tip + " " + throwable.getMessage()); 147 | Log.e("DebugDataWebTool", tip + " " + throwable.getMessage()); 148 | throwable.printStackTrace(); 149 | } 150 | 151 | @Override 152 | public void onServerStop() { 153 | printTv(Color.BLUE, "本地服务关闭", "服务关闭"); 154 | } 155 | }); 156 | } 157 | 158 | private void initRemoteServerPre() { 159 | final String clientId = DebugDataTool.getRandomClientId(); 160 | SuperDialog dialog = new SuperDialog(this).setTitle("安全验证码"); 161 | dialog.setInputListener(new SuperDialog.onDialogInputListener() { 162 | @Override 163 | public void onInitEditText(EditText inputView) { 164 | inputView.setText(DebugDataTool.getRandomToken()); 165 | inputView.setMaxEms(8); 166 | inputView.setMinEms(4); 167 | } 168 | 169 | @Override 170 | public void onComplete(int buttonIndex, String text) { 171 | if (text == null || text.trim().length() < 4) { 172 | Toast.makeText(MainActivity.this, "输入验证码过短", Toast.LENGTH_LONG).show(); 173 | } else { 174 | initRemote("222222", "222222"); 175 | // initRemote(clientId, text); 176 | } 177 | } 178 | }).setContent("远程调试功能为危险功能,请输入随机验证码,此验证码为本机本次随机生成,将此验证码提供给技术人员,技术人员即可远程作业(设备ID:" + clientId + ")").show(); 179 | } 180 | 181 | private void initRemote(final String clientId, final String code) { 182 | // final RemoteInfo remoteInfo1 = new RemoteInfo().setRemoteHost("10.1.100.121").setRemoteServerPort(16671).setClientId(clientId).setToken(code).setLocalServerPort(-1).setContext(this); 183 | final RemoteInfo remoteInfo1 = new RemoteInfo().setRemoteHost("rdc.itgowo.com").setRemoteServerPort(16671).setClientId(clientId).setToken(code).setLocalServerPort(-1).setContext(this); 184 | DebugDataTool.initRemoteServer(remoteInfo1, true, new onRemoteServerListener() { 185 | @Override 186 | public void onConnectRemoteServer(final RemoteInfo remoteInfo) { 187 | StringBuilder builder = new StringBuilder(remoteInfo.getRemoteHost() + ":" + remoteInfo.getRemoteServerPort() + "\r\n\r\n"); 188 | builder.append("本机设备ID:" + remoteInfo.getClientId() + "\r\n"); 189 | builder.append("本机设备验证码:" + remoteInfo.getToken() + "\r\n"); 190 | printTv(Color.BLUE, "远程服务器已连接", builder.toString()); 191 | } 192 | 193 | @Override 194 | public void onReconnectRemoteServer(RemoteInfo remoteInfo) { 195 | printTv(Color.GREEN, "远程服务器已重连", remoteInfo.getRemoteHost() + ":" + remoteInfo.getRemoteServerPort()); 196 | } 197 | 198 | @Override 199 | public void onOffline(RemoteInfo remoteInfo) { 200 | printTv(Color.GREEN, "设备已离线", "正在重连。。。"); 201 | 202 | } 203 | 204 | @Override 205 | public void onAuthRemoteServer(final RemoteInfo remoteInfo) { 206 | printTv(Color.GREEN, "远程服务器认证通过", remoteInfo.getRemoteHost() + ":" + remoteInfo.getRemoteServerPort()); 207 | } 208 | 209 | @Override 210 | public void onError(final RemoteInfo remoteInfo, final Throwable throwable) { 211 | printTv(Color.RED, "服务异常", throwable.getMessage()); 212 | } 213 | 214 | @Override 215 | public void onRemoteServerStop() { 216 | printTv(Color.BLUE, "RDC服务停止", "连接中断"); 217 | } 218 | 219 | 220 | @Override 221 | public void onServerStared(String address, int port, String proxyAuthenticate) { 222 | printTv(Color.GREEN, "本地服务已启动", ""); 223 | } 224 | 225 | @Override 226 | public void onSystemMsg(final String mS) { 227 | printTv(Color.GREEN, "onSystemMsg", mS); 228 | } 229 | 230 | @Override 231 | public String onObjectToJson(Object mObject) { 232 | return JSON.toJSONString(mObject); 233 | } 234 | 235 | @Override 236 | public T onJsonStringToObject(String mJsonString, Class mClass) { 237 | return JSON.parseObject(mJsonString, mClass); 238 | } 239 | 240 | @Override 241 | public void onGetRequest(String mRequest, final HttpRequest mHttpRequest) { 242 | printTv(Color.BLUE, "onGetRequest", mHttpRequest.toString()); 243 | Log.d("onGetRequest", mHttpRequest.toString()); 244 | } 245 | 246 | 247 | @Override 248 | public void onResponse(final String mResponse) { 249 | printTv(Color.BLUE, "onResponse", mResponse); 250 | Log.d("onResponse", mResponse); 251 | } 252 | 253 | @Override 254 | public void onError(final String mTip, final Throwable mThrowable) { 255 | printTv(Color.RED, "onError", mTip + " " + mThrowable.getMessage()); 256 | Log.e("DebugDataWebTool", mTip + " " + mThrowable.getMessage()); 257 | mThrowable.printStackTrace(); 258 | } 259 | 260 | @Override 261 | public void onServerStop() { 262 | printTv(Color.BLUE, "本地服务停止", "服务关闭"); 263 | } 264 | }); 265 | } 266 | 267 | private void printTv(final int color, final String tip, final String string) { 268 | runOnUiThread(new Runnable() { 269 | @Override 270 | public void run() { 271 | SpannableStringBuilder mBuilder = new SpannableStringBuilder(tip + ":" + string + "\r\n\r\n"); 272 | mBuilder.setSpan(new ForegroundColorSpan(color), 0, tip.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 273 | logTV.append(mBuilder); 274 | } 275 | }); 276 | } 277 | } 278 | -------------------------------------------------------------------------------- /RemoteDataControllerAndroid/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 |