-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/lulululbj/Box
- Loading branch information
Showing
13 changed files
with
186 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,39 +4,46 @@ | |
## 介绍 | ||
|
||
[Box 的由来](https://juejin.im/post/5c8a52606fb9a04a05408c94 ) | ||
[Box 的由来](https://juejin.im/post/5c8a52606fb9a04a05408c94) | ||
|
||
[Box 黑科技 —— 支持手机端反编译 !](https://juejin.im/post/5dcc27b7e51d45106d723850) | ||
|
||
## 下载 | ||
|
||
[release](https://github.com/lulululbj/Box/releases) | ||
|
||
## 功能 | ||
|
||
1. 本机信息 | ||
1. 反编译 | ||
|
||
* 支持对第三方应用、系统应用、本地安装包的反编译功能。 | ||
|
||
![](/img/box_reverse.gif) | ||
|
||
2. 当前 Activity | ||
|
||
* 品牌、版本号、型号、主板、制造商等 | ||
* 屏幕、RAM、ROM、SDK 版本、Android 版本、ABIS 等 | ||
* IMEI、MEID、SN、MAC 地址等 | ||
* 悬浮窗显示当前显示的应用的包名和 `Activity` 名称 | ||
|
||
2. 应用管理 | ||
![](/img/box_current_activity.gif) | ||
|
||
* 应用的打开、卸载、属性查看、应用商店中查看等常见操作 | ||
* 备份和分享已安装应用的 `apk` 文件 | ||
* 查看应用详情。包括 `packageName` 、`versionName` 、`versionCode` 、`targetSdkVersion` 、`minSdkVersion` 、签名信息查看(MD5、SHA1、SHA256), | ||
3. 应用管理 | ||
|
||
* 应用的打开、卸载、属性查看、应用商店中查看等常见操作 | ||
* 备份和分享已安装应用的 `apk` 文件 | ||
* 查看应用详情。包括 `packageName` 、`versionName` 、`versionCode` 、`targetSdkVersion` 、`minSdkVersion` 、签名信息查看(MD5、SHA1、SHA256), | ||
以及 **`AndroidManifest.xml`** 文件完整查看 | ||
|
||
3. 当前 Activity | ||
![](/img/box_app_manager.gif) | ||
|
||
4. 本机信息 | ||
|
||
* 悬浮窗显示当前显示的应用的包名和 `Activity` 名称 | ||
* 品牌、版本号、型号、主板、制造商等 | ||
* 屏幕、RAM、ROM、SDK 版本、Android 版本、ABIS 等 | ||
* IMEI、MEID、SN、MAC 地址等 | ||
|
||
## 截图 | ||
5. 文件管理 | ||
|
||
![](https://user-gold-cdn.xitu.io/2019/3/14/1697c7a8f66058f6?w=720&h=1080&f=png&s=144573) | ||
![](https://user-gold-cdn.xitu.io/2019/3/14/1697c7abb5c8c407?w=720&h=1080&f=png&s=159211) | ||
![](https://user-gold-cdn.xitu.io/2019/3/14/1697c777479a57e9?w=720&h=1080&f=png&s=142024) | ||
![](https://user-gold-cdn.xitu.io/2019/3/14/1697c77a70de71a0?w=720&h=1080&f=png&s=405700) | ||
![](https://user-gold-cdn.xitu.io/2019/3/14/1697c6a76be49fc5?w=720&h=1080&f=png&s=178188) | ||
![](https://user-gold-cdn.xitu.io/2019/3/14/1697c59b4e914c4e?w=720&h=1080&f=png&s=110134) | ||
* 提供基本的文件管理功能 | ||
|
||
## 感谢 | ||
|
||
|
@@ -48,13 +55,18 @@ | |
|
||
## 关于我 | ||
|
||
* [个人博客](http://sunluyao.com) | ||
* [掘金](https://juejin.im/user/586eff908d6d81005879507d) | ||
* QQ : 864588262 | ||
* 邮箱:[email protected] | ||
|
||
最后,有 bug 或者有其他感兴趣的想要添加的功能,欢迎来砸 [issue](https://github.com/lulululbj/Box/issues) ! | ||
## 最后 | ||
|
||
如果你有新奇的想法和功能,欢迎前来交流。 | ||
|
||
添加我的微信 `bingxinshuo_`,加入技术交流群。 | ||
|
||
|
||
公众号后台回复 “Box”, 获取最新安装包。 | ||
|
||
|
||
![](https://user-gold-cdn.xitu.io/2019/11/13/16e656421741bfbc?w=2800&h=800&f=jpeg&s=178470) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package luyao.box.adapter | ||
|
||
import android.graphics.Color | ||
import android.util.Log | ||
import com.chad.library.adapter.base.BaseQuickAdapter | ||
import com.chad.library.adapter.base.BaseViewHolder | ||
import luyao.box.R | ||
import luyao.box.bean.LogcatBean | ||
|
||
class LogcatAdapter(layoutResId: Int = R.layout.item_logcat) : | ||
BaseQuickAdapter<LogcatBean, BaseViewHolder>(layoutResId) { | ||
override fun convert(helper: BaseViewHolder, item: LogcatBean) { | ||
helper.setText(R.id.logcatText, item.logString) | ||
|
||
if (item.level == Log.ERROR) { | ||
helper.setTextColor(R.id.logcatText, Color.RED) | ||
}else{ | ||
helper.setTextColor(R.id.logcatText, Color.BLACK) | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package luyao.box.bean | ||
|
||
import android.util.Log | ||
|
||
data class LogcatBean(val logString: String) { | ||
|
||
val level: Int | ||
get() { | ||
when { | ||
logString.contains("V/") -> return Log.VERBOSE | ||
logString.contains("D/") -> return Log.DEBUG | ||
logString.contains("I/") -> return Log.INFO | ||
logString.contains("W/") -> return Log.WARN | ||
logString.contains("E/") -> return Log.ERROR | ||
logString.contains("A/") -> return Log.ASSERT | ||
} | ||
return Log.VERBOSE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package luyao.box.service | ||
|
||
import android.app.Service | ||
import android.content.Intent | ||
import android.os.Binder | ||
import android.os.IBinder | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
import luyao.box.bean.HistoryBean | ||
import luyao.box.bean.LogcatBean | ||
import luyao.box.ui.logcat.LogcatUtil | ||
import luyao.box.util.FloatWindowManager | ||
|
||
class LogcatService : Service() { | ||
|
||
lateinit var mListen : (LogcatBean) -> Unit | ||
|
||
|
||
inner class LogBinder : Binder(){ | ||
fun getService():LogcatService{ | ||
return this@LogcatService | ||
} | ||
} | ||
|
||
override fun onBind(intent: Intent?): IBinder? { | ||
return LogBinder() | ||
} | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
start() | ||
} | ||
|
||
private fun start() { | ||
FloatWindowManager.show() | ||
FloatWindowManager.clearView() | ||
CoroutineScope(Dispatchers.Main).launch { | ||
LogcatUtil.start() | ||
for (logcat in LogcatUtil.channel) { | ||
mListen.invoke(logcat) | ||
FloatWindowManager.addItem(HistoryBean("",logcat.logString)) | ||
} | ||
} | ||
} | ||
|
||
fun logListener(listener : (LogcatBean) -> Unit){ | ||
this.mListen=listener | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package luyao.box.ui.logcat | ||
|
||
import android.util.Log | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.channels.Channel | ||
import kotlinx.coroutines.launch | ||
import luyao.box.bean.LogcatBean | ||
import java.io.BufferedReader | ||
import java.io.InputStreamReader | ||
|
||
object LogcatUtil { | ||
|
||
val channel = Channel<LogcatBean>() | ||
val logList = ArrayList<LogcatBean>() | ||
var keyWords = "" | ||
var level = Log.VERBOSE | ||
|
||
|
||
fun start() { | ||
CoroutineScope(Dispatchers.IO).launch { | ||
Runtime.getRuntime().exec("logcat -c") // 清除日志 | ||
val process = Runtime.getRuntime().exec("logcat -v time") | ||
val inputStream = process.inputStream | ||
val inputStreamReader = InputStreamReader(inputStream) | ||
val reader = BufferedReader(inputStreamReader) | ||
|
||
var logcat: String? = "" | ||
do { | ||
logcat = reader.readLine() | ||
val log = LogcatBean(logcat) | ||
if (check(log)) { | ||
logList.add(log) | ||
channel.send(log) | ||
} | ||
} while (logcat != null) | ||
} | ||
} | ||
|
||
fun check(log: LogcatBean): Boolean { | ||
var flag = true | ||
if (keyWords != "" && !log.logString.contains(keyWords, false)) flag = false | ||
if (level!=Log.VERBOSE && log.level != level) flag = false | ||
return flag | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.