REAndroid / APKEditor

Powerful android apk editor - aapt/aapt2 independent
Apache License 2.0
645 stars 95 forks source link

Temp working directories #87

Open ApkRE opened 4 months ago

ApkRE commented 4 months ago

APKEditor creates temp random named temp directory (tmp_xxxxxxxx) on every use and my dev directory is full of these which I have to keep deleting Can you add an option to choose the temp working directory or automatically delete the working directory after use?

Many thanks for a great tool

REAndroid commented 4 months ago

Did you find .apk files inside those tmp directory ? Which OS are you using ?

ApkRE commented 4 months ago

I'm using Windows No files in them, just empty directories. 1 created each time I "merge" regardless of the output directory

REAndroid commented 2 months ago

I don't have windows machine, confirm 1.3.7 solves this issue

ApkRE commented 2 months ago

Still the same with 1.3.7 While merging directory tmp_1836e20c is created and apks extracted there apks deleted once done, directory remains Running again creates tmp_1836e20c_1

REAndroid commented 2 months ago

I updated to log the reason why directory not being deleted. Build your own or download from Artifacts. Please test and let us know your results

ApkRE commented 2 months ago

I downloaded from your Artifacts link and tried again and it's still the same... :(

REAndroid commented 2 months ago

I was hopping you come back with logs

ApkRE commented 2 months ago

Sorry here's an example log...

00.000 I: [MERGE] Merging ...
   Input: 1.xapk
 Output: 1_merged.apk
 ----------------------------
00.028 I: [MERGE] Extracting to: tmp_565db641
00.107 I: [MERGE] Searching apk files ...
00.111 I: [MERGE] Found apk files: 2
00.217 I: [MERGE] Found modules: 2
00.357 I: [MERGE] Merging string pools ...
00.391 I: [MERGE] Merged string pools=1, style=0, strings=7956
00.438 I: [MERGE] Merging: [*PackageName*]
00.441 I: [MERGE] Added [*PackageName*] classes.dex -> classes.dex
00.441 I: [MERGE] Added [*PackageName*] classes2.dex -> classes2.dex
00.441 I: [MERGE] Added [*PackageName*] classes3.dex -> classes3.dex
00.441 I: [MERGE] Merging resource table: *PackageName*
00.675 I: [MERGE] Merging: config.armeabi_v7a
00.728 I: [MERGE] Sanitizing manifest ...
00.732 I: [MERGE] Removed-attribute : extractNativeLibs
00.733 I: [MERGE] Removed-attribute : isSplitRequired
00.734 I: [MERGE] Removed-element : <meta-data> name="com.android.vending.splits.required"
00.735 I: [MERGE] Removed-element : <meta-data> name="com.android.stamp.source"
00.736 I: [MERGE] Removed-element : <meta-data> name="com.android.stamp.type"
00.739 I: [MERGE] Removed-table-entry : res/xml/splits0.xml
00.739 I: [MERGE] Removed-element : <meta-data> name="com.android.vending.splits"
00.740 I: [MERGE] Removed-element : <meta-data> name="com.android.vending.derived.apk.id"
00.781 I: [MERGE] Removed unused table strings = 1
Package: *PackageName*
  Removed unused spec strings = 1
Table size changed = 1108088, 1108136
00.785 I: [MERGE] Writing apk ...
00.798 I: [MERGE] Buffering compress changed files ...
01.217 I: [MERGE] Writing files: 1736
01.453 I: [MERGE] Writing signature block ...
01.475 I: [MERGE] Directory exists: C:\xapk\tmp_565db641
01.476 I: [MERGE] files.length = 2tmp_565db641\*PackageName*.apk
tmp_565db641\config.armeabi_v7a.apk
01.478 I: [MERGE] Directory exists: C:\xapk\tmp_565db641
01.479 I: [MERGE] files.length = 2tmp_565db641\*PackageName*.apk
tmp_565db641\config.armeabi_v7a.apk
01.480 I: [MERGE] Saved to: 1_merged.apk
REAndroid commented 2 months ago

Thank you, i assumed you censored *PackageName* and not real value.

01.479 I: [MERGE] files.length = 2tmp_565db641\*PackageName*.apk
tmp_565db641\config.armeabi_v7a.apk

Supper odd for me! this two files were deleted even twice, I have to debug this myself on windows

ApkRE commented 2 months ago

Yes I censored the package name, no problem with the name, same problem with all files... Thanks :)