[java] update android.jar version to 23

Summary: Need to upgrade in order to specify some taint properties on a more recent `WebView` API.

Reviewed By: cristianoc

Differential Revision: D4382590

fbshipit-source-id: 0925742
master
Sam Blackshear 8 years ago committed by Facebook Github Bot
parent 9c48178e4a
commit 504735e548

@ -1,6 +1,6 @@
prebuilt_jar(
name = 'android',
binary_jar = 'android-19.jar',
binary_jar = 'android-23.jar',
visibility = [
'PUBLIC'
]

@ -8,9 +8,11 @@
ROOT_DIR = ../../..
include $(ROOT_DIR)/Makefile.config
ANDROID_JAR = $(LIB_DIR)/java/android/android-19.jar
JACKSON_JAR = $(DEPENDENCIES_DIR)/java/jackson/jackson-2.2.3.jar
ANDROID_JAR = $(LIB_DIR)/java/android/android-23.jar
GUAVA_JAR = $(DEPENDENCIES_DIR)/java/guava/guava-10.0.1-fork.jar
INFER_ANNOTATIONS_JAR = $(ANNOTATIONS_DIR)/annotations.jar
JACKSON_JAR = $(DEPENDENCIES_DIR)/java/jackson/jackson-2.2.3.jar
JSR_305_JAR = $(DEPENDENCIES_DIR)/java/jsr-305/jsr305.jar
MODELS_OUT = models
INFER_REPORT = $(MODELS_OUT)/infer/report.json
@ -21,6 +23,8 @@ JAVA_MODELS_SOURCES = $(shell find src -name "*.java")
JAVA_SOURCES = $(JAVA_BUILTINS_SOURCES) $(JAVA_MODELS_SOURCES)
MODELS_CLASSPATH = $(ANDROID_JAR):$(GUAVA_JAR):$(JACKSON_JAR):$(JSR_305_JAR):$(INFER_ANNOTATIONS_JAR)
all: $(MODELS_JAR)
clean:
@ -28,12 +32,12 @@ clean:
@rm -f $(MODELS_JAR)
@rm -f $(JAVA_MODELS_JAR)
$(INFER_REPORT): $(ANDROID_JAR) $(JACKSON_JAR) $(JAVA_DEPS) $(INFER_ANNOTATIONS_JAR) $(JAVA_SOURCES)
$(INFER_REPORT): $(ANDROID_JAR) $(GUAVA_JAR) $(JACKSON_JAR) $(JSR_305_JAR) $(INFER_ANNOTATIONS_JAR) $(JAVA_DEPS) $(JAVA_SOURCES)
@rm -fr $(MODELS_OUT)
mkdir -p $(MODELS_OUT)
@rm -f $(JAVA_MODELS_JAR)
$(call silent_on_success,\
$(INFER_BIN) --jobs 1 --buck --models-mode -- javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(JACKSON_JAR):$(INFER_ANNOTATIONS_JAR) $(JAVA_SOURCES))
$(INFER_BIN) --jobs 1 --buck --models-mode -- javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) $(JAVA_SOURCES))
$(MODELS_JAR): $(INFER_REPORT)
cd $(MODELS_OUT); jar cf ../$(MODELS_JAR) *

@ -8,7 +8,7 @@
<mkdir dir="classes"/>
<javac srcdir="src" destdir="classes" includeantruntime="false">
<bootclasspath>
<pathelement location="android/android-19.jar"/>
<pathelement location="android/android-23.jar"/>
</bootclasspath>
<classpath>
<pathelement location="../../../dependencies/java/jackson/jackson-2.2.3.jar"/>

@ -9,7 +9,6 @@
package com.fasterxml.jackson.core;
import com.android.internal.util.FileRotator.Reader;
import com.fasterxml.jackson.core.json.PackageVersion;
import com.fasterxml.jackson.core.json.UTF8StreamJsonParser;
@ -17,12 +16,12 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.URL;
public class JsonFactory
implements Versioned, java.io.Serializable {
@Override
public Version version() {
return PackageVersion.VERSION;

@ -8,10 +8,14 @@
<mkdir dir="ant_out"/>
<javac srcdir="src/infer" destdir="ant_out" includeantruntime="false">
<classpath>
<pathelement location="../../../lib/java/android/android-19.jar"/>
<pathelement location="../../../../dependencies/java/jackson/jackson-2.2.3.jar"/>
<pathelement location="../../../lib/java/android/android-23.jar"/>
<pathelement location="../../../lib/java/android/support/v4/android-support-v4.jar"/>
<pathelement location="../../../lib/java/models.jar"/>
<pathelement location="../../../annotations//annotations.jar"/>
<pathelement location="../../../../dependencies/java/guava/guava-10.0.1-fork.jar"/>
<pathelement location="../../../../dependencies/java/jackson/jackson-2.2.3.jar"/>
<pathelement location="../../../../dependencies/java/jsr-305/jsr305.jar"/>
<pathelement location="../../../annotations/annotations.jar"/>
</classpath>
</javac>
</target>

@ -151,6 +151,7 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.objectOutputStre
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpURLConnectionNotDisconnected(), 7, RESOURCE_LEAK, [start of procedure openHttpURLConnectionNotDisconnected()]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpsURLConnectionNotDisconnected(), 3, RESOURCE_LEAK, [start of procedure openHttpsURLConnectionNotDisconnected()]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 5, RESOURCE_LEAK, [start of procedure parseFromInputStreamAndLeak(...)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromStringAndNotClose(JsonFactory), 4, RESOURCE_LEAK, [start of procedure parseFromStringAndNotClose(...)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedInputStreamNotClosedAfterRead(PipedOutputStream), 6, RESOURCE_LEAK, [start of procedure pipedInputStreamNotClosedAfterRead(...),exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedOutputStreamNotClosedAfterWrite(), 7, RESOURCE_LEAK, [start of procedure pipedOutputStreamNotClosedAfterWrite(),exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.scannerNotClosed(), 1, RESOURCE_LEAK, [start of procedure scannerNotClosed()]

@ -151,6 +151,7 @@ infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.obje
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpURLConnectionNotDisconnected(), 7, RESOURCE_LEAK, [start of procedure openHttpURLConnectionNotDisconnected()]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpsURLConnectionNotDisconnected(), 3, RESOURCE_LEAK, [start of procedure openHttpsURLConnectionNotDisconnected()]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 5, RESOURCE_LEAK, [start of procedure parseFromInputStreamAndLeak(...)]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromStringAndNotClose(JsonFactory), 4, RESOURCE_LEAK, [start of procedure parseFromStringAndNotClose(...)]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedInputStreamNotClosedAfterRead(PipedOutputStream), 6, RESOURCE_LEAK, [start of procedure pipedInputStreamNotClosedAfterRead(...),exception java.io.IOException]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedOutputStreamNotClosedAfterWrite(), 7, RESOURCE_LEAK, [start of procedure pipedOutputStreamNotClosedAfterWrite(),exception java.io.IOException]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.scannerNotClosed(), 1, RESOURCE_LEAK, [start of procedure scannerNotClosed()]

@ -1 +1 @@
codetoanalyze/java/harness/BasicHarnessActivity.java, codetoanalyze.java.harness.BasicHarnessActivity.InferGeneratedHarness(), -1, NULL_DEREFERENCE, [start of procedure InferGeneratedHarness(),start of procedure onCreate(...),return from a call to void BasicHarnessActivity.onCreate(Bundle),start of procedure onPause(),return from a call to void BasicHarnessActivity.onPause(),start of procedure onDestroy()]
codetoanalyze/java/harness/BasicHarnessActivity.java, codetoanalyze.java.harness.BasicHarnessActivity.InferGeneratedHarness(), -1, NULL_DEREFERENCE, [start of procedure InferGeneratedHarness(),start of procedure onPause(),return from a call to void BasicHarnessActivity.onPause(),start of procedure onDestroy()]

@ -690,7 +690,7 @@ public class ResourceLeaks {
public void parseFromStringAndNotClose(JsonFactory factory) throws IOException {
UTF8StreamJsonParser parser = null;
try {
parser = (UTF8StreamJsonParser) factory.createParser("[]");
parser = (UTF8StreamJsonParser) factory.createParser(new File("[]"));
Object o = parser.readValueAs(Object.class);
ignore(o);
} catch (Exception e) {

@ -262,7 +262,8 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.objectOutputStre
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpURLConnectionNotDisconnected(), 7, RESOURCE_LEAK, [start of procedure openHttpURLConnectionNotDisconnected()]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpsURLConnectionNotDisconnected(), 3, RESOURCE_LEAK, [start of procedure openHttpsURLConnectionNotDisconnected()]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 5, RESOURCE_LEAK, [start of procedure parseFromInputStreamAndLeak(...)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 10, NULL_TEST_AFTER_DEREFERENCE, [start of procedure parseFromInputStreamAndLeak(...),exception com.fasterxml.jackson.core.JsonParseException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 10, NULL_TEST_AFTER_DEREFERENCE, [start of procedure parseFromInputStreamAndLeak(...),exception java.io.IOException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromStringAndNotClose(JsonFactory), 4, RESOURCE_LEAK, [start of procedure parseFromStringAndNotClose(...)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedInputStreamClosed(PipedOutputStream), 4, RETURN_VALUE_IGNORED, [start of procedure pipedInputStreamClosed(...)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedInputStreamNotClosedAfterRead(PipedOutputStream), 4, RETURN_VALUE_IGNORED, [start of procedure pipedInputStreamNotClosedAfterRead(...)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedInputStreamNotClosedAfterRead(PipedOutputStream), 6, RESOURCE_LEAK, [start of procedure pipedInputStreamNotClosedAfterRead(...),exception java.io.IOException]

@ -10,7 +10,12 @@
package codetoanalyze.java.quandary;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebMessage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebChromeClient;
@ -27,6 +32,7 @@ public class WebViews {
webview.loadData(stringSource, "", "");
webview.loadDataWithBaseURL("", stringSource, "", "", "");
webview.loadUrl(stringSource); // should have 5 reports
webview.postWebMessage(null, (Uri) InferTaint.inferSecretSource());
}
void callWebviewClientSinks(WebView webview, WebViewClient client) {

@ -179,6 +179,7 @@ codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSinks(WebVie
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSinks(WebView), 5, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to void WebView.loadData(String,String,String)]
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSinks(WebView), 6, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to void WebView.loadDataWithBaseURL(String,String,String,String,String)]
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSinks(WebView), 7, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to void WebView.loadUrl(String)]
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSinks(WebView), 8, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to void WebView.postWebMessage(WebMessage,Uri)]
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSubclassSinks(WebViews$MyWebView,WebViews$MyWebViewClient,WebViews$MyWebChromeClient), 4, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to void WebView.evaluateJavascript(String,ValueCallback)]
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSubclassSinks(WebViews$MyWebView,WebViews$MyWebViewClient,WebViews$MyWebChromeClient), 5, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to void WebViewClient.onLoadResource(WebView,String)]
codetoanalyze/java/quandary/WebViews.java, void WebViews.callWebviewSubclassSinks(WebViews$MyWebView,WebViews$MyWebViewClient,WebViews$MyWebChromeClient), 6, QUANDARY_TAINT_ERROR, [return from Object InferTaint.inferSecretSource(),call to boolean WebChromeClient.onJsAlert(WebView,String,String,JsResult)]

@ -9,12 +9,13 @@ ROOT_DIR = $(TESTS_DIR)/../..
include $(ROOT_DIR)/Makefile.config
ANDROID19 = $(JAVA_LIB_DIR)/android/android-19.jar
ANDROID = $(JAVA_LIB_DIR)/android/android-23.jar
ANDROIDSUPPORT = $(DEPENDENCIES_DIR)/java/android/support/v4/android-support-v4.jar
ANNOTATIONS = $(ANNOTATIONS_DIR)/annotations.jar
BUTTERKNIFE = $(DEPENDENCIES_DIR)/java/butterknife/butterknife-7.0.1.jar
GUAVA = $(DEPENDENCIES_DIR)/java/guava/guava-10.0.1-fork.jar
JACKSON = $(DEPENDENCIES_DIR)/java/jackson/jackson-2.2.3.jar
JSR305 = $(DEPENDENCIES_DIR)/java/jsr-305/jsr305.jar
INJECT = $(DEPENDENCIES_DIR)/java/jsr-330/javax.inject.jar
CLASSPATH=$(ANDROID19):$(ANDROIDSUPPORT):$(ANNOTATIONS):$(BUTTERKNIFE):$(JACKSON):$(JSR305):$(INJECT):$(JAVA_BUILTINS_DIR):.
CLASSPATH=$(ANDROID):$(ANDROIDSUPPORT):$(ANNOTATIONS):$(BUTTERKNIFE):$(GUAVA):$(JACKSON):$(JSR305):$(INJECT):$(JAVA_BUILTINS_DIR):.

Loading…
Cancel
Save