您尚未登录。

楼主 # 2021-08-17 17:30:11

黄粱梦
会员
注册时间: 2020-03-17
已发帖子: 45
积分: 39

A33 android vstar 这个 控制台啥命令都不能执行, 应该没有权限, 应该怎么处理呢?

1|shell@vstar:/ $ getevent
could not open /dev/input/event5, Permission denied
could not open /dev/input/event4, Permission denied
could not open /dev/input/event0, Permission denied
could not open /dev/input/mouse0, Permission denied
could not open /dev/input/event1, Permission denied
could not open /dev/input/event3, Permission denied
could not open /dev/input/event2, Permission denied
could not open /dev/input/mice, Permission denied

离线

楼主 #1 2021-08-17 17:32:01

黄粱梦
会员
注册时间: 2020-03-17
已发帖子: 45
积分: 39

Re: A33 android vstar 这个 控制台啥命令都不能执行, 应该没有权限, 应该怎么处理呢?

还有, 怎么在命令行获取android安卓的版本号呢?

离线

楼主 #2 2021-08-17 17:33:50

黄粱梦
会员
注册时间: 2020-03-17
已发帖子: 45
积分: 39

Re: A33 android vstar 这个 控制台啥命令都不能执行, 应该没有权限, 应该怎么处理呢?

黄粱梦 说:

还有, 怎么在命令行获取android安卓的版本号呢?


搞定:


C:\>adb shell getprop ro.build.version.release
4.4.2

离线

楼主 #3 2021-08-17 17:34:53

黄粱梦
会员
注册时间: 2020-03-17
已发帖子: 45
积分: 39

Re: A33 android vstar 这个 控制台啥命令都不能执行, 应该没有权限, 应该怎么处理呢?

