diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9349f0d --- /dev/null +++ b/.gitignore @@ -0,0 +1,54 @@ +# Java class files +*.class + +# generated files +bin/ +gen/ +*.apk +*.ap_ +*.dex +*.iml +local.properties +.classpath +.project +*.jar.properties +project.properties +.settings + +#temp files +*.swp +*~ +*.iws +*.ipr + +# lint +lint.xml + +#android-app-pack +auto.prop + +.DS_Store + +#annotation +.factorypath + +#androidAnntation +.apt_generated + +# Android Studio +.idea/ +.gradle/ +build/ + +/captures/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + + +*.trace +*.index +*.hprof diff --git a/README.md b/README.md index 0c32429..f0c76dd 100644 --- a/README.md +++ b/README.md @@ -1 +1,44 @@ -# AirFrozenGranter \ No newline at end of file + +## 注意 + +需要安装空调狗1.4或更高版本, [http://t.cn/R5myvvr](http://coolapk.com/apk/me.yourbay.airfrozen) + +下面是各种手机【通用】的免ROOT的步骤: + +## 操作步骤 + +#### 【1】 +首先去【系统设置】中开启【开发者模式】并给电脑授权。 +通用的是:【系统设置】→ 【关于手机】→ 疯狂点击【版本号】→ 回到【系统设置】→ 【开发者选项】→ 选中【Android调试】。 +如【成功】用过各种手机助手的话,可略过。各手机可能会出入,可百度或者Google之。 + +#### 【2】 +到【系统设置】→ 【账户】中 删除【所有的】账户。格删勿论一个不留。 + +#### 【3】 +执行下面的脚本。如果你是开发者的话,可略过脚本,直接在【电脑终端】执行: +`adb shell dpm set-device-owner me.yourbay.airfrozen/.main.core.mgmt.MDeviceAdminReceiver` + +脚本的下载地址是:[github.com/hyongbai/AirFrozenGranter](https://github.com/hyongbai/AirFrozenGranter/releases) 如不能访问,请使用360手机助手电脑版(等类似软件)安装驱动,进入电脑终端/命令行执行如上的命令。 + +#### 【4】 +如果提示`Success`或者`device owner is already set`之类的话,即表示成功。 + +## 运行脚本 + +### Linux/Mac + +运行脚本(双击)即可。方法如下: + + free4airfrozen.sh + +如不成功请参考如上的命令。 + +### Windows + +暂时无Windows电脑版本。请进入电脑终端/命令行执行【步骤3】中的命令。 + + +## 最后 + +祝大家搞机愉快。阖家欢乐,万事如意,🐔年大吉吧。 \ No newline at end of file diff --git a/adb b/adb new file mode 100755 index 0000000..7607204 Binary files /dev/null and b/adb differ diff --git a/free4airfrozen.sh b/free4airfrozen.sh new file mode 100755 index 0000000..0c6a1ad --- /dev/null +++ b/free4airfrozen.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#此脚本可以公用 :),只要把此处的Receiver换成自己的即可 +RECEIVER="me.yourbay.airfrozen/.main.core.mgmt.MDeviceAdminReceiver" + +function check_device() +{ + [ "$(./adb devices | sed '1d' | grep device)" ] && echo "yes" + echo +} + +function do_grant() +{ + ./adb shell dpm set-device-owner "${RECEIVER}" +} + +function print_err() +{ + echo -e "\n\n\n【操作失败】如果你操作成功过,则不必理会此错误\n\n\n" +} + +# Success: Device owner set to package ComponentInfo{me.yourbay.airfrozen/me.yourbay.airfrozen.main.core.mgmt.MDeviceAdminReceiver} +# Active admin set to component {me.yourbay.airfrozen/me.yourbay.airfrozen.main.core.mgmt.MDeviceAdminReceiver} +function grant() +{ + [ ! "$(check_device)" ] && echo "请将手机【开发者模式】开启并连接到电脑(可使用各种助手比如:360连接)" && return + result=`do_grant` || print_err && return + [ "$( echo "${result}" | grep 'Device owner set to package')" ] && echo "恭喜你操作【成功】" && echo "Congrats!!! It\'s [WORKED]" && return +} + +cd "$(cd "$(dirname "$0")"; pwd)" +grant \ No newline at end of file