t-vk / android-svc Goto Github PK
View Code? Open in Web Editor NEWEasy to use Android service wrapper
Easy to use Android service wrapper
Hi there! I've tried to follow the demo with a Google Pixel (sailfish). The device is rooted via Magisk, android-svc
was built from master, then I've downloaded the sources with android-svc --adb download
.
All seems to be fine as far as I can tell:
root@debian11:~/tmp# ./android-svc --adb list-packages | grep IAudioService
android.media.IAudioService
root@debian11:~/tmp# ./android-svc --adb list-methods android.media.IAudioService | grep MasterMute
boolean isMasterMute();
void setMasterMute(boolean mute, int flags, String callingPackage, int userId);
root@debian11:~/tmp# ./android-svc --adb call 'android.media.IAudioService.isMasterMute()'
false
But when I try to mute/unmute, nothing happens:
root@debian11:~/tmp# ./android-svc --adb call 'android.media.IAudioService.setMasterMute(true, 0, "com.termux", 0)'
root@debian11:~/tmp# ./android-svc --adb call 'android.media.IAudioService.isMasterMute()'
false
I've also tried something else:
root@debian11:~/tmp# ./android-svc --adb call 'android.media.IAudioService.isSpeakerphoneOn()'
false
root@debian11:~/tmp# ./android-svc --adb call 'android.media.IAudioService.setSpeakerphoneOn(true)'
root@debian11:~/tmp# ./android-svc --adb call 'android.media.IAudioService.isSpeakerphoneOn()'
false
Any ideas?
Just give an example to explain the format of printed parcel data
x1q:/ $ service call phone 69 s16 'shell' s16 ''
Result: Parcel(
0x00000000: 00000000 00000001 00000001 00000003 '................'
****HIDDEN SOME DATA****
0x000000a0: 00000000 '.... ')
the first and last 00000000
seems the open and close tags of the content, therefore just skip these chunks.
then for the 00000001 00000001 00000003
, the first 00000001
seems to indicate a successful call. Here the expected call return is List<CellInfo>
, hence the second 00000001
is the length of the list.
Since the encoding is using little endian, the 00000001
should be reversed to 01000000
then the Parcel
can use readInt()
correctly, in this case val count = parcel.readInt()
, count indicates how many element in the return list.
To decode the CellInfo
, it should call CellInfo.Creator.readFromParcel(parcel)
and depends on the count
, it should be called multiple times to fully decode them all
android-svc download
downloads all of AIDL files for the current android version,
But after it succeeded I requested
commands such as android-svc list-module
and android-svc call
, It seemed not to enter offline mode and still took long time to fetch data from Internet.
Is the offline mode broken? Or some configurations required?
Hi, when trying to install on Termux, running apt install ./android-svc_0.1.0_all.deb
I'm facing the following:
Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'android-svc' instead of './android-svc_0.1.0_all.deb' The following additional packages will be installed: git libuuid pcre2 vim vim-runtime wget The following NEW packages will be installed: android-svc git libuuid pcre2 vim vim-runtime wget 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded. Need to get 9155 kB/9161 kB of archives. After this operation, 44.1 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 /storage/emulated/0/Download/android-svc_0.1.0_all.deb android-svc all 0.1.0 [5856 B] Err:2 https://termux.org/packages stable/main aarch64 pcre2 aarch64 10.36 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.39 443] Err:3 https://termux.org/packages stable/main aarch64 git aarch64 2.29.2 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.39 443] Err:4 https://termux.org/packages stable/main aarch64 libuuid aarch64 1.0.3-4 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.39 443] Err:5 https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx stable/main aarch64 wget aarch64 1.20.3-3 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.200 443] Err:6 https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx stable/main aarch64 vim-runtime all 8.2.2100 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.200 443] Err:7 https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx stable/main aarch64 vim aarch64 8.2.2100 Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.200 443] E: Failed to fetch https://termux.org/packages/aarch64/pcre2_10.36_aarch64.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.39 443] E: Failed to fetch https://termux.org/packages/aarch64/git_2.29.2_aarch64.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.39 443] E: Failed to fetch https://termux.org/packages/aarch64/libuuid_1.0.3-4_aarch64.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.39 443] E: Failed to fetch https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx/aarch64/wget_1.20.3-3_aarch64.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.200 443] E: Failed to fetch https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx/all/vim-runtime_8.2.2100_all.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.200 443] E: Failed to fetch https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx/aarch64/vim_8.2.2100_aarch64.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 172.64.81.200 443]
Hi,
I'm starting implementing services functions for a adbkit fork project.
In the beginning, I just want to access the phone number of a phone using ADB.
but I want a clean implementation.
so I start to implement a service mapping code.
Maybe we can share some code (I'm using typescript, in my version).
Now I can list services, get the android version, the download the corrects aidl
files from android git.
About the Parcel response, I extract all data as a buffer, convert big-endian to little-endian, and then read the response as UTF-16-LE (nodeJS do not support big-endian UTF-16).
TODO:
aidl
files.Question:
How can I get the android minor revision. (for now I will check if all minor version are the same)
I found some interesting code here
Installed Termux and android-svc_0.1.0_all.deb on a LineageOS 17 rooted phone, but when I try to run android-svc download, it says "Permission denied".
~ $ android-svc download
Permission denied
Failed to retrieve Android version in GetAndroidVersion
~ $ sudo android-svc download
Permission denied
~ $
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.