C:\>adb shell getprop
[dalvik.vm.dexopt-flags]: [v=n,m=y]
[dalvik.vm.heapgrowthlimit]: [48m]
[dalvik.vm.heapmaxfree]: [2m]
[dalvik.vm.heapminfree]: [512K]
[dalvik.vm.heapsize]: [184m]
[dalvik.vm.heapstartsize]: [5m]
[dalvik.vm.heaptargetutilization]: [0.75]
[dalvik.vm.stack-trace-file]: [/data/anr/traces.txt]
[debug.force_rtl]: [0]
[debug.hwc.showfps]: [0]
[debug.hwui.render_dirty_regions]: [false]
[dev.bootcomplete]: [1]
[drm.service.enabled]: [true]
[gsm.current.phone-type]: [1]
[gsm.network.type]: [Unknown]
[gsm.operator.alpha]: []
[gsm.operator.iso-country]: []
[gsm.operator.isroaming]: [false]
[gsm.operator.numeric]: []
[gsm.sim.state]: [NOT_READY]
[gsm.version.ril-impl]: [sw-dataonly-ril-for-4.4_v1.0]
[init.svc.adbd]: [running]
[init.svc.bootanim]: [stopped]
[init.svc.bootclone]: [stopped]
[init.svc.console]: [running]
[init.svc.debuggerd]: [running]
[init.svc.drm]: [running]
[init.svc.healthd]: [running]
[init.svc.installd]: [running]
[init.svc.keystore]: [running]
[init.svc.lights_leds]: [stopped]
[init.svc.media]: [running]
[init.svc.netd]: [running]
[init.svc.precopy]: [stopped]
[init.svc.preinstall]: [stopped]
[init.svc.ril-daemon]: [running]
[init.svc.sdcard]: [running]
[init.svc.sensors]: [stopped]
[init.svc.servicemanager]: [running]
[init.svc.surfaceflinger]: [running]
[init.svc.ueventd]: [running]
[init.svc.vold]: [running]
[init.svc.zygote]: [running]
[keyguard.no_require_sim]: [true]
[net.bt.name]: [Android]
[net.change]: [net.qtaguid_enabled]
[net.hostname]: [android-e726e539bf0167bd]
[net.qtaguid_enabled]: [1]
[net.tcp.buffersize.default]: [4096,87380,110208,4096,16384,110208]
[net.tcp.buffersize.edge]: [4093,26280,35040,4096,16384,35040]
[net.tcp.buffersize.evdo]: [4094,87380,262144,4096,16384,262144]
[net.tcp.buffersize.gprs]: [4092,8760,11680,4096,8760,11680]
[net.tcp.buffersize.hsdpa]: [4094,87380,262144,4096,16384,262144]
[net.tcp.buffersize.hspa]: [4094,87380,262144,4096,16384,262144]
[net.tcp.buffersize.hspap]: [4094,87380,1220608,4096,16384,1220608]
[net.tcp.buffersize.hsupa]: [4094,87380,262144,4096,16384,262144]
[net.tcp.buffersize.lte]: [524288,1048576,2097152,262144,524288,1048576]
[net.tcp.buffersize.umts]: [4094,87380,110208,4096,16384,110208]
[net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576]
[persist.demo.hdmirotationlock]: [0]
[persist.service.bdroid.bdaddr]: [22:22:3e:d3:5d:d4]
[persist.sys.country]: [CN]
[persist.sys.dalvik.vm.lib]: [libdvm.so]
[persist.sys.language]: [zh]
[persist.sys.profiler_ms]: [0]
[persist.sys.strictmode.disable]: [1]
[persist.sys.strictmode.visual]: [0]
[persist.sys.timezone]: [Asia/Shanghai]
[persist.sys.usb.config]: [mtp,adb]
[ril.sw.modem.status]: [off]
[ro.adb.secure]: [0]
[ro.allow.mock.location]: [1]
[ro.baseband]: [unknown]
[ro.board.platform]: [polaris]
[ro.boot.signature]: [null]
[ro.bootloader]: [unknown]
[ro.bootmode]: [unknown]
[ro.build.characteristics]: [tablet]
[ro.build.date.utc]: [1628135496]
[ro.build.date]: [Thu Aug  5 11:51:36 CST 2021]
[ro.build.description]: [vstar-eng 4.4.2 KVT49L 20210805 test-keys]
[ro.build.display.id]: [vstar-eng 4.4.2 KVT49L 20210805 test-keys]
[ro.build.fingerprint]: [Allwinner/vstar/vstar:4.4.2/KVT49L/20210805:eng/test-keys]
[ro.build.host]: [ubuntu]
[ro.build.id]: [KVT49L]
[ro.build.product]: [vstar]
[ro.build.tags]: [test-keys]
[ro.build.type]: [eng]
[ro.build.user]: [cube]
[ro.build.version.codename]: [REL]
[ro.build.version.incremental]: [20210805]
[ro.build.version.release]: [4.4.2]
[ro.build.version.sdk]: [19]
[ro.carrier]: [wifi-only]
[ro.com.android.dateformat]: [MM-dd-yyyy]
[ro.config.alarm_alert]: [Alarm_Classic.ogg]
[ro.config.low_ram]: [true]
[ro.config.max_starting_bg]: [5]
[ro.config.notification_sound]: [pixiedust.ogg]
[ro.config.ringtone]: [Ring_Synth_04.ogg]
[ro.crypto.fuse_sdcard]: [true]
[ro.crypto.state]: [unencrypted]
[ro.debuggable]: [1]
[ro.factorytest]: [0]
[ro.font.scale]: [1.0]
[ro.hardware]: [sun8i]
[ro.hwa.force]: [false]
[ro.kernel.android.checkjni]: [0]
[ro.opengles.version]: [131072]
[ro.product.8723b_bt.used]: [true]
[ro.product.board]: [exdroid]
[ro.product.brand]: [Allwinner]
[ro.product.cpu.abi2]: [armeabi]
[ro.product.cpu.abi]: [armeabi-v7a]
[ro.product.device]: [vstar]
[ro.product.firmware]: [v2.1]
[ro.product.locale.language]: [en]
[ro.product.locale.region]: [US]
[ro.product.manufacturer]: [softwinner]
[ro.product.model]: [QUAD-CORE A33 vstar]
[ro.product.name]: [vstar]
[ro.reversion.aw_sdk_tag]: [exdroid4.4.2_r2-a33-v2.1]
[ro.revision]: [0]
[ro.runtime.firstboot]: [86416135]
[ro.secure]: [0]
[ro.serialno]: [8f5caa36f95700000000]
[ro.setupwizard.mode]: [DISABLED]
[ro.sf.lcd_density]: [160]
[ro.sw.embeded.telephony]: [false]
[ro.sys.bootfast]: [true]
[ro.sys.cputype]: [QuadCore-A33]
[ro.sys.mutedrm]: [true]
[ro.sys.network_location]: [true]
[ro.sys.storage_type]: [emulated]
[ro.udisk.lable]: [vstar]
[ro.wifi.channels]: []
[ro.zygote.disable_gl_preload]: [true]
[rw.logger]: [0]
[service.bootanim.exit]: [0]
[sys.boost_up_perf.displays]: [1]
[sys.boost_up_perf.mode]: [mode_home_enter 0 1]
[sys.boot_completed]: [1]
[sys.forcegles]: [0]
[sys.lights_leds]: [1]
[sys.mem.opt]: [true]
[sys.sensors]: [1]
[sys.settings_global_version]: [4]
[sys.settings_secure_version]: [12]
[sys.settings_system_version]: [6]
[sys.shutdown_animation]: [boot]
[sys.sysctl.extra_free_kbytes]: [7200]
[sys.usb.config]: [mtp,adb]
[sys.usb.state]: [mtp,adb]
[system_init.startsurfaceflinger]: [0]
[vold.post_fs_data_done]: [1]
[wifi.interface]: [wlan0]
[wifi.supplicant_scan_interval]: [15]
[wlan.driver.status]: [unloaded]

