在Android中编辑settings.db是否安全? [英] Is it safe to edit settings.db in Android

查看:168
本文介绍了在Android中编辑settings.db是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在预配置Android设备,现在终于找到了所有系统设置存储在Android上的位置.现在要问的问题:在以下位置替换sqlite数据库 settings.db 是否安全:

I am working on pre-configuring an Android device and now I have finally found where all the system settings are stored on Android. Now to the question: Is is safe to replace the sqlite database settings.db in:

root@android:/data/data/com.android.providers.settings/databases # ls -la
-rw-rw---- system   system      77824 2017-03-23 11:25 settings.db
-rw------- system   system      33344 2017-03-23 11:25 settings.db-journal

那么settings.db-journal呢,如果我假设没有人对任何设置做太多的设置",我可以删除它吗?数据库中是否包含该设备独有的任何内容,即序列号或绝对不应替换的序列号?我正在考虑将同一数据库复制到大量设备...所以我只想知道它是否有任何问题.

What about settings.db-journal, can I delete that if I assume that noone is doing much "setting" of any settings? Does the database contain anything unique to just this device, i.e. a serial number or such that absolutely shouldn't be replaced? I am thinking of copying over the same database to a large number of devices...so I just want to know if there are any problems with that.

我是否必须在重新启动或类似操作之前进行一些f-sync?

Do I have to do some f-sync before reboot or such as well?

推荐答案

打开文件时,请勿替换数据库文件.

You must not replace a database file while it is open.

-journal文件是数据库的一部分.删除它会导致数据损坏(除非它碰巧是空的).

The -journal file is part of the database. Deleting it will lead to data corruption (unless it happens to be empty).

这篇关于在Android中编辑settings.db是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