Benjamin-Loison / android

0 stars 0 forks source link

Get clipboard content from adb #54

Open Benjamin-Loison opened 4 months ago

Benjamin-Loison commented 4 months ago
adb shell service call clipboard 1
Result: Parcel( 
0x00000000: fffffffd 00000008 006f004e 00690020 '........N.o. .i.'
0x00000010: 00650074 0073006d 00000000 00000390 't.e.m.s.........'
0x00000020: 000001c3 00610009 00200074 006f0063 '......a.t. .c.o.'
0x00000030: 002e006d 006e0061 00720064 0069006f 'm...a.n.d.r.o.i.'
0x00000040: 002e0064 00650073 00760072 00720065 'd...s.e.r.v.e.r.'
0x00000050: 0063002e 0069006c 00620070 0061006f '..c.l.i.p.b.o.a.'
0x00000060: 00640072 0043002e 0069006c 00620070 'r.d...C.l.i.p.b.'
0x00000070: 0061006f 00640072 00650053 00760072 'o.a.r.d.S.e.r.v.'
0x00000080: 00630069 00240065 006c0043 00700069 'i.c.e.$.C.l.i.p.'
0x00000090: 006f0062 00720061 00490064 0070006d 'b.o.a.r.d.I.m.p.'
0x000000a0: 002e006c 00680063 00630065 0041006b 'l...c.h.e.c.k.A.'
0x000000b0: 0064006e 00650053 00500074 00690072 'n.d.S.e.t.P.r.i.'
0x000000c0: 0061006d 00790072 006c0043 00700069 'm.a.r.y.C.l.i.p.'
0x000000d0: 00430028 0069006c 00620070 0061006f '(.C.l.i.p.b.o.a.'
0x000000e0: 00640072 00650053 00760072 00630069 'r.d.S.e.r.v.i.c.'
0x000000f0: 002e0065 0061006a 00610076 0035003a 'e...j.a.v.a.:.5.'
0x00000100: 00320038 000a0029 00610009 00200074 '8.2.).....a.t. .'
0x00000110: 006f0063 002e006d 006e0061 00720064 'c.o.m...a.n.d.r.'
0x00000120: 0069006f 002e0064 00650073 00760072 'o.i.d...s.e.r.v.'
0x00000130: 00720065 0063002e 0069006c 00620070 'e.r...c.l.i.p.b.'
0x00000140: 0061006f 00640072 0043002e 0069006c 'o.a.r.d...C.l.i.'
0x00000150: 00620070 0061006f 00640072 00650053 'p.b.o.a.r.d.S.e.'
0x00000160: 00760072 00630069 00240065 006c0043 'r.v.i.c.e.$.C.l.'
0x00000170: 00700069 006f0062 00720061 00490064 'i.p.b.o.a.r.d.I.'
0x00000180: 0070006d 002e006c 00650073 00500074 'm.p.l...s.e.t.P.'
0x00000190: 00690072 0061006d 00790072 006c0043 'r.i.m.a.r.y.C.l.'
0x000001a0: 00700069 00430028 0069006c 00620070 'i.p.(.C.l.i.p.b.'
0x000001b0: 0061006f 00640072 00650053 00760072 'o.a.r.d.S.e.r.v.'
0x000001c0: 00630069 002e0065 0061006a 00610076 'i.c.e...j.a.v.a.'
0x000001d0: 0035003a 00310031 000a0029 00610009 ':.5.1.1.).....a.'
0x000001e0: 00200074 006e0061 00720064 0069006f 't. .a.n.d.r.o.i.'
0x000001f0: 002e0064 006f0063 0074006e 006e0065 'd...c.o.n.t.e.n.'
0x00000200: 002e0074 00430049 0069006c 00620070 't...I.C.l.i.p.b.'
0x00000210: 0061006f 00640072 00530024 00750074 'o.a.r.d.$.S.t.u.'
0x00000220: 002e0062 006e006f 00720054 006e0061 'b...o.n.T.r.a.n.'
0x00000230: 00610073 00740063 00490028 006c0043 's.a.c.t.(.I.C.l.'
0x00000240: 00700069 006f0062 00720061 002e0064 'i.p.b.o.a.r.d...'
0x00000250: 0061006a 00610076 0031003a 00310039 'j.a.v.a.:.1.9.1.'
0x00000260: 000a0029 00610009 00200074 006f0063 ').....a.t. .c.o.'
0x00000270: 002e006d 006e0061 00720064 0069006f 'm...a.n.d.r.o.i.'
0x00000280: 002e0064 00650073 00760072 00720065 'd...s.e.r.v.e.r.'
0x00000290: 0063002e 0069006c 00620070 0061006f '..c.l.i.p.b.o.a.'
0x000002a0: 00640072 0043002e 0069006c 00620070 'r.d...C.l.i.p.b.'
0x000002b0: 0061006f 00640072 00650053 00760072 'o.a.r.d.S.e.r.v.'
0x000002c0: 00630069 00240065 006c0043 00700069 'i.c.e.$.C.l.i.p.'
0x000002d0: 006f0062 00720061 00490064 0070006d 'b.o.a.r.d.I.m.p.'
0x000002e0: 002e006c 006e006f 00720054 006e0061 'l...o.n.T.r.a.n.'
0x000002f0: 00610073 00740063 00430028 0069006c 's.a.c.t.(.C.l.i.'
0x00000300: 00620070 0061006f 00640072 00650053 'p.b.o.a.r.d.S.e.'
0x00000310: 00760072 00630069 002e0065 0061006a 'r.v.i.c.e...j.a.'
0x00000320: 00610076 0034003a 00340039 000a0029 'v.a.:.4.9.4.)...'
0x00000330: 00610009 00200074 006e0061 00720064 '..a.t. .a.n.d.r.'
0x00000340: 0069006f 002e0064 0073006f 0042002e 'o.i.d...o.s...B.'
0x00000350: 006e0069 00650064 002e0072 00780065 'i.n.d.e.r...e.x.'
0x00000360: 00630065 00720054 006e0061 00610073 'e.c.T.r.a.n.s.a.'
0x00000370: 00740063 006e0049 00650074 006e0072 'c.t.I.n.t.e.r.n.'
0x00000380: 006c0061 00420028 006e0069 00650064 'a.l.(.B.i.n.d.e.'
0x00000390: 002e0072 0061006a 00610076 0031003a 'r...j.a.v.a.:.1.'
0x000003a0: 00300035 00290031 0000000a          '5.0.1.).....    ')

Source: https://gist.github.com/yingted/6559103

Would help Benjamin_Loison/Debian/issues/21.

Benjamin-Loison commented 4 months ago

https://discuss.appium.io/t/retrieve-clipboard-content-of-android-device-as-part-of-automation/7741 proposes to use an open-source APK for this purpose.

clipper/blob/628b06b2e1bf4f36701d86f3ef14ca8927fb5612/pom.xml#L{19,30} should be verified especially otherwise the remaining of the repository content looks quite easy to verify. Note that it seems legetimate based on https://github.com/simpligility/android-maven-plugin existence.

Benjamin-Loison commented 4 months ago

Concerning write access, the Android Stack Exchange answer 105881 gives a working solution.