allow to open .xml files (as unencrypted database) in read-only mode, closes https://github.com/PhilippC/keepass2android/issues/1450
This commit is contained in:
		| @@ -28,8 +28,8 @@ namespace KeePassLib.Serialization | ||||
| 		/// </summary> | ||||
| 		public static KdbxFormat GetFormatToUse(string fileExt) | ||||
| 		{ | ||||
| 			// If the filename ends in .kdbp, use ProtocolBuffers format. | ||||
| 			return fileExt.Equals(KdbpFile.FileNameExtension, StringComparison.OrdinalIgnoreCase) ? KdbxFormat.ProtocolBuffers : KdbxFormat.Default; | ||||
|             return fileExt.Equals(KdbpFile.FileNameExtension, StringComparison.OrdinalIgnoreCase) ? KdbxFormat.ProtocolBuffers : | ||||
|                 (fileExt.Equals("xml", StringComparison.OrdinalIgnoreCase) ? KdbxFormat.PlainXml : KdbxFormat.Default); | ||||
|         } | ||||
|  | ||||
| 		public static void WriteDocument(PwDatabase database, Stream stream, byte[] protectedStreamKey, byte[] hashOfHeader) | ||||
|   | ||||
| @@ -27,7 +27,7 @@ namespace keepass2android | ||||
| 		} | ||||
|  | ||||
| 		public byte[] HashOfLastStream { get; private set; } | ||||
| 		public bool CanWrite { get { return true; } } | ||||
| 		public bool CanWrite { get { return _format != KdbxFormat.PlainXml; } } | ||||
| 		public string SuccessMessage { get { return null; } } | ||||
| 		public void Save(PwDatabase kpDatabase, Stream stream) | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Philipp Crocoll
					Philipp Crocoll