[Project] WP8 File Explorer Project

Search This thread

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
Please visit https://wp8fileexplorer.codeplex.com/ for source code

I've posted the source code on Codeplex and the project will be continued by @rudironsoni and me.
New in 0.0.7 alpha:
Use LongListMultiSelector to select multi files.


---------20131027---------
Today I've made another alpha release (0.0.5).
New:
1.display the path on the top of the list
2.copy/cut and paste between internal storage / sd card
3.allow user to select the root path (will stay default after restart the app, currently I do not have time to save it)

What will be in the following updates:
1.a better UI (maybe I will redesign it when I have more time..)
2.a GUI registry editor
3.call samsung driver to move system files (edit small files in C:\Windows on device like HOSTS)
4.more...still thinking about that.

---------20131025---------
Yesterday I added some permissions to an app and succeeded to create,delete files on SD card and C:\data\user\public using both NativeAccess library by @GoodDayToDie and StorageFile in windows runtime.
these may be useful because at least we can manage files that we can see on PC very conveniently and we can open .docx files and etc. directly from SD card. I will post the file browser here several days later

another idea is the ServiceAgent. I know that this part is only for OEM but since we've already Interop Unlocked so I think it might be possible to develop a background Web Server (FTP,HTTP,etc.) so that every application can access them even they are downloaded from store.
and we can run that in the background after the device boot up and can keep running until the device shutdown or NotifyComplete() is called.
I take a look at the HTC app(clock) and find that it is using ServiceAgent to run in background to update the tile in a short period.

Also, some permissions are really interesting related to Package manager, using which we can install xap in some way..

the only problem is API documents.. I know it works but I don't know how to implement them.
maybe I can only make a common file manager..

Here comes my XAP...(English) currently it only supports browsing , opening and removing files in public internal folder (which you see in MTP) and SD card.
Double tap to open,you can also use multiselect (single tap)
it might be full of bug..
 

Attachments

  • FileExplorer_Release_ARM.xap
    120.9 KB · Views: 2,859
  • FileExplorer_Release_0.0.5_Alpha_ARM.xap
    208.8 KB · Views: 2,497
  • FileExplorer_Release_ARM_0.0.7_alpha.xap
    395.6 KB · Views: 2,551
Last edited:

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,931
Seattle
You can actually do long-running processes without an official "agent" at all - just CreateProcess an executable in your app, and don't kill it; the OS won't even when your app exits - but the rest of your ideas are good and it's possible that a ServiceAgent has some useful features as well. Just checking: you had to use the official APIs for the SD card, right? You couldn't actually read the card directly.
 
  • Like
Reactions: ngame

contable

Senior Member
Oct 25, 2009
1,755
996
You can actually do long-running processes without an official "agent" at all - just CreateProcess an executable in your app, and don't kill it; the OS won't even when your app exits - but the rest of your ideas are good and it's possible that a ServiceAgent has some useful features as well. Just checking: you had to use the official APIs for the SD card, right? You couldn't actually read the card directly.

As I have allready added a full-working sd card filebrowser for pdf-files (copy, move, delete, open, create folder) to my PDF to Office app I have to say that actually it´s not possible to make visible filytypes like ".doc" or ".docx" because they are reserved for built-in apps.

I tried to register those file-extensions in the manifest-file without result....

Edit: Correct me if I´m wrong.
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,931
Seattle
It *may* be possible for homebrew to register those file types, but that's still not actually a proper filebrowser. If it were, you could read the file system directly... and you can't.
 

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
You can actually do long-running processes without an official "agent" at all - just CreateProcess an executable in your app, and don't kill it; the OS won't even when your app exits - but the rest of your ideas are good and it's possible that a ServiceAgent has some useful features as well. Just checking: you had to use the official APIs for the SD card, right? You couldn't actually read the card directly.

actually I even didn't add the SD card capability. I used your native access with some interesting caps and I will post it here.
it actually works..
 

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
Forgive my Chinese and Japanese but you can see that it is wma.
 

Attachments

  • wp_ss_20131024_0003.jpg
    wp_ss_20131024_0003.jpg
    29.6 KB · Views: 1,418
  • Like
Reactions: contable

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
I see.

When can you post the source here ?

Actually source is not so important but here I will list the capabilities that i used. xap will be here in an hour.
after adding these capabilities, you can use NativeAccess library to operate files on C:\Data\User\Public and D:\
I only confirmed that i can delete any thing. Currently my GUI only support opening a file(with winrt storagefile api) and deleting file.
notice that many of these capabilities are useless, I didn't have time to check out what they are for. but I guess ID_CAP_PUBLIC_FOLDER_FULL and ID_CAP_STORAGE_MANAGEMENT make you see what located in C:\Data\User\Public and D:\

<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
<Capability Name="ID_CAP_ENTERPRISE_AUTHENTICATION"/>
<Capability Name="ID_CAP_ENTERPRISE_ENROLLMENT"/>
<Capability Name="ID_CAP_ENTERPRISE_SERVICE"/>
<Capability Name="ID_CAP_BUILTIN_SYMBOLICLINK" />
<Capability Name="ID_CAP_USB" />
<Capability Name="ID_CAP_APPRESOLVER"/>
<Capability Name="ID_CAP_APPPREINSTALL_DIRECTORY"/>
<Capability Name="ID_CAP_EMPLOYEEAPPS_ADMIN"/>
<Capability Name="ID_CAP_STORAGE_MANAGEMENT" />
<Capability Name="ID_CAP_PUBLIC_FOLDER_FULL" />
<Capability Name="ID_CAP_PM_INSTALL" />
<Capability Name="ID_CAP_PM_BSS" />
<Capability Name="ID_CAP_PM_1ST_PARTY" />
<Capability Name="ID_CAP_OEMPUBLICDIRECTORY" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_MULTIMEDIA_ENCODER_HARDWARE" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_MEDIALIB_VIDEO" />
<Capability Name="ID_CAP_OEM_ADC"/>
<Capability Name="ID_CAP_INTEROPSERVICES"/>
<Capability Name="ID_CAP_MEDIALIB_PHOTO_FULL" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT_ADMIN" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT_BOOTSTRAP" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT_SECURITY_POLICIES" />
<Capability Name="ID_CAP_PUSH_NOTIFICATION"/>
<Capability Name="ID_CAP_PROXIMITY"/>
<Capability Name="ID_CAP_CELL_WNF"/>
<Capability Name="ID_CAP_CELL_API_OEM_PASSTHROUGH"/>
<Capability Name="ID_CAP_CELL_API_COMMON"/>
<Capability Name="ID_CAP_CELL_API_UICC_LOWLEVEL"/>
<Capability Name="ID_CAP_CELL_API_LOCATION"/>
<Capability Name="ID_CAP_DEBUG" />
<Capability Name="ID_CAP_DEBUG_FOLDERS" />
<Capability Name="ID_CAP_BUILTIN_CREATEPERMANENT" />
<Capability Name="ID_CAP_BUILTIN_DEFAULT" />
<Capability Name="ID_CAP_BUILTIN_PROFILE" />
<Capability Name="ID_CAP_BUILTIN_BASEPRIORITY" />
<Capability Name="ID_CAP_BUILTIN_CREATEGLOBAL" />
<Capability Name="ID_CAP_BUILTIN_SHUTDOWN" />
<Capability Name="ID_CAP_BACKGROUND_WORKER" />
<Capability Name="ID_CAP_WPTOOLS_INSTALL_FOLDER" />
<Capability Name="ID_CAP_BUILTIN_TCB" />
 
Last edited:

contable

Senior Member
Oct 25, 2009
1,755
996
Actually source is not so important but here I will list the capabilities that i used. xap will be here in an hour.
after adding these capabilities, you can use NativeAccess library to operate files on C:\Data\User\Public and D:\
I only confirmed that i can delete any thing. Currently my GUI only support opening a file(with winrt storagefile api) and deleting file.
notice that many of these capabilities are useless, I didn't have time to check out what they are for. but I guess ID_CAP_PUBLIC_FOLDER_FULL and ID_CAP_STORAGE_MANAGEMENT make you see what located in C:\Data\User\Public and D:\

