private HttpRequest applyMultipartDataTo( HttpRequest paramHttpRequest, AppRequestData paramAppRequestData) { HttpRequest localHttpRequest = paramHttpRequest .part("app[identifier]", paramAppRequestData.appId) .part("app[name]", paramAppRequestData.name) .part("app[display_version]", paramAppRequestData.displayVersion) .part("app[build_version]", paramAppRequestData.buildVersion) .part("app[source]", Integer.valueOf(paramAppRequestData.source)) .part("app[minimum_sdk_version]", paramAppRequestData.minSdkVersion) .part("app[built_sdk_version]", paramAppRequestData.builtSdkVersion); if (!CommonUtils.isNullOrEmpty(paramAppRequestData.instanceIdentifier)) { localHttpRequest.part("app[instance_identifier]", paramAppRequestData.instanceIdentifier); } Object localObject; if (paramAppRequestData.icon != null) { localObject = null; paramHttpRequest = null; } try { InputStream localInputStream = this.kit .getContext() .getResources() .openRawResource(paramAppRequestData.icon.iconResourceId); paramHttpRequest = localInputStream; localObject = localInputStream; localHttpRequest .part("app[icon][hash]", paramAppRequestData.icon.hash) .part("app[icon][data]", "icon.png", "application/octet-stream", localInputStream) .part("app[icon][width]", Integer.valueOf(paramAppRequestData.icon.width)) .part("app[icon][height]", Integer.valueOf(paramAppRequestData.icon.height)); CommonUtils.closeOrLog(localInputStream, "Failed to close app icon InputStream."); } catch (Resources.NotFoundException localNotFoundException) { for (; ; ) { localObject = paramHttpRequest; Fabric.getLogger() .e( "Fabric", "Failed to find app icon with resource ID: " + paramAppRequestData.icon.iconResourceId, localNotFoundException); CommonUtils.closeOrLog(paramHttpRequest, "Failed to close app icon InputStream."); } } finally { CommonUtils.closeOrLog((Closeable) localObject, "Failed to close app icon InputStream."); } if (paramAppRequestData.sdkKits != null) { paramHttpRequest = paramAppRequestData.sdkKits.iterator(); while (paramHttpRequest.hasNext()) { paramAppRequestData = (KitInfo) paramHttpRequest.next(); localHttpRequest.part( getKitVersionKey(paramAppRequestData), paramAppRequestData.getVersion()); localHttpRequest.part( getKitBuildTypeKey(paramAppRequestData), paramAppRequestData.getBuildType()); } } return localHttpRequest; }
private KitInfo loadKitInfo(ZipEntry paramZipEntry, ZipFile paramZipFile) { Object localObject1 = null; ZipFile localZipFile = null; try { paramZipFile = paramZipFile.getInputStream(paramZipEntry); localZipFile = paramZipFile; localObject1 = paramZipFile; localObject3 = new Properties(); localZipFile = paramZipFile; localObject1 = paramZipFile; ((Properties) localObject3).load(paramZipFile); localZipFile = paramZipFile; localObject1 = paramZipFile; localObject2 = ((Properties) localObject3).getProperty("fabric-identifier"); localZipFile = paramZipFile; localObject1 = paramZipFile; str = ((Properties) localObject3).getProperty("fabric-version"); localZipFile = paramZipFile; localObject1 = paramZipFile; localObject3 = ((Properties) localObject3).getProperty("fabric-build-type"); localZipFile = paramZipFile; localObject1 = paramZipFile; if (!TextUtils.isEmpty((CharSequence) localObject2)) { localZipFile = paramZipFile; localObject1 = paramZipFile; if (!TextUtils.isEmpty(str)) {} } else { localZipFile = paramZipFile; localObject1 = paramZipFile; throw new IllegalStateException("Invalid format of fabric file," + paramZipEntry.getName()); } } catch (IOException paramZipFile) { Object localObject3; String str; localObject1 = localZipFile; Fabric.getLogger() .e( "Fabric", "Error when parsing fabric properties " + paramZipEntry.getName(), paramZipFile); CommonUtils.closeQuietly(localZipFile); return null; localZipFile = paramZipFile; localObject1 = paramZipFile; Object localObject2 = new KitInfo((String) localObject2, str, (String) localObject3); CommonUtils.closeQuietly(paramZipFile); return (KitInfo) localObject2; } finally { CommonUtils.closeQuietly((Closeable) localObject1); } }
public void run() { if (CommonUtils.n(i.f(b).B())) { c.h().a("Fabric", "Attempting to send crash report at time of crash..."); Object localObject = q.a().b(); localObject = i.f(b).a((s) localObject); if (localObject != null) { new v((k) localObject).a(new x(a, i.i())); } } }
private HttpRequest b(HttpRequest httprequest, adk adk1) { Object obj; HttpRequest httprequest1; httprequest1 = httprequest.e("app[identifier]", adk1.b).e("app[name]", adk1.f).e("app[display_version]", adk1.c).e("app[build_version]", adk1.d).a("app[source]", Integer.valueOf(adk1.g)).e("app[minimum_sdk_version]", adk1.h).e("app[built_sdk_version]", adk1.i); if (!CommonUtils.c(adk1.e)) { httprequest1.e("app[instance_identifier]", adk1.e); } if (adk1.j == null) { break MISSING_BLOCK_LABEL_193; } obj = null; httprequest = null; java.io.InputStream inputstream = kit.getContext().getResources().openRawResource(adk1.j.b); httprequest = inputstream; obj = inputstream; httprequest1.e("app[icon][hash]", adk1.j.a).a("app[icon][data]", "icon.png", "application/octet-stream", inputstream).a("app[icon][width]", Integer.valueOf(adk1.j.c)).a("app[icon][height]", Integer.valueOf(adk1.j.d)); CommonUtils.a(inputstream, "Failed to close app icon InputStream."); _L2: if (adk1.k != null) { for (httprequest = adk1.k.iterator(); httprequest.hasNext(); httprequest1.e(b(((aaf) (adk1))), adk1.c())) { adk1 = (aaf)httprequest.next(); httprequest1.e(a(adk1), adk1.b()); } } break MISSING_BLOCK_LABEL_321; android.content.res.Resources.NotFoundException notfoundexception; notfoundexception; obj = httprequest; zw.h().e("Fabric", (new StringBuilder()).append("Failed to find app icon with resource ID: ").append(adk1.j.b).toString(), notfoundexception); CommonUtils.a(httprequest, "Failed to close app icon InputStream."); if (true) goto _L2; else goto _L1
@Test public void testDeserialization() throws IOException { JsonReader reader = null; try { reader = new JsonReader( new InputStreamReader(testResources.getAsStream("model_tweetentities.json"))); final TweetEntities tweetEntities = gson.fromJson(reader, TweetEntities.class); // We simply assert that we parsed it successfully and rely on our other unit tests to // verify parsing of the individual objects. assertEquals(EXPECTED_URLS_SIZE, tweetEntities.urls.size()); assertEquals(EXPECTED_USER_MENTIONS_SIZE, tweetEntities.userMentions.size()); assertEquals(EXPECTED_MEDIA_SIZE, tweetEntities.media.size()); assertEquals(EXPECTED_HASHTAGS_SIZE, tweetEntities.hashtags.size()); } finally { CommonUtils.closeQuietly(reader); } }
private void setupCallbackWrapperTest( String responseStr, Callback<OAuthResponse> authResponseCallback) throws IOException { final Callback<Response> callbackWrapper = service.getCallbackWrapper(authResponseCallback); final TypedInput mockValue = mock(TypedInput.class); final Response mockResponse = new Response( "url", HttpURLConnection.HTTP_OK, "reason", new ArrayList<retrofit.client.Header>(), mockValue); InputStream inputStream = null; try { inputStream = new ByteArrayInputStream(responseStr.getBytes("UTF-8")); when(mockValue.in()).thenReturn(inputStream); callbackWrapper.success(new Result<>(mockResponse, mockResponse)); } finally { CommonUtils.closeQuietly(inputStream); } }
String m428g() { return CommonUtils.m9863b(m402B(), "com.crashlytics.ApiEndpoint"); }
private boolean isLoggingEnabled() { return CommonUtils.a(context, "com.crashlytics.CollectCustomLogs", true); }
String getOverridenSpiEndpoint() { return CommonUtils.getStringsFileValue(this.getContext(), "com.crashlytics.ApiEndpoint"); }