离线

楼主 #4 2021-08-17 18:29:07

黄粱梦
会员
注册时间: 2020-03-17
已发帖子: 45
积分: 39

Re: A33 android vstar 这个 控制台啥命令都不能执行, 应该没有权限, 应该怎么处理呢?

Android 修改源码使app获取root权限

https://blog.csdn.net/q1183345443/article/details/77711643

Android 6.0

1、  alps\system\extras\su, 修改su.c

int main(int argc, char** argv) {
   uid_t current_uid = getuid();

#ifndef CUSTOM_ROOT

         if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "not allowed");//work

#endif

2、alps\system\core\libcutils,修改fs_config.c(老版本修改\alps\system\core\include\private\android_filesystem_config.h)

#ifdef CUSTOM_ROOT

         { 06755, AID_ROOT,      AID_SHELL,     0, "system/xbin/su" },

#else

    { 04750, AID_ROOT,      AID_SHELL,     0, "system/xbin/su" },

#endif

    { 06755, AID_ROOT,      AID_ROOT,      0, "system/xbin/librank" },

    { 06755, AID_ROOT,      AID_ROOT,      0, "system/xbin/procrank" },

    { 06755, AID_ROOT,      AID_ROOT,      0, "system/xbin/procmem" },

    { 04770, AID_ROOT,      AID_RADIO,     0, "system/bin/pppd-ril" },

 

    /* the following files have enhanced capabilities and ARE included in user builds. */

    { 00750, AID_ROOT,      AID_SHELL,     (1ULL << CAP_SETUID) | (1ULL << CAP_SETGID), "system/bin/run-as" },

    { 00700, AID_SYSTEM,    AID_SHELL,     (1ULL << CAP_BLOCK_SUSPEND), "system/bin/inputflinger" },

 

    { 00750, AID_ROOT,      AID_ROOT,      0, "system/bin/uncrypt" },

    { 00750, AID_ROOT,      AID_ROOT,      0, "system/bin/install-recovery.sh" },

#ifdef CUSTOM_ROOT

         { 06755, AID_ROOT,      AID_ROOT,      0, "system/bin/su" },//work

#endif

    { 00755, AID_ROOT,      AID_SHELL,     0, "system/bin/*" },

    { 00755, AID_ROOT,      AID_ROOT,      0, "system/lib/valgrind/*" },

3、修改alps\frameworks\base\cmds\app_process\app_main.cpp

int main(int argc, char* const argv[])

{
#ifndef CUSTOM_ROOT

    if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) {
        // Older kernels don't understand PR_SET_NO_NEW_PRIVS and return

        // EINVAL. Don't die on such kernels.

        if (errno != EINVAL) {
            LOG_ALWAYS_FATAL("PR_SET_NO_NEW_PRIVS failed: %s", strerror(errno));

            return 12;

        }

    }//work

#endif

4、修改alps\frameworks\base\core\jni\com_android_internal_os_Zygote.cpp

static void DropCapabilitiesBoundingSet(JNIEnv* env) {
#ifndef CUSTOM_ROOT 

    for (int i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >= 0; i++) {
        int rc = prctl(PR_CAPBSET_DROP, i, 0, 0, 0);

        if (rc == -1) {
          if (errno == EINVAL) {
            ALOGE("prctl(PR_CAPBSET_DROP) failed with EINVAL. Please verify "

                  "your kernel is compiled with file capabilities support");

          } else {
            ALOGE("prctl(PR_CAPBSET_DROP) failed");

            RuntimeAbort(env);

          }

        }

    }//work

#endif

}

5、修改alps\system\core\adb\adb_main.cpp

static bool should_drop_privileges() {
#ifdef CUSTOM_ROOT

         return false;//work

#endif

#ifdef MTK_ALLOW_ADBD_ROOT

    return false;

#endif

6、修改alps\system\core\init\init.cpp,关掉selinux

static bool selinux_is_enforcing(void)

{
#ifdef CUSTOM_ROOT

    return false;

#endif//work

 

    if (ALLOW_DISABLE_SELINUX) {
        return selinux_status_from_cmdline() == SELINUX_ENFORCING;

    }

    return true;

}

7、注意在所用相关文件的Android.mk中添加入宏,

include $(CLEAR_VARS)

 

#work

ifeq ($(TARGET_BUILD_VARIANT),userdebug)

         LOCAL_DEX_PREOPT:=false

         LOCAL_CFLAGS += -DCUSTOM_ROOT

endif

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn