Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to authorize adb service from boot

12,719 views
Skip to first unread message

Jose Vidal

unread,
Mar 31, 2014, 1:31:49 PM3/31/14
to mozilla...@lists.mozilla.org
Hi everyone,

I need to porting userdata.img

I have a freescale connected to ubuntu host via serial port using minicom.

>From my host, when I put

$ adb shell

I get like response:

error: device unauthorized. Please check the confirmation dialog on your device.

I need to access adb service for porting userdata.

Can I to activate adb from init, boot or somewhere?



I hope for your help

Thanks in advance.


Best regards,

jvidalsm

Dave Hylands

unread,
Mar 31, 2014, 6:43:06 PM3/31/14
to Jose Vidal, mozilla...@lists.mozilla.org
Hi Jose,

I think that you probably need to disable adb secure mode.

I think that you need to set ro.adb.secure=0 in the properties file which is used when the phone boots into recovery mode.

I'm not sure how you actually go about doing this, but I suspect its part of the initramfs image of the recovery kernel.

I haven't messed with this - I just took a look at the the adb source code (in system/core/adb).

Alternatively, you could modify the source so that the daemon never starts up in secure mode. Search for ro.adb.secure in the directory above.

Dave Hylands
> _______________________________________________
> dev-b2g mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
>

Jose Vidal

unread,
Mar 31, 2014, 6:54:30 PM3/31/14
to Dave Hylands, mozilla...@lists.mozilla.org
Hi Dave,

Thanks for your response,

I have a default.prop file inside the initramfs.cpio.gz file of boot.img:

========= initramfs.cpio.gz =============
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
persist.sys.usb.config=mtp,adb

====================================


Mainly, I need to porting userdata,img and I can not make that because I can not to access via adb.

What do you think ?
How  I can porting userdata.img image?

Thanks in advance


Best regards,


jvidalsm




Dave Hylands

unread,
Mar 31, 2014, 7:06:08 PM3/31/14
to Jose Vidal, mozilla...@lists.mozilla.org
Hi Jose,

That looks reasonable. I'm not sure why adb wouldn't be running.

Does your /init.rc have commands to start it?

Jose Vidal

unread,
Mar 31, 2014, 7:10:32 PM3/31/14
to Dave Hylands, mozilla...@lists.mozilla.org
Hi Dave,

Do you have reason.

I changed in init.rc file

#  Enable adb security for JB4.2.2
    setprop ro.adb.secure 0

by

#  Enable adb security for JB4.2.2
    setprop ro.adb.secure 1

Now, I can to access from adb

$ adb shell


Thanks so much.

Best regards,

jvidalsm

Dave Hylands

unread,
Mar 31, 2014, 7:27:19 PM3/31/14
to Jose Vidal, mozilla...@lists.mozilla.org
Hi Jose,

----- Original Message -----
> From: "Jose Vidal" <jvid...@gmail.com>
> To: "Dave Hylands" <dhyl...@mozilla.com>
> Cc: mozilla...@lists.mozilla.org
> Sent: Monday, March 31, 2014 4:10:32 PM
> Subject: Re: [b2g] How to authorize adb service from boot
>
> Hi Dave,
>
> Do you have reason.

Seems totally counterintuitive to me.

You'd probably need to debug adbd (or add a bunch of prints/log statments) to figure out what its really doing.

> I changed in init.rc file
>
> # Enable adb security for JB4.2.2
> setprop ro.adb.secure 0
>
> by
>
> # Enable adb security for JB4.2.2
> setprop ro.adb.secure 1
>
> Now, I can to access from adb
>
> $ adb shell

This looks like a shell user shell. What you really want is a root user shell (which will have a # prompt).

There may be rules in the init.rc (or other .rc files) which are starting adb when ro.adb.secure is set to 1?

Dave Hylands

Jose Vidal

unread,
Mar 31, 2014, 7:31:37 PM3/31/14
to Dave Hylands, mozilla...@lists.mozilla.org
Hi Dave,

Sorry... 

Really I changed the init.rc file like:


#  Enable adb security for JB4.2.2
     setprop ro.adb.secure 1

 by

 #  Enable adb security for JB4.2.2
     setprop ro.adb.secure 0

(I copied it very fast :D )

Best regards.


jvidalsm

Shawn Huang

unread,
Mar 31, 2014, 7:58:21 PM3/31/14
to mozilla...@lists.mozilla.org
I have seen similar problem. The authentication dialog never shows up, even if I revoke adb authentication. My workaround is to delete .android folder under your home directory on your linux desktop (I suggest you backup it first), i guess this is probably related to $HOME/.android/adbkey.pub. Since the RSA public key was copied into /data/misc/adb/adb_keys on target device.

Another way is to change init.rc and make secure=0 as Dave mentioned, however, init.rc is part of ramdisk.img and boot.img=kernel+ramdisk.img. I guess you might not flash boot.img after you modified your init.rc.

Jose Vidal

unread,
Mar 31, 2014, 10:41:30 PM3/31/14
to mozilla...@lists.mozilla.org
Hi Shawn,

I modified init.rc, built a new boot.img y I flashed without problem.
I modified init.rc temporally only to copy Gaia using adb. I don't know if will permanently.

Best regards.

jvidalsm
0 new messages