feat: 第三轮深度完善 — SQLite/JSON/网络/媒体/文本 真实实现

SQLite真实数据库:
- SQLiteDatabase: execSQL/insert/insertOrThrow/replace/update/delete/query 用sqlite3
- 修复getVersion/setVersion用PRAGMA user_version
- 修复getMaximumSize/getPageSize/setMaximumSize/setPageSize用PRAGMA
- SQLiteStatement: execute/simpleQueryForLong/simpleQueryForString/execQuery
- SQLiteOpenHelper: onCreate/onUpgrade/onDowngrade回调正确触发
- 修复SQLiteCursor.moveToPosition越界处理
- 修复ContentValues值对提取bug

JSON真实实现:
- JSONObject: isNull/append/putOnce/putOpt/getNames
- JSONArray: 完整put/get/opt/length/toString

网络真实实现:
- NetworkInterface: getByName/getNetworkInterfaces/getHardwareAddress 用/sys/class/net+fcntl.ioctl
- InterfaceAddress: 新增类
- ConnectivityManager: getActiveNetwork/getAllNetworks 用LinuxNetwork
- WifiManager: getScanResults用nmcli, setWifiEnabled用nmcli/rfkill
- BluetoothAdapter: getAddress/getName 用bluetoothctl

媒体真实实现:
- MediaPlayer: prepare检查文件, getCurrentPosition实时计算, getDuration/getVideoWidth用ffprobe
- MediaRecorder: setVideoSize/setVideoFrameRate/setVideoEncodingBitRate配置存储
- MediaMetadataRetriever: extractMetadata用ffprobe, getFrameAtTime用ffmpeg, getEmbeddedPicture用ffmpeg

文本真实实现:
- TextUtils: split用re.split, concat/indexOf/lastIndexOf/urlEncode/urlDecode
- SpannableString: setSpan/getSpans/getSpanFlags/nextSpanTransition 真实实现
- SpannableStringBuilder: 修复append重载bug

Provider增强:
- Settings: putBoolean/getBoolean
- MediaStore: getContentUri/VOLUME常量
- ContactsContract: 补全常量和CommonDataKinds

Util增强:
- Log: w/e/wtf支持Throwable参数, 修复wtf重复定义bug
- TypedValue: 修复complexToDimension/complexToFloat/getFloat实现

修复:
- __init__.py: 补全NetworkInterface/InetAddress/MediaMetadataRetriever/SpannableStringBuilder导出

统计: 221模块, 3666类, 31005方法, 183529行
This commit is contained in:
shuiyu1123 committed 2026-06-25 00:40:59 +00:00
1 parent 4235f8692c
commit fbb8263b13
13 files changed
+1373 -146

No files matched your search

+19 -3
View File
@@ -331,21 +331,31 @@ class Cursor(Stub):
return self.moveToPosition(self._pos + offset)
def moveToPosition(self, position: int) -> bool:
if position < -1 or position >= self.getCount():
count = self.getCount()
if position >= count:
self._pos = count
return False
if position < -1:
self._pos = -1
return False
self._pos = position
return True
def isFirst(self) -> bool:
return self._pos == 0
return self._pos == 0 and self.getCount() > 0
def isLast(self) -> bool:
return self._pos == self.getCount() - 1
count = self.getCount()
return count > 0 and self._pos == count - 1
def isBeforeFirst(self) -> bool:
if self.getCount() == 0:
return True
return self._pos < 0
def isAfterLast(self) -> bool:
if self.getCount() == 0:
return True
return self._pos >= self.getCount()
def getColumnIndex(self, column_name: str) -> int:
@@ -370,6 +380,9 @@ class Cursor(Stub):
def getColumnNames(self) -> List[str]:
return []
def getColumnCount(self) -> int:
return len(self.getColumnNames())
def getType(self, column_index: int) -> int:
return self.FIELD_TYPE_NULL
@@ -759,6 +772,9 @@ class MatrixCursor(AbstractCursor):
def getLong(self, column_index: int) -> int:
return self.getInt(column_index)
def getShort(self, column_index: int) -> int:
return self.getInt(column_index)
def getFloat(self, column_index: int) -> float:
v = self.getString(column_index)
if v is None: