Android 警告:链接器:app_process 有文本重定位。这会浪费内存并且存在安全风险。请修复。权限被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22577315/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:11:58  来源:igfitidea点击:

Warning: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix. Permissions denied

android

提问by user3449574

Hi guys i've tried to run a command via android terminal but when i execute my command :

大家好,我尝试通过 android 终端运行命令,但是当我执行命令时:

"svc data enable/disable" this error appears:

“svc 数据启用/禁用”出现此错误:

"Warning: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix. Permissions denied"

“警告:链接器:app_process 有文本重定位。这会浪费内存并且存在安全风险。请修复。权限被拒绝”

I'm under htc one(android 4.4.2 kitkat, sense 5.5) rooted , with Venom rom 5.7.0 and xposed framework installed.

我在 htc one(android 4.4.2 kitkat, sense 5.5) rooted 下,安装了 Venom rom 5.7.0 和 xposed 框架。

How can i avoid this problem and run the command smoothly ?

我怎样才能避免这个问题并顺利运行命令?

p.s = i've sent the command with SuperUser permissions given to the terminal.

ps = 我已经向终端发送了具有超级用户权限的命令。

回答by user3647823

Relocations error is caused by the fact that xposed framework replaces genuine app_process with a custom one, which is somehow unoptimized as it has been built to work on every modern (well, almost every...) android device/system. After uninstalling/reverting to stock (thru xposed installer or by flashing uninstall zip created on sdcard during installation) you'll find out that the warning is gone (as well as all xposed related customizations). If ur writing a script and don't want to see the warning, just forward the error output somewhere else than STDERR, i.e: svc data enable 2>/dev/null

重定位错误是由 xposed 框架用自定义框架替换真正的 app_process 引起的,该框架在某种程度上未优化,因为它已构建为适用于所有现代(几乎所有......)Android 设备/系统。卸载/恢复到库存后(通过 xposed 安装程序或通过闪烁安装期间在 sdcard 上创建的卸载 zip),您会发现警告消失了(以及所有与 xposed 相关的自定义设置)。如果你正在编写脚本并且不想看到警告,只需将错误输出转发到 STDERR 以外的其他地方,即:svc data enable 2>/dev/null

Permission denied for svc data enable...? seems uncasual, as it shall retry in 1sec intervals even if failed (displaying appropriate output). Didn't have htc ever, so dunno if it may be somehow protected by them... HOWEVER, android terminal which is quite limited in many situations manages to print permission denied error if it did not find something at all (instead of ie. "not found"). Here however, as u have 4.4.2 it's more likely selinux context issue preventing something to be done, it happens often when modding, usually not resulting in any issues (and sometimes resulting with a bootloop). You may try: su mount -o rw,remount /system restorecon -Rv /system

svc 数据启用权限被拒绝...?似乎不寻常,因为即使失败(显示适当的输出),它也会以 1 秒的间隔重试。从来没有 htc,所以不知道它是否可能受到他们的某种保护......但是,在许多情况下非常有限的 android 终端设法打印权限被拒绝的错误,如果它根本没有找到任何东西(而不是 ie。 “未找到”)。然而,在这里,因为你有 4.4.2,它更有可能是 selinux 上下文问题阻止了某些事情的完成,它经常在修改时发生,通常不会导致任何问题(有时会导致引导循环)。您可以尝试: su mount -o rw,remount /system restorecon -Rv /system

(-R only for non-verbose/silent mode) It's a one time operation, persistent until messing with files again. Try the command after that (dunno if reboot is needed).

(-R 仅用于非详细/静默模式)这是一次操作,持续到再次弄乱文件。之后尝试该命令(不知道是否需要重新启动)。

PS: it is a risky operation, do a nand backup of /system before and restore if bootlooped (and dont blame me) PS2: it shall NOT set su binary context as it will be busy (as u r running a root shell atm), displaying warning. That's not an issue. In fact it's perfect! Changing su context will result in losing root privileges (seems that stock config forces context PREVENTING root usability - at least samsung one...). It MAY happen, thou, that u will lost root, that is why i highly recommend to keep recent supersu flashable zip nearby, on sdcard for example, and flash it with recovery if needed. SuperSU installer sets the appropriate context for installed files with chcon and root will be back again. PS3: do not run that within custom recovery (twrp console/aroma terminal), context config provided by its dev may be differ than the device's stock and may cause trouble. Use adb or terminal after booting with android kernel.

PS:这是一个有风险的操作,之前对 /system 进行 nand 备份,如果引导循环则恢复(不要怪我) PS2:它不应设置 su 二进制上下文,因为它会很忙(因为你正在运行 root shell atm),显示警告。那不是问题。事实上它是完美的!更改 su 上下文将导致失去 root 权限(似乎股票配置强制上下文阻止 root 可用性 - 至少是三星的一个......)。你可能会失去 root 权限,这就是为什么我强烈建议将最近的 supersu flashable zip 放在附近,例如在 sdcard 上,并在需要时使用恢复闪存。SuperSU 安装程序使用 chcon 为已安装的文件设置适当的上下文,root 将再次返回。PS3:不要在自定义恢复(twrp 控制台/芳香终端)中运行它,其开发人员提供的上下文配置可能与设备不同 s 库存,可能会引起麻烦。使用 android 内核启动后使用 adb 或终端。

回答by Chris Stratton

The text relocations is a warning, not an error. It was only added to Android comparatively recently.

文本重定位是警告,而不是错误。它是最近才添加到 Android 中的。

As it appears that the program in question (app_process) was one furnished with the system rather than compiled by you, there is nothing you can or needto do about it, unless you feel like rebuilding/replacing the system component in question.

由于看起来有问题的程序 (app_process) 是由系统提供的,而不是由您编译的,因此您无能为力或无需对此做任何事情,除非您想重建/更换有问题的系统组件。

Were you building your ownprogram, your question could be marked as a duplicate of

如果您正在构建自己的程序,您的问题可能会被标记为

mylib.so has text relocations. This is wasting memory and is a security risk. Please fix

mylib.so 有文本重定位。这会浪费内存并且存在安全风险。请修复

However, that would only apply to software you were compiling yourself.

但是,这仅适用于您自己编译的软件。

In this case, you will probably just have to ignore it, unless you are somehow (?) using app_processto launch something with a custom native library that you did build, in which case you should update your NDK as explained in the other question.

在这种情况下,您可能只需要忽略它,除非您以某种方式(?)使用app_process您构建的自定义本机库启动某些东西,在这种情况下,您应该按照另一个问题中的说明更新 NDK。



Your permissions deniedis unrelated to the previous error message, and most likely a problem with the command you are trying to run (for example, you think you are root but you are not). If you want help with that, you are going to have to be more specific about the command you are running and the mechanism used to launch it.

permissions denied与之前的错误消息无关,很可能是您尝试运行的命令有问题(例如,您认为自己是 root 但实际上不是)。如果您需要这方面的帮助,您将必须更具体地了解您正在运行的命令以及用于启动它的机制。

回答by Ashv

I faced same error:

我遇到了同样的错误:

WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/com.example.ashv.takeinput
Failure [INSTALL_FAILED_INVALID_APK]*

警告:链接器:libvc1dec_sa.ca7.so 有文本重定位。这会浪费内存并且存在安全风险。请修复。
警告:链接器:libvc1dec_sa.ca7.so 有文本重定位。这会浪费内存并且存在安全风险。请修复。
pkg: /data/local/tmp/com.example.ashv.takeinput
失败 [INSTALL_FAILED_INVALID_APK]*

This error started after I rooted my android mobile. In order to un-root my mobile, I messed up with its Firmware. Therefore, I had to take Service Center help and they formatted and re-installed Kitkat. After which it works fine.

这个错误是在我扎根我的安卓手机后开始的。为了取消我的手机的root权限,我弄乱了它的固件。因此,我不得不求助于服务中心,他们格式化并重新安装了 Kitkat。之后它工作正常。