在程序管理里面win10 找不到应用程序序,怎么修改应用程序权限

Android应用程序永久获取root权限方法 - 无知者无畏 - ITeye技术网站
博客分类:
在项目的过程中,有可能会要实现类似360优化大师、安卓优化大师的软件搬家、静默安装等需要root权限的功能,或者类似SET_PREFERRED_APPLICATIONS、MOVE_PACKAGE 等需要系统的权限,必须要有系统签名。
咱们拿 软件搬家 来当例子(通过获取系统权限,而不是弹出系统的应用管理界面来搬家):
实现方式:
1、想办法获取系统权限,但是这个一般办不到,因为不同厂家出厂的手机系统签名都不一样
可以看看我很早的时候提的问题:
2、在已经root过得手机,获取root权限(有root权限就可以为所欲为啦,嘿嘿)
第一种办法暂时不考虑,想了解的童鞋可以google android如何获取系统权限。
我们说说第二种办法,
在已经root过得手机上获取root权限,简单
Process process = Runtime.getRuntime().exec("su");
执行这一句,superuser.apk就会弹出授权对话框。
但是这样做就可以了吗.....肯定没这么简单啦!
当执行需要系统权限的操作时,系统还是回去检查应用程序是否拥有该权限。
所以我们要想办法绕过过系统检查权限这道关卡!
至于办法 可以参考下以下两篇博客:
大概思路是:
通过app_process 命令启动java程序(想了解app_process更多资料,请自行google),
可是app_process 命令需要root权限才能执行,所以要配合上面所讲的su命令啦。
这么做是可以实现绕过系统检查权限的大门,
但是每次执行的时候都要先请求下root权限(那种弹框和toast会让用户感觉到很不安)
不要忘了咱们的标题:Android应用程序永久获取root权限方法。
永久获取root权限,就是获取过一次root权限后,以后再也不需要去请求root权限
实际上,像一些软件管家:安卓优化大师、360优化大师,都是这么做的
(不信你可以试试其软件搬家功能,即使你的手机解除root,它们还是具有root权限)
原理可以看下以下链接:
(下载该文章需要money,明天我再上传该文档,一时找不到了.......)
大概思路:
自己编译一个类似su的可执行程序(以下以main为代号),在main中调用app_process命令,
然后在第一次获取root权限的时候将其push到/system/bin/目录下,再chmod 4755 可执行程序,
修改其访问权限,使执行该命令的进程能够暂时获得root权限
(4755 也请google下吧 linux文件权限)。
以后咱们要是需要root权限的话就调用mian命令,不用去调用su来请求root权限啦
至于为什么要这么做:也是为了让root授权的对话框和toast不在显示
插一句,想要知道su和superuser.apk的关系,请点开下面的链接
综上:我们所做的就是绕过su命令,用我们自己编写的可执行程序main开实现su的功能。
自己编译可执行程序main的时候,需要注意一点,请参考su源码,
我在这一步就卡了很久,
大概意思:
main的uid是继承的父类的uid,而且它有root权限,但是在main中执行system(cmd),
(这里的cmd 调用app_process 来启动实现了软件搬家的java程序),
假如system()是通过sh 命令来实现,但在main中开启的sh的uid也是继承main的uid,
也就是应用程序的uid,但是这个uid并没有权限执行相关root命令;
所以需要先将main的uid设置为root,为了使sh的uid也为root,从而使sh 能够执行
需要root权限的app_process命令
关键代码在你的main 方法中加入
int uid = 0;
int gid = 0;
if(setgid(gid) || setuid(uid))
return permissionDenied();
可以参考su的源码 (su的源码会在我上传的压缩包中)
大概思路就是这样。
在我上传的压缩包中有我自己写的demo,实现的是软件搬家的功能,
操作很简单:
1、安装Movepkgdemo.apk,并执行
2、点击 install com.zl.hw 按钮 来 安装一个helloword android程序,
3、点击 get root 按钮,来第一次获取root权限,
4、点击第三个按钮,来移动helloword程序
1、编译可执行程序main(注意main只是个代号,在Movepkgdemo中 是 放在Movepkgdemo项目的 /res/ raw/ 目录下的zlsu文件)
2、将main.c文件成可执行文件会需要linux编译环境,你可以自己在linux上编译,也可以在windows下来编译
windows方法:使用cygwin 来进行NDK开发(搭建该环境可能需要话费比较多时间,主要是要下载cygwin)
cygwin环境配置文档也在上传的压缩包中,虽说花了打功夫,但是搭建好NDK环境,以后也能方便咱做NDK开发。
NDK环境搭建需要cygwin在安装的时候安装必需的一些项目(请查看以下链接):
最后总结一下总体思路:
1、在java代码中实现需要root权限的功能,并提供一个包含入口函数main的类
2、通过app_process命令来启动1中的java模块,但是app_process需要root权限,所以看第3步
3、通过在第一次获取root权限的时候,向/system/bin/注入自写的类似su的二进制可执行程序
main,并且和su的访问权限也一样(chmod 4755)(main功能和su一样,唯一不一样就是去除了su中与superuser.apk 交互的代码),即main命令执行app_process命令,这样可以做到:
一旦拥有root权限,以后再也不需要去请求root权限
下载次数: 1442
下载次数: 1250
浏览 42463
楼主您好,这篇写的很好,对我很有帮助,但是在测试的时候发现,一般的复制粘贴重启等操作都可以,就是用pm命令禁用掉系统的某些服务时,不好使,请问这样情况您遇到了吗?exeCmd(new String[]{Constants.ROOT_SU,"-c", String.format("pm disable '%s/%s'", receiverName.getPackageName(), receiverName.getClassName())},"");先确定该命令在shell模式下能否成功调用
Description Resource Path Location TypeConversion to Dalvik format failed with error 1 Movepkgdemo
Unknown Android Packaging Problem伟大的博主,我通过ADT试图运行你这个demo,得到入上错误,请问这是为什么?更多的信息[ 21:58:36 - hw] Unable to resolve target 'android-17'[ 21:58:37 - Movepkgdemo] Unable to resolve target 'android-17'[ 21:58:37 - Superuser] Project has no project.properties file! Edit the project properties to set one.[ 21:58:38 - Movepkgdemo] Unable to resolve target 'android-17'[ 21:58:38 - hw] Unable to resolve target 'android-17'[ 22:18:03 - Movepkgdemo] Dx trouble processing "java/lang/UnsafeByteSequence.class":Ill-advised or mistaken usage of a core class (java.* or javax.*)when not building a core library.This is often due to inadvertently including a core library filein your application's project, when using an IDE (such asEclipse). If you are sure you're not intentionally defining acore class, then this is the most likely explanation of what'sgoing on.However, you might actually be trying to define a class in a corenamespace, the source of which you may have taken, for example,from a non-Android virtual machine project. This will mostassuredly not work. At a minimum, it jeopardizes thecompatibility of your app with future versions of the platform.It is also often of questionable legality.If you really intend to build a core library -- which is onlyappropriate as part of creating a full virtual machinedistribution, as opposed to compiling an application -- then usethe "--core-library" option to suppress this error message.If you go ahead and use "--core-library" but are in factbuilding an application, then be forewarned that your applicationwill still fail to build or run, at some point. Please beprepared for angry customers who find, for example, that yourapplication ceases to function once they upgrade their operatingsystem. You will be to blame for this problem.If you are legitimately using some code that happens to be in acore package, then the easiest safe alternative you have is torepackage that code. That is, move the classes in question intoyour own package namespace. This means that they will never be inconflict with core system classes. JarJar is a tool that may helpyou in this endeavor. If you find that you cannot do this, thenthat is an indication that the path you are on will ultimatelylead to pain, suffering, grief, and lamentation.[ 22:18:03 - Movepkgdemo] Dx 1 aborting[ 22:18:03 - Movepkgdemo] Conversion to Dalvik format failed with error 1[ 22:22:08 - Movepkgdemo] Dx trouble processing "java/lang/UnsafeByteSequence.class":Ill-advised or mistaken usage of a core class (java.* or javax.*)when not building a core library.This is often due to inadvertently including a core library filein your application's project, when using an IDE (such asEclipse). If you are sure you're not intentionally defining acore class, then this is the most likely explanation of what'sgoing on.However, you might actually be trying to define a class in a corenamespace, the source of which you may have taken, for example,from a non-Android virtual machine project. This will mostassuredly not work. At a minimum, it jeopardizes thecompatibility of your app with future versions of the platform.It is also often of questionable legality.If you really intend to build a core library -- which is onlyappropriate as part of creating a full virtual machinedistribution, as opposed to compiling an application -- then usethe "--core-library" option to suppress this error message.If you go ahead and use "--core-library" but are in factbuilding an application, then be forewarned that your applicationwill still fail to build or run, at some point. Please beprepared for angry customers who find, for example, that yourapplication ceases to function once they upgrade their operatingsystem. You will be to blame for this problem.If you are legitimately using some code that happens to be in acore package, then the easiest safe alternative you have is torepackage that code. That is, move the classes in question intoyour own package namespace. This means that they will never be inconflict with core system classes. JarJar is a tool that may helpyou in this endeavor. If you find that you cannot do this, thenthat is an indication that the path you are on will ultimatelylead to pain, suffering, grief, and lamentation.[ 22:22:08 - Movepkgdemo] Dx 1 aborting[ 22:22:08 - Movepkgdemo] Conversion to Dalvik format failed with error 1
麻烦问一下,你编译好的zlsu文件应该可以直接用吧? 没看懂你这个命令:"movedemo -c 'export CLASSPATH="
+ classpath
+ " && export LD_LIBRARY_PATH=/vendor/lib:/system/lib && exec app_process /data/app "
+ minePkgName + "/MoveUtil " // /system/bin
+ pkgName + " " + moveFlag + "'"关机命令应该怎么执行呢reboot 重启reboot -p 关机
PackageManager.MOVE_SUCCEEDED导入工程的时候如下提示MOVE_SUCCEEDED cannot be resolved or is not a field让用别的代替 MOVE_SUCCEEDED, layoutlib.jar已经放到libs了,4.2的工程因为,layoutlib.jar和你工程中本身的android.jar都保护PackageManager这个类,你还需要 设置编译时jar包的优先级,吧layoutlib.jar的优先级设为必android.jar高,不然编译时找的是android.jar的packageManager类,当然就编译不过咯设置优先级:java Build Path -- Order and Export 位置靠顶 优先级越高
& 上一页 1
浏览: 165953 次
来自: 深圳
亲,这不是纳秒时间的隐患,是作者用错了地方。
楼主,我是用System.currentTimeMillis( ...
楼主,能把那个zlsu的源码发份给我吗
hi,楼主,这里有个疑问:向上面情况,如果被360安全大师,或 ...
请问该如何解决呢?15004人阅读
asp.net(51)
今天在维护原来项目的的时候突然出现了。
安全性异常
说明:应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。
可是原来还可以正常使用,后来我判定肯定是iis设置问题(我用的是iis7.5 + Server2008系统),可是在网上查了一下没有一个说的靠谱。使用它们的方法都不行。
后来自己查资料研究,终于知道为什么了,原来是连接池权限的问题。
解决方法:
1. 打开iis 选中该连接池。
2. 点击选择 高级设置。
3. 选择 进程模型--》选择标识 --》设置NetworkService
4. 确定 OK
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:423744次
积分:5302
积分:5302
排名:第2798名
原创:103篇
转载:59篇
评论:129条
(1)(1)(2)(3)(1)(1)(2)(2)(1)(4)(13)(1)(1)(9)(2)(4)(1)(3)(4)(5)(2)(1)(6)(10)(15)(2)(5)(8)(1)(12)(4)(4)(1)(5)(5)(4)(2)(5)(3)(6)(1)& & 在 android 的API中有提供 SystemClock.setCurrentTimeMillis()函数来修改系统时间,可惜无论你怎么调用这个函数都是没用的,无论模拟器还是真机,在logcat中总会得到"Unable to open alarm driver: Permission denied ".这个函数需要root权限或者运行与系统进程中才可以用。& & 本来以为就没有办法在应用程序这一层改系统时间了,后来在网上搜了好久,知道这个目的还是可以达到的。& & 第一个方法简单点,不过需要在Android系统源码的环境下用make来编译:& & 1. 在应用程序的AndroidManifest.xml中的manifest节点中加入android:sharedUserId="android.uid.system"这个属性。& & 2. 修改Android.mk文件,加入LOCAL_CERTIFICATE := platform这一行& & 3. 使用mm命令来编译,生成的apk就有修改系统时间的权限了。& & 第二个方法麻烦点,不过不用开虚拟机跑到源码环境下用make来编译:& & 1. 同上,加入android:sharedUserId="android.uid.system"这个属性。& & 2. 使用eclipse编译出apk文件,但是这个apk文件是不能用的。& & 3. 用压缩软件打开apk文件,删掉META-INF目录下的CERT.SF和CERT.RSA两个文件。& & 4. 使用目标系统的platform密钥来重新给apk文件签名。这步比较麻烦,首先找到密钥文件,在我的Android源码目录中的位置是"build/target/product/security",下面的platform.pk8和platform.x509.pem两个文件。然后用Android提供的Signapk工具来签名,signapk的源代码是在"build/tools/signapk"下,用法为"signapk platform.x509.pem platform.pk8 input.apk output.apk",文件名最好使用绝对路径防止找不到,也可以修改源代码直接使用。& & 这样最后得到的apk和第一个方法是一样的。& & 最后解释一下原理,首先加入android:sharedUserId="android.uid.system"这个属性。通过Shared User id,拥有同一个User id的多个APK可以配置成运行在同一个进程中。那么把程序的UID配成android.uid.system,也就是要让程序运行在系统进程中,这样就有权限来修改系统时间了。& & 只是加入UID还不够,如果这时候安装APK的话发现无法安装,提示签名不符,原因是程序想要运行在系统进程中还要有目标系统的platform. key,就是上面第二个方法提到的platform.pk8和platform.x509.pem两个文件。用这两个key签名后apk才真正可以放入系统进程中。第一个方法中加入LOCAL_CERTIFICATE := platform其实就是用这两个key来签名。& & 这也有一个问题,就是这样生成的程序只有在原始的Android系统或者是自己编译的系统中才可以用,因为这样的系统才可以拿到platform.pk8和platform.x509.pem两个文件。要是别家公司做的Android上连安装都安装不了。试试原始的Android中的key来签名,程序在模拟器上运行OK,不过放到G3上安装直接提示"Package ... has no signatures that match those in shared user android.uid.system",这样也是保护了系统的安全。& & 最最后还说下,这个android:sharedUserId属性不只可以把apk放到系统进程中,也可以配置多个APK运行在一个进程中,这样可以共享数据,应该会很有用的。作者 liujian885
声明:该文章系网友上传分享,此内容仅代表网友个人经验或观点,不代表本网站立场和观点;若未进行原创声明,则表明该文章系转载自互联网;若该文章内容涉嫌侵权,请及时向
上一篇:下一篇:
相关经验教程
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益

我要回帖

更多关于 找不到服务器应用程序 的文章

 

随机推荐