<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
<Capability Name="ID_CAP_ENTERPRISE_AUTHENTICATION"/>
<Capability Name="ID_CAP_ENTERPRISE_ENROLLMENT"/>
<Capability Name="ID_CAP_ENTERPRISE_SERVICE"/>
<Capability Name="ID_CAP_BUILTIN_SYMBOLICLINK" />
<Capability Name="ID_CAP_USB" />
<Capability Name="ID_CAP_APPRESOLVER"/>
<Capability Name="ID_CAP_APPPREINSTALL_DIRECTORY"/>
<Capability Name="ID_CAP_EMPLOYEEAPPS_ADMIN"/>
<Capability Name="ID_CAP_STORAGE_MANAGEMENT" />
<Capability Name="ID_CAP_PUBLIC_FOLDER_FULL" />
<Capability Name="ID_CAP_PM_INSTALL" />
<Capability Name="ID_CAP_PM_BSS" />
<Capability Name="ID_CAP_PM_1ST_PARTY" />
<Capability Name="ID_CAP_OEMPUBLICDIRECTORY" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_MULTIMEDIA_ENCODER_HARDWARE" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_MEDIALIB_VIDEO" />
<Capability Name="ID_CAP_OEM_ADC"/>
<Capability Name="ID_CAP_INTEROPSERVICES"/>
<Capability Name="ID_CAP_MEDIALIB_PHOTO_FULL" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT_ADMIN" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT_BOOTSTRAP" />
<Capability Name="ID_CAP_DEVICE_MANAGEMENT_SECURITY_POLICIES" />
<Capability Name="ID_CAP_PUSH_NOTIFICATION"/>
<Capability Name="ID_CAP_PROXIMITY"/>
<Capability Name="ID_CAP_CELL_WNF"/>
<Capability Name="ID_CAP_CELL_API_OEM_PASSTHROUGH"/>
<Capability Name="ID_CAP_CELL_API_COMMON"/>
<Capability Name="ID_CAP_CELL_API_UICC_LOWLEVEL"/>
<Capability Name="ID_CAP_CELL_API_LOCATION"/>
<Capability Name="ID_CAP_DEBUG" />
<Capability Name="ID_CAP_DEBUG_FOLDERS" />
<Capability Name="ID_CAP_BUILTIN_CREATEPERMANENT" />
<Capability Name="ID_CAP_BUILTIN_DEFAULT" />
<Capability Name="ID_CAP_BUILTIN_PROFILE" />
<Capability Name="ID_CAP_BUILTIN_BASEPRIORITY" />
<Capability Name="ID_CAP_BUILTIN_CREATEGLOBAL" />
<Capability Name="ID_CAP_BUILTIN_SHUTDOWN" />
<Capability Name="ID_CAP_BACKGROUND_WORKER" />
<Capability Name="ID_CAP_WPTOOLS_INSTALL_FOLDER" />
<Capability Name="ID_CAP_BUILTIN_TCB" />



I would say it must be ID_CAP_PUBLIC_FOLDER_FULL.

As I have all file-operations enabled (it´s a workaround) I will test it and reply.

Can you post the code for deleting a file on the sd card ?

Thanks for the info.:good:
 
  • Like
Reactions: lordmaxey and ngame

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
I would say it must be ID_CAP_PUBLIC_FOLDER_FULL.

As I have all file-operations enabled (it´s a workaround) I will test it and reply.

Can you post the code for deleting a file on the sd card ?

Thanks for the info.:good:

Here it is part of my source code. NativeFileSystem is from NativeAccess.
"dir" can be D:\xxx .

var nativeFileSystem = new NativeFileSystem();
void DeleteDirectory(string dir)
{
if (!dir.EndsWith("\\")) dir += '\\';
var files = nativeFileSystem.GetFiles(dir + '*', true);

if (files == null || files.Length == 2)
{
NativeFileSystem.DeleteDirectory(dir.Remove(dir.Length - 1));
return;
}
foreach (var file in files)
{
if (file.Name == "." || file.Name == "..") ;//ignore
else if (file.Attributes.HasFlag(FileAttributes.Directory)) DeleteDirectory(dir + file.Name);
else
{
nativeFileSystem.DeleteFile(dir + file.Name);
}
}
NativeFileSystem.DeleteDirectory(dir.Remove(dir.Length - 1));
}
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,931
Seattle
See, I *swear* I was going to get around to enumerating the mounted drives at some point. Really, I promise I was! But there's always so much to do... this is fantastic work, hjc, thank you for sharing your research with us! Accessing the D: drive directly is much more straightforward that going through that silly official API. In any case, have a bunch of Thanks!

