içerir.squareup ait xx google okhttp kullanıyor bölüm
/**
* This implementation uses HttpEngine to send requests and receive responses. This class may use
* multiple HttpEngines to follow redirects, authentication retries, etc. to retrieve the final
* response body.
*
* <h3>What does 'connected' mean?</h3> This class inherits a {@code connected} field from the
* superclass. That field is <strong>not</strong> used to indicate whether this URLConnection is
* currently connected. Instead, it indicates whether a connection has ever been attempted. Once a
* connection has been attempted, certain properties (request header fields, request method, etc.)
* are immutable.
*/
public class HttpURLConnectionImpl extends HttpURLConnection {
private String defaultUserAgent() {
String agent = System.getProperty("http.agent");
return agent != null ? Util.toHumanReadableAscii(agent) : Version.userAgent();
}
https://github.com/square/okhttp/blob/master/okhttp-urlconnection/src/main/java/okhttp3/internal/huc/HttpURLConnectionImpl.java
http://square.github.io/okhttp/
herşey cihaza göre değişir - Ne os version u api gelişmektedir çünkü u yansımaları kullanabilirsiniz ama u hangi alanda bilmesine gerek kullanarak
https://github.com/square/okhttp/blob/master/CHANGELOG.md
d karşılaştırmak için belirli API olduğunu görmek iffrent API sürümleri kullanın:
yoluyla yansımaları
HttpURLConnection connection = (HttpURLConnection) new URL("http://google.com")
.openConnection();
Method method = connection.getClass().getDeclaredMethod("defaultUserAgent");
method.setAccessible(true);
String okEngineVersion = (String) method.invoke(connection, new Object[]{});
aynı
String okEngineVersion = System.getProperty("http.agent");
olarak:
https://android.googlesource.com/platform/external/okhttp/
u
System.getProperty("http.agent");
düzenlemek başında deneyebilirsiniz 10 ve u rahatsız istiyorsanız:
- her sınıf tedavi edilir aynı şekilde -> eşittir olarak (hayır sürüm - u sadece sihirli minör majör numarası kontrol edebilirsiniz - sınıfından java derleyicisi sürümünü) ait
- manifestosunu/sistem/çerçeve/okhttp.jar versiyon özelliklerini içermiyor
u sonra okhttp.internal.Version sınıfını istiyorsanız:
File file = new File("/system/framework/okhttp.jar");
// using javaxt-core lib
Jar jar = new Jar(file);
jar.getVersion();
// load dex
DexFile dexfile = DexFile.loadDex(file.getAbsolutePath(),
File.createTempFile("opt", "dex", _context.getCacheDir()).getPath(), 0);
Enumeration<String> dexEntries = dexfile.entries();
ClassLoader systemClassLoader = DexClassLoader.getSystemClassLoader();
while (dexEntries.hasMoreElements()) {
String className = dexEntries.nextElement();
Class<?> aClass = systemClassLoader.loadClass(className);
}
Sonuç: Eğer uygulamanızın sürümünü biliyorum
kazasında
raporlarını anında kütüphane değişiklikleri tesliminden itibaren kütüphane ve yük sınıfları kendi versiyonunu uygulamanın çökmesine önlemek veya apk'de ile derlemek istiyorsanız ve varsayarak Eğer var En azından bazı basit sürüm kontrolü yerinde, uygulamanızın hangi sürümünün okhttp ile gönderildiğini bilmelisiniz. – laalto
Uygulamam açıkça "okhttp" ye bağlı değil. – CAMOBAP