如何存储ADB Shell的联系人? [安卓]

发布于 2025-02-11 13:56:23 字数 254 浏览 1 评论 0原文

我遇到以下内容: android adb命令”设备

im在我的显示器不起作用的时候。上面给出的命令仅显示我的contatcts。有什么方法可以将其转换为备份文件?这样我可以在备用的Android手机上恢复它?

I came across the following: Android adb command to get total contacts on device

Im at a point where my display isnt working. The command given above just displays my contatcts. Is there some way I can convert it to a backup file? So that I can restore it on my spare android phone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

却一份温柔 2025-02-18 13:56:23

我不确定是否可能手动创建备份文件(您需要知道如何通过.VCF文件中的Contacts应用程序存储和读取数据),但是如果您只想提取并保存数据:

只需使用:只需使用: >”符号,例如:

adb shell content query --uri content://com.android.contacts/contacts | wc -l > Contacts.txt

或(如果要指定路径),

adb shell content query --uri content://com.android.contacts/contacts | wc -l > /home/pi/Desktop/Contacts.txt

这将创建一个名为Contacts的文件(带有.txt格式),该文件保留命令输出

I'm not sure whether creating a backup file manually is possible (you would need to know how data is stored and read by the contacts app in .vcf files), but if you simply want to extract and save the data:

Simply use ">" sign, eg.:

adb shell content query --uri content://com.android.contacts/contacts | wc -l > Contacts.txt

or (if you want to specify a path)

adb shell content query --uri content://com.android.contacts/contacts | wc -l > /home/pi/Desktop/Contacts.txt

This will create a file named Contacts (with a .txt format) that holds the command output

行至春深 2025-02-18 13:56:23

显示联系列并提取它们:

adb shell content询问-uri内容://com.android.contacts/raw_contacts> /home/enokseth/contacts_columns.txt

返回brut文本文件中的列索引。

格式为JSON,带有awk

adb shell content query --uri content://com.android.contacts/raw_contacts | \
awk -F '|' '{
  split($1, id_parts, ", ");
  printf "{";
  for (i = 1; i <= length(id_parts); i++) {
    split(id_parts[i], sub_parts, "=");
    key = sub_parts[1];
    value = sub_parts[2];
    gsub(/^ */, "", key);   # delete space in start of space 
    gsub(/ *$/, "", value); # delete space at end 
    printf "\"%s\":\"%s\"", key, value;
    if (i < length(id_parts)) {
      printf ",";
    }
  }
  printf "}\n";
}' > /home/enokseth/osint-adb/contacts.json

和最后一个命令指标找到RAW_USER提取号码:

adb shell shell content query -uri content -uri content://com.android.contacts/data/phones-provestion-provention-provestion data1-“ raw_contact_id = 1”

返回:

row:0 data1 = 07 45 23 65 12

和所有Startact

To display contact columns and extract them :

adb shell content query --uri content://com.android.contacts/raw_contacts > /home/enokseth/contacts_columns.txt

return a column index in a brut text file.

format as JSON with awk:

adb shell content query --uri content://com.android.contacts/raw_contacts | \
awk -F '|' '{
  split($1, id_parts, ", ");
  printf "{";
  for (i = 1; i <= length(id_parts); i++) {
    split(id_parts[i], sub_parts, "=");
    key = sub_parts[1];
    value = sub_parts[2];
    gsub(/^ */, "", key);   # delete space in start of space 
    gsub(/ *$/, "", value); # delete space at end 
    printf "\"%s\":\"%s\"", key, value;
    if (i < length(id_parts)) {
      printf ",";
    }
  }
  printf "}\n";
}' > /home/enokseth/osint-adb/contacts.json

and last command consit to find raw_user to extract number :

adb shell content query --uri content://com.android.contacts/data/phones --projection data1 --where "raw_contact_id=1"

return :

Row: 0 data1=07 45 23 65 12

and for all constact

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文