Either, or both, of those capabilities could grant access to the SD card; I really don't know. By the way, my webserver is perfectly capable of handling drive letters. You may need to add the relevant CAP, but it's interesting to see that you can get error 5 (ACCESS DENIED, and I really need to fix the error reporting for user-friendliness) on C:\ (or just \) and (without the required caps) on D:\, but E:\ gives error 3 (PATH NOT FOUND).
 

contable

Senior Member
Oct 25, 2009
1,755
996
See, I *swear* I was going to get around to enumerating the mounted drives at some point. Really, I promise I was! But there's always so much to do... this is fantastic work, hjc, thank you for sharing your research with us! Accessing the D: drive directly is much more straightforward that going through that silly official API. In any case, have a bunch of Thanks!

Either, or both, of those capabilities could grant access to the SD card; I really don't know. By the way, my webserver is perfectly capable of handling drive letters. You may need to add the relevant CAP, but it's interesting to see that you can get error 5 (ACCESS DENIED, and I really need to fix the error reporting for user-friendliness) on C:\ (or just \) and (without the required caps) on D:\, but E:\ gives error 3 (PATH NOT FOUND).

Indeed it´s great !

Please give me a hint how to add these capatilities.

If I add them to my manifestfile I get an error.

What am I missing ?
 

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
Indeed it´s great !

Please give me a hint how to add these capatilities.

If I add them to my manifestfile I get an error.

What am I missing ?

just patch the SDK!!
When you see an error, switch to "Output" in Visual studio.
it tells you that a .target file(actually xml) file "thinks" the manifest goes wrong.
then ,you can comment the line that reports the error message (request starting visual studio with administrator).
 
  • Like
Reactions: snickler

contable

Senior Member
Oct 25, 2009
1,755
996
just patch the SDK!!
When you see an error, switch to "Output" in Visual studio.
it tells you that a .target file(actually xml) file "thinks" the manifest goes wrong.
then ,you can comment the line that reports the error message (request starting visual studio with administrator).

Ok, running VS 2012 as admin now...

---------- Post added at 01:00 PM ---------- Previous post was at 12:25 PM ----------

Ok,

patched VS 2012 succussfully, XAP is running again...

Thx again for your help !:good::good::good:

---------- Post added at 01:07 PM ---------- Previous post was at 01:00 PM ----------

If I try to deploy your xap I get an error:

Correct the capatility values in "WMAppManifest.xml"

Any help ?
 
Last edited:

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,931
Seattle
Ah nice, I was just adding them to the XAP after building. I tried editing the XSD, but while that added the types to the auto-complete, it didn't actually let them pass validation. Very annoying. There's probably another file I'd need to tweak for that.
 

contable

Senior Member
Oct 25, 2009
1,755
996
Ok, I got it....

---------- Post added at 01:24 PM ---------- Previous post was at 01:11 PM ----------

This is a great progress ! Really like it.:good:

Many thanks for your research...

---------- Post added at 01:32 PM ---------- Previous post was at 01:24 PM ----------

As the internal folders are visible now we are able to copy and move files from there and to there... Great !!!
 

hjc4869

Senior Member
Jul 31, 2012
52
53
Wuhan
Ok, I got it....

---------- Post added at 01:24 PM ---------- Previous post was at 01:11 PM ----------

This is a great progress ! Really like it.:good:

Many thanks for your research...

---------- Post added at 01:32 PM ---------- Previous post was at 01:24 PM ----------

As the internal folders are visible now we are able to copy and move files from there and to there... Great !!!


hope more homebrew will come out..
btw , there seems to be the capability of installing xaps ,but I don't know how to call the package manager.
is pac-man service in wp8 similar with that in wp7?
possibly we can complete that without root access, just add the permission to the app
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,931
Seattle
I believe you're right. We should try to find the function prototypes for the pacman functions. The fact that the capabilities to use them are available to use should be put to good use.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    Please visit https://wp8fileexplorer.codeplex.com/ for source code

    I've posted the source code on Codeplex and the project will be continued by @rudironsoni and me.
    New in 0.0.7 alpha:
    Use LongListMultiSelector to select multi files.


    ---------20131027---------
    Today I've made another alpha release (0.0.5).
    New:
    1.display the path on the top of the list
    2.copy/cut and paste between internal storage / sd card
    3.allow user to select the root path (will stay default after restart the app, currently I do not have time to save it)

    What will be in the following updates:
    1.a better UI (maybe I will redesign it when I have more time..)
    2.a GUI registry editor
    3.call samsung driver to move system files (edit small files in C:\Windows on device like HOSTS)
    4.more...still thinking about that.

    ---------20131025---------
    Yesterday I added some permissions to an app and succeeded to create,delete files on SD card and C:\data\user\public using both NativeAccess library by @GoodDayToDie and StorageFile in windows runtime.
    these may be useful because at least we can manage files that we can see on PC very conveniently and we can open .docx files and etc. directly from SD card. I will post the file browser here several days later

    another idea is the ServiceAgent. I know that this part is only for OEM but since we've already Interop Unlocked so I think it might be possible to develop a background Web Server (FTP,HTTP,etc.) so that every application can access them even they are downloaded from store.
    and we can run that in the background after the device boot up and can keep running until the device shutdown or NotifyComplete() is called.
    I take a look at the HTC app(clock) and find that it is using ServiceAgent to run in background to update the tile in a short period.

    Also, some permissions are really interesting related to Package manager, using which we can install xap in some way..

    the only problem is API documents.. I know it works but I don't know how to implement them.
    maybe I can only make a common file manager..

    Here comes my XAP...(English) currently it only supports browsing , opening and removing files in public internal folder (which you see in MTP) and SD card.
    Double tap to open,you can also use multiselect (single tap)
    it might be full of bug..
    4
    I would say it must be ID_CAP_PUBLIC_FOLDER_FULL.

    As I have all file-operations enabled (it´s a workaround) I will test it and reply.

    Can you post the code for deleting a file on the sd card ?

    Thanks for the info.:good:

    Here it is part of my source code. NativeFileSystem is from NativeAccess.
    "dir" can be D:\xxx .

    var nativeFileSystem = new NativeFileSystem();
    void DeleteDirectory(string dir)
    {
    if (!dir.EndsWith("\\")) dir += '\\';
    var files = nativeFileSystem.GetFiles(dir + '*', true);

    if (files == null || files.Length == 2)
    {
    NativeFileSystem.DeleteDirectory(dir.Remove(dir.Length - 1));
    return;
    }
    foreach (var file in files)
    {
    if (file.Name == "." || file.Name == "..") ;//ignore
    else if (file.Attributes.HasFlag(FileAttributes.Directory)) DeleteDirectory(dir + file.Name);
    else
    {
    nativeFileSystem.DeleteFile(dir + file.Name);
    }
    }
    NativeFileSystem.DeleteDirectory(dir.Remove(dir.Length - 1));
    }
    3
    This is what I did for WPH Tweaks to disable the manifest validation. Add this snippet at the end of your .csproj before the closing tag:
    Code:
      <Target Name="ValidateWMAppManifest">
        <!-- Do nothing -->
      </Target>
    3
    i've got a problem when deploying it to my phone
    please help....
    see screenshot

    Run BootstrapSamsung.xap and EnableAllSideloading.xap from GDTD again and you will be able to deploy the FileExplorer....

    I had the same problem after GDR3 update.
    3
    I believe you're right. We should try to find the function prototypes for the pacman functions. The fact that the capabilities to use them are available to use should be put to good use.
    There is no problem at all - I have them. XAPDeployer porting is the first in my TODO list after receiving Ativ S which is gonna happen this monday.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone