Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-libtruezip: Commit

external/libtruezip


Commit MetaInfo

Revision45ac3d07b5a4753bd1abc9fa38fd48221312a3d9 (tree)
Time2014-10-30 09:57:46
AuthorJorge Ruesga <jorge@rues...>
CommiterJorge Ruesga

Log Message

Better way and explanations for hacks

Change-Id: I1bfae7d137a4a43de2fe538cd0b5146a93a5cccb
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Change Summary

Incremental Difference

--- a/src/de/schlichtherle/truezip/file/TFile.java
+++ b/src/de/schlichtherle/truezip/file/TFile.java
@@ -1791,8 +1791,9 @@ public final class TFile extends File {
17911791
17921792 /**
17931793 * {@hide}
1794+ * DO NOT CALL ON FILES DIFFERENT FROM THE FILESYSTEM ROOT
17941795 */
1795- public void open() throws IOException {
1796+ public void mount() throws IOException {
17961797 if (null != innerArchive) {
17971798 try {
17981799 innerArchive.getController().mknod(
--- a/src/de/schlichtherle/truezip/key/PromptingKeyProvider.java
+++ b/src/de/schlichtherle/truezip/key/PromptingKeyProvider.java
@@ -28,10 +28,12 @@ extends SafeKeyProvider<K> {
2828 /** The resource identifier for the protected resource. */
2929 private volatile URI resource;
3030
31+ private boolean askAlwaysForWriteKey;
3132 private volatile boolean changeRequested;
3233
3334 PromptingKeyProvider(PromptingKeyManager<K> manager) {
3435 this.view = manager.getView();
36+ this.askAlwaysForWriteKey = false;
3537 }
3638
3739 private View<K> getView() {
@@ -48,6 +50,13 @@ extends SafeKeyProvider<K> {
4850 }
4951
5052 /**
53+ * {@hide}
54+ */
55+ public void setAskAlwaysForWriteKey(boolean askAlwaysForWriteKey) {
56+ this.askAlwaysForWriteKey = askAlwaysForWriteKey;
57+ }
58+
59+ /**
5160 * Returns the unique resource identifier (resource ID) of the protected
5261 * resource for which this key provider is used.
5362 * May be {@code null}.
@@ -194,9 +203,7 @@ extends SafeKeyProvider<K> {
194203 if (provider.isChangeRequested()) {
195204 provider.setChangeRequested(false);
196205 RESET.retrieveWriteKey(provider); // DON'T change state!
197- } else {
198- // FIXME -- CMFM -- Always ask for password. Caching is the view side.
199- // This allow to reset the password (a bad way)
206+ } else if (provider.askAlwaysForWriteKey) {
200207 PromptingKeyProvider<K>.BaseController controller
201208 = provider.new WriteController(this);
202209 try {
Show on old repository browser