Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,781 Members 46,764 Now Online
XDA Developers Android and Mobile Development Forum

[XAP][SOURCE] Storage Cleaner 0.2.1

Tip us?
 
GoodDayToDie
Old
(Last edited by GoodDayToDie; 27th February 2014 at 09:02 PM.) Reason: Update thread title
#1  
Recognized Developer - OP
Thanks Meter 2,699
Posts: 5,682
Join Date: Jan 2011
Location: Seattle
Drive [XAP][SOURCE] Storage Cleaner 0.2.1

Hi folks!

So, inspired by the discoveries on this thread, I set about creating an app to easily discover and delete space-wasting files. This app is now in Alpha stage, and will be advanced to Beta as soon as it is feature-complete.

Requirements: capability-unlock (interop-unlock plus EnableAllSideloading). In the case of files that can't be deleted normally, the app will attempt to use the Samsung-specific RPC Component to move them to the SD card (and delete them from there). The app will still run on non-Samsung phones, or those without SD cards (although you'll get a warning at launch in either case) provided they meet the other requirements, but some folders won't be cleanable.

Current state: Alpha 0.2.1
History:
Alpha 0.2.1: Files will now be checked for the Read-Only flag, and it will be removed if possible, both before attempting an in-place deletion and after moving to SD. In case of an error, the exception type will now be given in the report. Files with a "Modified" date in the future will now be included by default as well.
Alpha 0.2.0: Added Move-to-SD-and-then-delete as a work-around to permissions issues. Added warnings if Samsung RPCComponent or SD card are not present. Truncated overly-long messageboxes to avoid the app hanging for a few minutes due to an accidental tap. Re-compiled as release build for performance.
Initial release (20 Feb 2014)

Source code is available at https://wp8storagecleanup.codeplex.com/

Please post feedback here!
Attached Files
File Type: xap StorageCleanup_Debug_AnyCPU.xap - [Click for QR Code] (48.2 KB, 613 views)
File Type: xap StorageCleanup_0_2_0.xap - [Click for QR Code] (122.7 KB, 394 views)
File Type: xap StorageCleanup_0_2_1.xap - [Click for QR Code] (122.9 KB, 812 views)
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
The Following 17 Users Say Thank You to GoodDayToDie For This Useful Post: [ Click to Expand ]
 
GoodDayToDie
Old
(Last edited by GoodDayToDie; 27th February 2014 at 09:07 PM.)
#2  
Recognized Developer - OP
Thanks Meter 2,699
Posts: 5,682
Join Date: Jan 2011
Location: Seattle
Known issues:
  • Many locations that we nominally have access to don't actually grant *delete* access, only read and write/create (yes, NT tracks permissions for Delete separately from Write). Thus, a lot of files that you'd like to delete might not actually go away. (Sadly, this includes the EdmCache\Lib folder mentioned in the thread linked above). I'm working on it!
    Should be fixed as of 0.2.0, if you have a Samsung phone and an SD card!
  • Many locations set the Read-Only flag on their files, making them un-deletable even with move-to-SD.
    Should be fixed as of 0.2.1, which removes RO flags either in-place or acter move-to-SD
  • The app startup is pretty slow. Well, it's actually fairly fast, but it seems slow because the entire structures of all relevant directories are traversed before the UI is shown. I will move that to a background/async thread "soon".
  • Viewing the files for some locations (like the TIF folders, which often have hundreds or thousands of files) will cause the app to hang for a long time while it tries to format kilobytes of text into a MessageBox.
    As of 0.2.0 this problem should no longer occur, as the messages will be truncated before being displayed in the MessageBox.
  • There's no way to change the list of locations. Well, not short of re-compiling the app, at least. I'll move them to external storage soon.

Features I want to implement:
  • Filtering (especially for specific folders) to files older than a certain date. This is actually already supported by the app; there's just no UI for it.
  • Adding additional locations for cleaning out files from, and removing locations too. Ideally, these would persist across runs of the app.
  • One button to select (or clear) all locations.
  • Option to hide locations which have no files of interest (just to make the list smaller).
  • Ability to edit a given location's filters (filtering on filename patterns is already implemented, but again, there's no UI for it). This should persist too.
  • At some point, the ability to select (or de-select) specific files or folders for deletion, in case the filtering isn't fine-grained enough. This is pretty easy to add; I just hate writing XAML.
  • While I'm at it, the ability to delete directories might be good. Currently this tool only deletes files.
  • More detailed errors when deleting a file fails. It's *usually* ERROR_ACCESS_DENIED, but it could be something else (like the file being in use by another program).
  • An option to move files to the SD card instead of deleting them. This would save space while providing the ability to implement an un-delete. True un-delete would require some kind of log or structure to the moved files.
  • Speaking of logs, I really should have the app generate one. Again, the basic stuff is already there; in fact, it generates *too much* text, so much so that I had to make it truncate MessageBox contents at about a KB.
  • Option to report file sizes in units based on powers of 1000 or powers of 1024 (currently it uses powers of 1000).
  • Internationalization would be good.
  • Possibly, at some point in the future, the ability to check (and clean out) the storage of other apps. You can clean them by just removing (and re-installing) them, of course, but sometimes that's a pain, and a more specific filter may be good.
  • Possibly an in-app update notification when new versions come out...
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
The Following 3 Users Say Thank You to GoodDayToDie For This Useful Post: [ Click to Expand ]
 
GoodDayToDie
Old
#3  
Recognized Developer - OP
Thanks Meter 2,699
Posts: 5,682
Join Date: Jan 2011
Location: Seattle
Reserved for OP.
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
The Following 2 Users Say Thank You to GoodDayToDie For This Useful Post: [ Click to Expand ]
 
lukas_ita
Old
#4  
lukas_ita's Avatar
Senior Member
Thanks Meter 3
Posts: 120
Join Date: Sep 2009
Good work waiting for further versions


Sent from my GT-I8750 using Tapatalk
 
-W_O_L_F-
Old
#5  
-W_O_L_F-'s Avatar
Senior Member
Thanks Meter 558
Posts: 651
Join Date: Jul 2010
Location: Moscow
Hack:
Move "undeletable" files to directory, where you can delete them with RPC and delete.
The Following User Says Thank You to -W_O_L_F- For This Useful Post: [ Click to Expand ]
 
GoodDayToDie
Old
#6  
Recognized Developer - OP
Thanks Meter 2,699
Posts: 5,682
Join Date: Jan 2011
Location: Seattle
the RPCComponent doesn't actually change the file ACLs, and may even turn inherited ACLs into file-specific ones when used; I previously tried copying files from unreadable locations to System32, and was still unable to read them even though I could now see them and see their file size. Very irritating.

My work-around for that is to move them to the SD card, which (being a FAT file system) has no ACLs at all. They can then be deleted from there. This works great... if you have an SD card. While I imagine most Ativ S users have installed such a card (it's one of the best features of the Ativ S, the only first-gen WP8 device to both have good specs *and* a microSD card) and they're pretty cheap if not (only needs to be big enough to briefly store the file being moved; 4GB would be more than enough), it's annoying to introduce dependencies like that. Still you've gotta do what you've gotta do...
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
 
-W_O_L_F-
Old
#7  
-W_O_L_F-'s Avatar
Senior Member
Thanks Meter 558
Posts: 651
Join Date: Jul 2010
Location: Moscow
Quote:
Originally Posted by GoodDayToDie View Post
the RPCComponent doesn't actually change the file ACLs, and may even turn inherited ACLs into file-specific ones when used; I previously tried copying files from unreadable locations to System32, and was still unable to read them even though I could now see them and see their file size. Very irritating.

My work-around for that is to move them to the SD card, which (being a FAT file system) has no ACLs at all. They can then be deleted from there. This works great... if you have an SD card. While I imagine most Ativ S users have installed such a card (it's one of the best features of the Ativ S, the only first-gen WP8 device to both have good specs *and* a microSD card) and they're pretty cheap if not (only needs to be big enough to briefly store the file being moved; 4GB would be more than enough), it's annoying to introduce dependencies like that. Still you've gotta do what you've gotta do...
Just make it an option
 
GoodDayToDie
Old
#8  
Recognized Developer - OP
Thanks Meter 2,699
Posts: 5,682
Join Date: Jan 2011
Location: Seattle
OK, I implemented the Move-to-SD-and-then-delete hack. It's considerably slower that in-place deletion but it works. I also built the app for Release (rather than debug) which improves initial performance somewhat, and truncated long messages so you don't have to watch the phone struggle to display a messagebox with 200KB of text.
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
 
Amirphp
Old
#9  
Amirphp's Avatar
Member
Thanks Meter 8
Posts: 44
Join Date: Aug 2011
Location: Allahabad

 
DONATE TO ME
installed on my lumia 520 with developer unlocked...Not able to open.
Deployed successfully....but no app icon in Application list....
How to launch it?
tell me?
 
lukas_ita
Old
#10  
lukas_ita's Avatar
Senior Member
Thanks Meter 3
Posts: 120
Join Date: Sep 2009
You need capabilities-unlock, it is not possible yet on Lumias. Only on Ativs


Sent from my GT-I8750 using Tapatalk

Tags
cleaner, source, storage, xap
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes