MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / get_version_string_from_manifest

Method get_version_string_from_manifest

utility/file_access_apk.cpp:153–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153Error APKArchive::get_version_string_from_manifest(String &version_string) {
154 AXMLParser parser;
155 Ref<FileAccessAPK> thing = memnew(FileAccessAPK("AndroidManifest.xml"));
156 Vector<uint8_t> buf;
157 buf.resize(thing->get_length());
158 thing->get_buffer(buf.ptrw(), thing->get_length());
159 Error err = parser.parse_manifest(buf);
160 ERR_FAIL_COND_V_MSG(err, err, "Failed to parse manifest!");
161 //right now we are only interested in the version
162 version_string = parser.get_godot_library_version_string();
163 // Godot 2.x did not write version strings to the manifest
164 if (version_string.is_empty()) {
165 version_string = "unknown";
166 }
167 return OK;
168}
169
170bool APKArchive::try_open_pack(const String &p_path, bool p_replace_files, uint64_t p_offset, const Vector<uint8_t> &p_decryption_key) {
171 // load with offset feature only supported for PCK files

Callers

nothing calls this directly

Calls 6

FileAccessAPKClass · 0.85
parse_manifestMethod · 0.80
resizeMethod · 0.45
get_lengthMethod · 0.45
get_bufferMethod · 0.45

Tested by

no test coverage detected