我怎样才能克服&QUOT的财产长度不限;亚行外壳setprop"外壳、长度、财产、QUOT

2023-09-06 14:52:01 作者:触不可及,而又念念不忘

我得到一个错误,当我尝试设置值与name属性> = 32个字符

I get an error when I try set a value for property with name >= 32 characters

adb shell setprop 01234567890123456789012345678901 VALUE

错误:

could not set property

这正常工作

adb shell setprop 0123456789012345678901234567890 VALUE
adb shell getprop 0123456789012345678901234567890
VALUE

有没有办法用较长的名称设置属性?

Is there any way to set properties with longer names?

推荐答案

看起来就没有办法绕过这个限制。我看到了Android的Java源文件相同的规则。

It looks like there would be no way to bypass this limitation. I see the same rules in android java sources.

public class SystemProperties
{
    public static final int PROP_NAME_MAX = 31;
    public static final int PROP_VALUE_MAX = 91;

    ...
}