-
Notifications
You must be signed in to change notification settings - Fork 527
File manager not detected #327
Comments
Could you please test if this is okay for you: http://d-h.st/Eyb |
I just used Export, now the file name is YY-MM-DD-HH EZ file Explorer didn't show straight the .Xprivacy folder |
Try OI File Manager |
I just got PRO version from you. But this feature is not working. I am using latest nightly of LegacyXperia CM10.2 Android 4.3. When I click export, it directly writes in /sdcard/.xprivacy/XPrivacy.xml It overwrites it everytime without asking for confirmation.(If you accidentally happen to touch "Export" the old exported setting is overwritten) I installed OI File manager but it seems its not calling OI File manager. (However it shows popup to save to google drive or so) If you import, again it automatically imports without asking for filename/directory. (I hope clicking on import twice will not cause duplicate entries or something internally) Also a suggestion, filename should not be hour dependent. It should be XPrivacy-YYYYMMDDHHMMss.xml This way I can test things easily making sure I have backup of latest "stable" settings. Or I can revert back easily one by one in reverse order. |
In the next release seconds will be added to the file name, so there will be no more overwrites. If there is no suitable file manager, the file name will be /sdcard/.xprivacy/XPrivacy.xml |
But I have installed OI File Manager. I even rebooted after installing OI File Manager. Still its not asking me for file name. Do I have to do some settings? I searched in XPrivacy as well as OI File manager but could not find anything. |
Oh wait sorry. The files are there!!! I was under impression that it will ask me for filename. But I didnt realize that it will NOT ask for name but its still storing as per above naming convention. Sorry for causing confusion. Its working as expected. |
Ok I was going through code (I have not fully understood it) but I failed to understand why do u need OI File Manager for exporting? But I think you can eliminate requiring OI File Manager. In line 74 of src/biz/bokhorst/xprivacy/ActivityShare.java If you change it to, It should eliminate need for OI File Manager for exporting. Line 63: can be moved inside //Import if() statement. Again I have not fully understood the code but to me it appears right way which will not require OI File Manager for exporting. For importing, I think android File Manager works. If you want I can create pull request. |
Support for (OI) File managers was explicitly request, so this will not be removed, sorry. |
No no I am not asking you to remove support for OI File manager. OI File manager comes in to picture only for importing. What I am saying is that, if you dont have OI File Manager, and then u try to export, then File name does not have XPrivacy_yyyyMMdd_HHmmss.xml format. If you change the code as I mentioned above (assuming I understood it right) then filename will be exported in XPrivacy_yyyyMMdd_HHmmss.xml format even if OI FIle Manager is not installed which I think is right way, |
The idea is that if there is no suitable file manager installed the file name for importing/exporting is the same (without time component in the file name). If the exported file name is XPrivacy_yyyyMMdd_HHmmss.xml when there is no suitable file manager installed, importing would be hard. What is exactly your problem? |
Ok this is lengthy but let me explain. First of all forget my above code changes which I suggested. I realized that related code is in ActivityMain.java and not ActivityShare.java This is original request (from 1st post of this ticket).
Nowhere he has asked for OI File manager. I have Google drive, CM File manager and File manager by rhmsoft. Assume that currently I have not installed OI File manager. The problem is here: line 811 file ActivityMain.java (function optionsExport()) Now even if CM File Manager, Google Drive, File Manager by rhmsoft support "choosing a file" for import, somehow above line returns false. So your code stores exports in file Xprivacy.xml. Now I install OI File manager OI File manager turns that line to true and code exports file as XPrivacy_yyyyMMdd_HHmmss.xml Now I want to import the file. Now lets see line 818 in function optionImport() Since this function is true due to existence of OI File Manager, you will realize that the "popup" shows you not just OI File manager, but also CM file manager, Google drive, and rhmsoft file manager. See images, all three are allowing me to "pick / choose a file". (that is when I click Import) 1st pic: XPrivacy first asks me which importer to choose (Drive, CM File manager, etc.) 2nd pic: CM File manager asking me to pick a file for importing 3rd pic: Google drive asking me to pick a file for importing 4th pic: Rhmsoft file manager asking me to pick a file for importing Clearly those file managers also allow you to choose file for importing. But isIntentAvailable() returns false somehow. Also it is safe to assume that person who installs Xposed framework / Xprivacy definitely has good file manager installed. So I think its safe to assume that File can always be exported safely in XPrivacy_yyyyMMdd_HHmmss.xml without checking for isIntenetAvailable(). It will be very rare that person installing Xposed framework and Xprivacy does not have above or equivalent file manager which does not allowing choosing a file. |
"Clearly those file managers also allow you to choose file for importing. But isIntentAvailable() returns false somehow." So, this is the real problem. "Also it is safe to assume that person who installs Xposed framework / Xprivacy definitely has good file manager installed." No, we cannot assume that, there are also a lot of novice users that care about privacy. Can you try to figure out why isIntentAvailable returns false? |
Can you check if the above commit fixes your problem? |
I am sorry to tell you that I have not setup anything on my PC related to android development. So I can not check if it has fixed it because I can not generate APK. I read the code on github and try to debug by imagination! :) If you can generate APK and give me link then i would gladly test it. |
Test version 1.9.10: http://d-h.st/bqy |
Nope. Not working with 1.9.10 its saving file as XPrivacy.xml i.e. date strings. Still needs OI File manager. |
In your latest FIX you may have to use GET_INTENT_FILTERS instead of flag 0 OR See this it suggests use of PackageManager.GET_ACTIVITIES whereas in your earlier code you had used PackageManager.MATCH_DEFAULT_ONLY. http://stackoverflow.com/questions/11679996/pick-a-file-using-intent-action-get-content |
This is a version with the original code restored, but using PackageManager.GET_ACTIVITIES: http://d-h.st/I6u |
Nope not working as well. You have not used one line from that example. Dont know if its really needed. |
Test version: http://d-h.st/w5l |
Finally it worked!! Great work. No more dependent only on OI File manager. It appears that setType was the one missing. And whatever is default for setType (when not used) was defined by OI File manager as available intenet and hence it was working not the rest. But now with file/* all of them work! Thanks. |
Thanks for testing! |
The text was updated successfully, but these errors were encountered: