diff --git a/abx-functions.hpp b/abx-functions.hpp
new file mode 100755
index 0000000..003586d
--- /dev/null
+++ b/abx-functions.hpp
@@ -0,0 +1,289 @@
+#ifndef _ABXFUNCTIONS_HPP
+#define _ABXFUNCTIONS_HPP
+
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <cstring>
+#include <vector>
+#include <algorithm>
+#include <openssl/evp.h>
+
+// ABX (Android Binary XML) to XML converter
+// Copyright (c) 2022, _that
+// SPDX-License-Identifier: GPL-3.0-only
+
+// test: g++ -g abxtoxml.cpp `pkg-config --libs openssl` && ./a.out packages.xml
+
+// based on https://www.cclsolutionsgroup.com/post/android-abx-binary-xml
+
+using namespace std;
+
+class AbxToXml
+{
+	std::istream& m_is;
+	std::ostream& m_os;
+	bool mTagOpen = false;
+	std::vector<std::string> mInternedStrings;
+	bool mError = true;
+
+public:
+	AbxToXml(std::istream& is, std::ostream& os) : m_is(is), m_os(os) {}
+
+	bool run()
+	{
+		mError = true;
+		char buffer[4];
+		m_is.read(buffer, 4);
+		if (memcmp(buffer, "ABX", 3) != 0)
+			// TODO: handle error: not an ABX file
+			return false;
+
+		if (buffer[3] != 0)
+			// TODO: handle error: we only understand ABX version 0
+			return false;
+
+		mError = false;
+		return convert_abx_content();
+	}
+
+private:
+	enum Event
+	{
+		// based on XmlPullParser.java in libcore
+		START_DOCUMENT = 0,
+		END_DOCUMENT = 1,
+		START_TAG = 2,
+		END_TAG = 3,
+		TEXT = 4,
+		CDSECT = 5,
+		ENTITY_REF = 6,
+		IGNORABLE_WHITESPACE = 7,
+		PROCESSING_INSTRUCTION = 8,
+		COMMENT = 9,
+		DOCDECL = 10,
+
+		// based on BinaryXmlSerializer.java
+		ATTRIBUTE = 15,
+	};
+
+	// based on BinaryXmlSerializer.java
+	enum Type
+	{
+		TYPE_NULL = 1 << 4,
+		TYPE_STRING = 2 << 4,
+		TYPE_STRING_INTERNED = 3 << 4,
+		TYPE_BYTES_HEX = 4 << 4,
+		TYPE_BYTES_BASE64 = 5 << 4,
+		TYPE_INT = 6 << 4,
+		TYPE_INT_HEX = 7 << 4,
+		TYPE_LONG = 8 << 4,
+		TYPE_LONG_HEX = 9 << 4,
+		TYPE_FLOAT = 10 << 4,
+		TYPE_DOUBLE = 11 << 4,
+		TYPE_BOOLEAN_TRUE = 12 << 4,
+		TYPE_BOOLEAN_FALSE = 13 << 4,
+	};
+
+
+	bool convert_abx_content()
+	{
+		char b;
+		while (m_is.get(b))
+		{
+			Event ev = Event(b & 0xf);
+			Type ty = Type(b & 0xf0);
+
+			if (ev == ATTRIBUTE)
+			{
+				// TODO: verify that tag is still open
+				m_os << " " << read_data(TYPE_STRING_INTERNED);
+				m_os << "=\"";
+				m_os << read_data(ty);		// TODO: escaping?
+				m_os << '"';
+				continue;
+			}
+			if (mTagOpen)
+			{
+				m_os << ">";
+				mTagOpen = false;
+			}
+			std::string data = read_data(ty);
+			dispatch_event(ev, data);
+		}
+		return !mError;
+	}
+
+	void dispatch_event(Event ev, const std::string& data)
+	{
+		switch (ev)
+		{
+			case START_DOCUMENT:
+			case END_DOCUMENT:
+				// TODO: track that we actually started the document
+				break;
+
+			case START_TAG:
+				m_os << "<" << data;
+				mTagOpen = true;
+				break;
+
+			case END_TAG:
+				m_os << "</" << data << ">";
+				break;
+
+			case TEXT:
+				m_os << data;
+				break;
+
+			case CDSECT:
+				m_os << "<![CDATA[" <<  data << "]]>";
+				break;
+
+			case ENTITY_REF:
+			case IGNORABLE_WHITESPACE:
+			case PROCESSING_INSTRUCTION:
+			case COMMENT:
+			case DOCDECL:
+				m_os << data;
+				// TODO
+				break;
+
+			default:
+				m_os << "#error: Invalid event " << int(ev);
+				mError = true;
+				break;
+		}
+	}
+
+	template <typename T> static T read_bswap(std::istream& is)
+	{
+		char buffer[sizeof(T)];
+		is.read(buffer, sizeof(T));
+		std::reverse(std::begin(buffer), std::end(buffer));
+		return *reinterpret_cast<T*>(buffer);
+	}
+
+	static uint16_t read_uint16(std::istream& is)
+	{
+		return read_bswap<uint16_t>(is);
+	}
+
+	static std::string read_string(std::istream& is)
+	{
+		uint16_t length = read_uint16(is);
+		std::string s;
+		s.resize(length);
+		is.read(&s[0], length);
+		return s;
+	}
+
+
+	std::string read_data(Type ty)
+	{
+		switch (ty)
+		{
+			case TYPE_NULL:
+				return {};
+
+			case TYPE_STRING:
+				return read_string(m_is);
+
+			case TYPE_STRING_INTERNED:
+				{
+					uint16_t id = read_uint16(m_is);
+					if (id == 0xffff)
+					{
+						std::string s = read_string(m_is);
+						mInternedStrings.push_back(s);
+						return s;
+					}
+					if (id >= mInternedStrings.size())
+					{
+						// TODO: handle error
+						mError = true;
+						return "#error: invalid string ID";
+					}
+					return mInternedStrings.at(id);
+				}
+
+			case TYPE_BYTES_HEX:
+				{
+					std::string s = read_string(m_is);
+					std::string hex;
+					static const char* hexdigits = "0123456789abcdef";
+					for (unsigned char c : s)
+					{
+						hex += hexdigits[c >> 4];
+						hex += hexdigits[c & 0xf];
+					}
+					return hex;
+				}
+
+			case TYPE_BYTES_BASE64:
+				{
+					std::string s = read_string(m_is);
+					std::string b64;
+					auto outlen = ((s.length() + 2) / 3) * 4;
+					b64.resize(outlen+1);		// +1 for null terminator
+					auto got = EVP_EncodeBlock(
+						reinterpret_cast<unsigned char *>(&b64[0]),
+						reinterpret_cast<const unsigned char*>(s.c_str()), s.length());
+					if (got != outlen)
+					{
+						mError = true;
+						return "#error: base64 encoding failed";  // TODO
+					}
+					b64.resize(outlen);
+					return b64;
+				}
+
+			case TYPE_INT_HEX:
+				// TODO: output hex instead of dec (what is the exact format?)
+			case TYPE_INT:
+				{
+					int32_t val = read_bswap<int>(m_is);
+					std::stringstream ss;
+					ss << val;
+					return ss.str();
+				}
+
+			case TYPE_LONG_HEX:
+				// TODO: output hex instead of dec (what is the exact format?)
+			case TYPE_LONG:
+				{
+					int64_t val = read_bswap<long>(m_is);
+					std::stringstream ss;
+					ss << val;
+					return ss.str();
+				}
+
+			case TYPE_FLOAT:
+				{
+					float val = read_bswap<float>(m_is);
+					std::stringstream ss;
+					ss << val;
+					return ss.str();
+				}
+
+			case TYPE_DOUBLE:
+				{
+					double val = read_bswap<double>(m_is);
+					std::stringstream ss;
+					ss << val;
+					return ss.str();
+				}
+
+			case TYPE_BOOLEAN_TRUE:
+				return "1";
+
+			case TYPE_BOOLEAN_FALSE:
+				return "0";
+		}
+		// TODO
+		mError = true;
+		return "#error: invalid type";
+	}
+};
+#endif // _ABXFUNCTIONS_HPP
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index dd8470b..01a108c 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1856,7 +1856,14 @@
 			user.userId = to_string(userId);
 
 			// Attempt to get name of user. Fallback to user ID if this fails.
-			char* userFile = PageManager::LoadFileToBuffer("/data/system/users/" + to_string(userId) + ".xml", NULL);
+			std::string path = "/data/system/users/" + to_string(userId) + ".xml";
+			if (!TWFunc::Check_Xml_Format(path)) {
+				string oldpath = path;
+				if (TWFunc::abx_to_xml(oldpath, path)) {
+					LOGINFO("Android 12+: '%s' has been converted into plain text xml (for user %s).\n", oldpath.c_str(), user.userId.c_str());
+				}
+			}
+			char* userFile = PageManager::LoadFileToBuffer(path, NULL);
 			if (userFile == NULL) {
 				user.userName = to_string(userId);
 			}
@@ -3006,8 +3013,17 @@
 		LOGERR("Cannot decrypt adopted storage because /data will not mount\n");
 		return false;
 	}
+
+	std::string path = "/data/system/storage.xml";
+	if (!TWFunc::Check_Xml_Format(path)) {
+		std::string oldpath = path;
+		if (TWFunc::abx_to_xml(oldpath, path)) {
+			LOGINFO("Android 12+: '%s' has been converted into plain text xml (%s).\n", oldpath.c_str(), path.c_str());
+		}
+	}
+
 	LOGINFO("Decrypt adopted storage starting\n");
-	char* xmlFile = PageManager::LoadFileToBuffer("/data/system/storage.xml", NULL);
+	char* xmlFile = PageManager::LoadFileToBuffer(path, NULL);
 	xml_document<> *doc = NULL;
 	xml_node<>* volumes = NULL;
 	string Primary_Storage_UUID = "";
@@ -3615,4 +3631,4 @@
 		return false;
 	}
 	return true;
-}
\ No newline at end of file
+}
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index b557684..7ee5139 100755
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -44,6 +44,7 @@
 #include <android-base/chrono_utils.h>
 
 #include "twrp-functions.hpp"
+#include "abx-functions.hpp"
 #include "twcommon.h"
 #include "gui/gui.hpp"
 #ifndef BUILD_TWRPTAR_MAIN
@@ -1539,4 +1540,58 @@
 exit:
 	return TW_DEFAULT_RECOVERY_FOLDER;
 }
+
+bool TWFunc::Check_Xml_Format(const std::string filename) {
+	std::string buffer(' ', 4);
+	std::string abx_hdr("ABX\x00", 4);
+	std::ifstream File;
+	File.open(filename);
+	if (File.is_open()) {
+		File.get(&buffer[0], buffer.size());
+		File.close();
+		// Android Binary Xml start from these bytes
+		if(!buffer.compare(0, abx_hdr.size(), abx_hdr))
+			return false; // ABX format - requires conversion
+	}
+	return true; // good format, possible to parse
+}
+
+// return true=successful conversion (return the name of the converted file in "result");
+// return false=an error happened (leave "result" alone)
+bool TWFunc::abx_to_xml(const std::string path, std::string &result) {
+	bool res = false;
+	if (!TWFunc::Path_Exists(path))
+		return res;
+
+	std::ifstream infile(path);
+	if (!infile.is_open())
+		return res;
+
+	std::string fname = TWFunc::Get_Filename(path);
+	std::string tmp = "/tmp/converted_xml";
+	if (!TWFunc::Path_Exists(tmp)) {
+		if (mkdir(tmp.c_str(), 0777) != 0)
+			tmp = "/tmp";
+	}
+
+	std::string tmp_path = tmp + "/" + fname;
+	std::ofstream outfile(tmp_path);
+	if (!outfile.is_open()) {
+		LOGINFO("Error. The abx conversion of %s has failed.\n", path.c_str());
+		infile.close();
+		return res;
+	}
+
+	AbxToXml r(infile, outfile);
+	if (r.run() && TWFunc::Path_Exists(tmp_path)) {
+		res = true;
+		result = tmp_path;
+	}
+
+	infile.close();
+	outfile.close();
+
+	return res;
+}
+
 #endif // ndef BUILD_TWRPTAR_MAIN
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index e5656f5..6221741 100755
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -131,7 +131,9 @@
 	static void List_Mounts(); // List current mounts by the kernel
 	static void Clear_Bootloader_Message(); // Removes the bootloader message from misc for next boot
 	static string Check_For_TwrpFolder(); // Gets user defined path on storage where backups should be stored
+	static bool Check_Xml_Format(const std::string filename); // Return whether a xml is in plain xml or ABX format
 
+	static bool abx_to_xml(const std::string path, std::string &result); // could we convert abx to xml (if so, return the full path to the converted file)
 private:
 	static void Copy_Log(string Source, string Destination);
 
