| 151 | } |
| 152 | |
| 153 | Error 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 | |
| 170 | bool 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 |
nothing calls this directly
no test coverage detected