diff --git a/ofrak_core/CHANGELOG.md b/ofrak_core/CHANGELOG.md index edb9a5357..99b93508c 100644 --- a/ofrak_core/CHANGELOG.md +++ b/ofrak_core/CHANGELOG.md @@ -64,6 +64,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Update registered identifiers to make use of new `MagicIdentifier` for following resource tags: `Apk`, `Bzip2Data`, `CpioFilesystem`, `DeviceTreeBlob`, `Elf`, `Ext2Filesystem`, `Ext3Filesystem`, `Ext4Filesystem`, `GzipData`, `ISO9660Image`, `Jffs2Filesystem`, `LzmaData`, `XzData`, `LzoData`, `OpenWrtTrx`, `Pe`, `RarArchive`, `SevenZFilesystem`, `SquashfsFilesystem`, `TarArchive`, `Ubi`, `Ubifs`, `Uf2File`, `UImage`, `ZipArchive`, `ZlibData`, `ZstdData` - Update `Instruction.get_assembly` to by synchronous ([#539](https://github.com/redballoonsecurity/ofrak/issues/539)) +### Deprecated +- `Resource.flush_to_disk` deprecated in favor of `Resource.flush_data_to_disk`. ([#373](https://github.com/redballoonsecurity/ofrak/pull/373), [#567](https://github.com/redballoonsecurity/ofrak/pull/568)) + ### Removed - Removed `Instruction.disassembly` from `Instruction` class: use `Instruction.get_assembly()` instead ([#539](https://github.com/redballoonsecurity/ofrak/issues/539)) diff --git a/ofrak_core/ofrak/resource.py b/ofrak_core/ofrak/resource.py index eb44e7eba..8e3a7759f 100644 --- a/ofrak_core/ofrak/resource.py +++ b/ofrak_core/ofrak/resource.py @@ -22,6 +22,8 @@ overload, ) from contextlib import asynccontextmanager +from warnings import warn + import tempfile312 as tempfile from ofrak.component.interface import ComponentInterface @@ -1451,6 +1453,13 @@ async def flush_data_to_disk(self, path: str, pack: bool = True): with open(path, "wb") as f: pass + async def flush_to_disk(self, path: str, pack: bool = True): # pragma: no cover + warn( + "Resource.flush_to_disk is deprecated! Use Resource.flush_data_to_disk instead.", + category=DeprecationWarning, + ) + return await self.flush_data_to_disk(path, pack) + def __repr__(self): properties = [ f"resource_id={self._resource.id.hex()}",