Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package com.android.launcher3; |
| 17 | |
| 18 | import com.android.launcher3.backup.BackupProtos.CheckedMessage; |
| 19 | import com.android.launcher3.backup.BackupProtos.Favorite; |
| 20 | import com.android.launcher3.backup.BackupProtos.Key; |
Chris Wren | 92aa423 | 2013-10-04 11:29:36 -0400 | [diff] [blame] | 21 | import com.android.launcher3.backup.BackupProtos.Journal; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 22 | import com.android.launcher3.backup.BackupProtos.Resource; |
| 23 | import com.android.launcher3.backup.BackupProtos.Screen; |
| 24 | import com.android.launcher3.backup.BackupProtos.Widget; |
| 25 | |
| 26 | import com.google.protobuf.nano.InvalidProtocolBufferNanoException; |
| 27 | import com.google.protobuf.nano.MessageNano; |
| 28 | |
| 29 | import java.io.BufferedInputStream; |
| 30 | import java.io.ByteArrayOutputStream; |
| 31 | import java.io.File; |
| 32 | import java.io.FileInputStream; |
| 33 | import java.io.FileNotFoundException; |
| 34 | import java.io.FileOutputStream; |
| 35 | import java.io.IOException; |
| 36 | import java.lang.System; |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 37 | import java.util.LinkedList; |
| 38 | import java.util.List; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 39 | import java.util.zip.CRC32; |
| 40 | |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 41 | import javax.xml.bind.DatatypeConverter; |
| 42 | |
| 43 | |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 44 | /** |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 45 | * Commandline utility for decoding Launcher3 backup protocol buffers. |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 46 | * |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 47 | * <P>When using com.android.internal.backup.LocalTransport, the file names are base64-encoded Key |
| 48 | * protocol buffers with a prefix, that have been base64-encoded again by the transport: |
| 49 | * <pre> |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 50 | * echo "TDpDQUlnL0pxVTVnOD0=" | launcher_protoutil -k |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 51 | * </pre> |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 52 | * |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 53 | * <P>This tool understands these file names and will use the embedded Key to detect the type and |
| 54 | * extract the payload automatically: |
| 55 | * <pre> |
| 56 | * launcher_protoutil /tmp/TDpDQUlnL0pxVTVnOD0= |
| 57 | * </pre> |
| 58 | * |
| 59 | * <P>With payload debugging enabled, base64-encoded protocol buffers will be written to the logs. |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 60 | * Copy the encoded snippet from the log, and specify the type explicitly, with the Logs flags: |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 61 | * <pre> |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 62 | * echo "CAEYLiCJ9JKsDw==" | launcher_protoutil -L -k |
| 63 | * </pre> |
| 64 | * For backup payloads it is more convenient to copy the log snippet to a file: |
| 65 | * <pre> |
| 66 | * launcher_protoutil -L -f favorite.log |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 67 | * </pre> |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 68 | */ |
| 69 | class DecoderRing { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 70 | |
| 71 | public static final String STANDARD_IN = "**stdin**"; |
| 72 | |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 73 | private static Class[] TYPES = { |
| 74 | Key.class, |
| 75 | Favorite.class, |
| 76 | Screen.class, |
| 77 | Resource.class, |
| 78 | Widget.class |
| 79 | }; |
| 80 | static final int ICON_TYPE_BITMAP = 1; |
| 81 | |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 82 | public static void main(String[ ] args) |
| 83 | throws Exception { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 84 | Class defaultType = null; |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 85 | boolean extractImages = false; |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 86 | boolean fromLogs = false; |
Chris Wren | 92aa423 | 2013-10-04 11:29:36 -0400 | [diff] [blame] | 87 | int skip = 0; |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 88 | List<File> files = new LinkedList<File>(); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 89 | boolean verbose = false; |
Chris Wren | 92aa423 | 2013-10-04 11:29:36 -0400 | [diff] [blame] | 90 | |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 91 | for (int i = 0; i < args.length; i++) { |
| 92 | if ("-k".equals(args[i])) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 93 | defaultType = Key.class; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 94 | } else if ("-f".equals(args[i])) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 95 | defaultType = Favorite.class; |
Chris Wren | 92aa423 | 2013-10-04 11:29:36 -0400 | [diff] [blame] | 96 | } else if ("-j".equals(args[i])) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 97 | defaultType = Journal.class; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 98 | } else if ("-i".equals(args[i])) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 99 | defaultType = Resource.class; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 100 | } else if ("-s".equals(args[i])) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 101 | defaultType = Screen.class; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 102 | } else if ("-w".equals(args[i])) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 103 | defaultType = Widget.class; |
Chris Wren | 92aa423 | 2013-10-04 11:29:36 -0400 | [diff] [blame] | 104 | } else if ("-S".equals(args[i])) { |
| 105 | if ((i + 1) < args.length) { |
| 106 | skip = Integer.valueOf(args[++i]); |
| 107 | } else { |
| 108 | usage(args); |
| 109 | } |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 110 | } else if ("-x".equals(args[i])) { |
| 111 | extractImages = true; |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 112 | } else if ("-v".equals(args[i])) { |
| 113 | verbose = true; |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 114 | } else if ("-L".equals(args[i])) { |
| 115 | fromLogs = true; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 116 | } else if (args[i] != null && !args[i].startsWith("-")) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 117 | files.add(new File(args[i])); |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 118 | } else { |
| 119 | System.err.println("Unsupported flag: " + args[i]); |
| 120 | usage(args); |
| 121 | } |
| 122 | } |
| 123 | |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 124 | if (defaultType == null && files.isEmpty()) { |
| 125 | // can't infer file type without the key |
| 126 | usage(args); |
Chris Wren | ba2923a | 2013-12-10 15:48:47 -0500 | [diff] [blame] | 127 | } |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 128 | |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 129 | if (files.size() > 1 && defaultType != null) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 130 | System.err.println("Explicit type ignored for multiple files."); |
| 131 | defaultType = null; |
| 132 | } |
| 133 | |
| 134 | if (files.isEmpty()) { |
| 135 | files.add(new File(STANDARD_IN)); |
| 136 | } |
| 137 | |
| 138 | for (File source : files) { |
| 139 | Class type = null; |
| 140 | if (defaultType == null) { |
| 141 | Key key = decodeKey(source.getName().getBytes(), fromLogs); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 142 | if (key != null) { |
| 143 | type = TYPES[key.type]; |
| 144 | if (verbose) { |
| 145 | System.err.println(source.getName() + " is a " + type.getSimpleName()); |
| 146 | System.out.println(key.toString()); |
| 147 | } |
| 148 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 149 | } else { |
| 150 | type = defaultType; |
| 151 | } |
| 152 | |
| 153 | // read in the bytes |
| 154 | ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); |
| 155 | BufferedInputStream input = null; |
| 156 | if (source.getName() == STANDARD_IN) { |
| 157 | input = new BufferedInputStream(System.in); |
| 158 | } else { |
| 159 | try { |
| 160 | input = new BufferedInputStream(new FileInputStream(source)); |
| 161 | } catch (FileNotFoundException e) { |
| 162 | System.err.println("failed to open file: " + source + ", " + e); |
| 163 | System.exit(1); |
| 164 | } |
| 165 | } |
| 166 | byte[] buffer = new byte[1024]; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 167 | try { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 168 | while (input.available() > 0) { |
| 169 | int n = input.read(buffer); |
| 170 | int offset = 0; |
| 171 | if (skip > 0) { |
| 172 | offset = Math.min(skip, n); |
| 173 | n -= offset; |
| 174 | skip -= offset; |
| 175 | } |
| 176 | if (n > 0) { |
| 177 | byteStream.write(buffer, offset, n); |
| 178 | } |
| 179 | } |
| 180 | } catch (IOException e) { |
| 181 | System.err.println("failed to read input: " + e); |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 182 | System.exit(1); |
| 183 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 184 | |
| 185 | MessageNano proto = null; |
| 186 | byte[] payload = byteStream.toByteArray(); |
| 187 | if (type == Key.class) { |
| 188 | proto = decodeKey(payload, fromLogs); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 189 | } else if (type != null) { |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 190 | proto = decodeBackupData(payload, type, fromLogs); |
| 191 | } |
| 192 | |
| 193 | // Generic string output |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 194 | if (proto != null) { |
| 195 | System.out.println(proto.toString()); |
| 196 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 197 | |
| 198 | if (extractImages) { |
| 199 | String prefix = "stdin"; |
| 200 | if (source != null) { |
| 201 | prefix = source.getName(); |
Chris Wren | 92aa423 | 2013-10-04 11:29:36 -0400 | [diff] [blame] | 202 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 203 | // save off the icon bits in a file for inspection |
| 204 | if (proto instanceof Resource) { |
| 205 | Resource icon = (Resource) proto; |
| 206 | writeImageData(icon.data, prefix + ".png"); |
| 207 | } |
| 208 | |
| 209 | // save off the icon bits in a file for inspection |
| 210 | if (proto instanceof Favorite) { |
| 211 | Favorite favorite = (Favorite) proto; |
| 212 | if (favorite.iconType == ICON_TYPE_BITMAP) { |
| 213 | writeImageData(favorite.icon, prefix + ".png"); |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | // save off the widget icon and preview bits in files for inspection |
| 218 | if (proto instanceof Widget) { |
| 219 | Widget widget = (Widget) proto; |
| 220 | if (widget.icon != null) { |
| 221 | writeImageData(widget.icon.data, prefix + "_icon.png"); |
| 222 | } |
| 223 | if (widget.preview != null) { |
| 224 | writeImageData(widget.preview.data, prefix + "_preview.png"); |
| 225 | } |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 226 | } |
| 227 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 228 | } |
| 229 | System.exit(0); |
| 230 | } |
| 231 | |
| 232 | // In logcat, backup data is base64 encoded, but in localtransport files it is raw |
| 233 | private static MessageNano decodeBackupData(byte[] payload, Class type, boolean fromLogs) |
| 234 | throws InstantiationException, IllegalAccessException { |
| 235 | MessageNano proto;// other types are wrapped in a checksum message |
| 236 | CheckedMessage wrapper = new CheckedMessage(); |
| 237 | try { |
| 238 | if (fromLogs) { |
| 239 | payload = DatatypeConverter.parseBase64Binary(new String(payload)); |
| 240 | } |
| 241 | MessageNano.mergeFrom(wrapper, payload); |
| 242 | } catch (InvalidProtocolBufferNanoException e) { |
| 243 | System.err.println("failed to parse wrapper: " + e); |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 244 | System.exit(1); |
| 245 | } |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 246 | |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 247 | CRC32 checksum = new CRC32(); |
| 248 | checksum.update(wrapper.payload); |
| 249 | if (wrapper.checksum != checksum.getValue()) { |
| 250 | System.err.println("wrapper checksum failed"); |
| 251 | System.exit(1); |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 252 | } |
| 253 | |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 254 | // decode the actual message |
| 255 | proto = (MessageNano) type.newInstance(); |
| 256 | try { |
| 257 | MessageNano.mergeFrom(proto, wrapper.payload); |
| 258 | } catch (InvalidProtocolBufferNanoException e) { |
| 259 | System.err.println("failed to parse proto: " + e); |
| 260 | System.exit(1); |
| 261 | } |
| 262 | return proto; |
| 263 | } |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 264 | |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 265 | // In logcat, keys are base64 encoded with no prefix. |
| 266 | // The localtransport adds a prefix and the base64 encodes the whole thing again. |
| 267 | private static Key decodeKey(byte[] payload, boolean fromLogs) { |
| 268 | Key key = new Key(); |
| 269 | try { |
| 270 | String encodedKey = new String(payload); |
| 271 | if (!fromLogs) { |
| 272 | byte[] rawKey = DatatypeConverter.parseBase64Binary(encodedKey); |
| 273 | if (rawKey[0] != 'L' || rawKey[1] != ':') { |
| 274 | System.err.println(encodedKey + " is not a launcher backup key."); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 275 | return null; |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 276 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 277 | encodedKey = new String(rawKey, 2, rawKey.length - 2); |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 278 | } |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 279 | byte[] keyProtoData = DatatypeConverter.parseBase64Binary(encodedKey); |
| 280 | key = Key.parseFrom(keyProtoData); |
| 281 | } catch (InvalidProtocolBufferNanoException protoException) { |
| 282 | System.err.println("failed to extract key from filename: " + protoException); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 283 | return null; |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 284 | } catch (IllegalArgumentException base64Exception) { |
| 285 | System.err.println("failed to extract key from filename: " + base64Exception); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 286 | return null; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 287 | } |
| 288 | |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 289 | // keys are self-checked |
| 290 | if (key.checksum != checkKey(key)) { |
| 291 | System.err.println("key ckecksum failed"); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 292 | return null; |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 293 | } |
| 294 | return key; |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 295 | } |
| 296 | |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 297 | private static void writeImageData(byte[] data, String path) { |
| 298 | FileOutputStream iconFile = null; |
| 299 | try { |
| 300 | iconFile = new FileOutputStream(path); |
| 301 | iconFile.write(data); |
| 302 | System.err.println("wrote " + path); |
| 303 | } catch (IOException e) { |
| 304 | System.err.println("failed to write image file: " + e); |
| 305 | } finally { |
| 306 | if (iconFile != null) { |
| 307 | try { |
| 308 | iconFile.close(); |
| 309 | } catch (IOException e) { |
| 310 | System.err.println("failed to close the image file: " + e); |
| 311 | } |
| 312 | } |
| 313 | } |
| 314 | } |
| 315 | |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 316 | private static long checkKey(Key key) { |
| 317 | CRC32 checksum = new CRC32(); |
| 318 | checksum.update(key.type); |
| 319 | checksum.update((int) (key.id & 0xffff)); |
| 320 | checksum.update((int) ((key.id >> 32) & 0xffff)); |
| 321 | if (key.name != null && key.name.length() > 0) { |
| 322 | checksum.update(key.name.getBytes()); |
| 323 | } |
| 324 | return checksum.getValue(); |
| 325 | } |
| 326 | |
| 327 | private static void usage(String[] args) { |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 328 | System.err.println("launcher_protoutil [-x] [-S b] [-k|-f|-i|-s|-w] [filename]"); |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 329 | System.err.println("\t-k\tdecode a key"); |
| 330 | System.err.println("\t-f\tdecode a favorite"); |
| 331 | System.err.println("\t-i\tdecode a icon"); |
| 332 | System.err.println("\t-s\tdecode a screen"); |
| 333 | System.err.println("\t-w\tdecode a widget"); |
Chris Wren | f6a22ad | 2013-12-12 11:20:09 -0500 | [diff] [blame] | 334 | System.err.println("\t-S b\tskip b bytes"); |
| 335 | System.err.println("\t-x\textract image data to files"); |
Chris Wren | 8661761 | 2014-01-09 11:08:37 -0500 | [diff] [blame^] | 336 | System.err.println("\t-v\tprint key type data, as well as payload"); |
Chris Wren | 2fd3182 | 2013-12-18 14:11:40 -0500 | [diff] [blame] | 337 | System.err.println("\t-l\texpect data from logcat, instead of the local transport"); |
Chris Wren | 2b6c21d | 2013-10-02 14:16:04 -0400 | [diff] [blame] | 338 | System.err.println("\tfilename\tread from filename, not stdin"); |
| 339 | System.exit(1); |
| 340 | } |
| 341 | } |