简体   繁体   English

来自file:///android_asset/webkit/android-weberror.png的不安全内容

[英]insecure content from file:///android_asset/webkit/android-weberror.png

I am getting the error mentioned in subject line while exceuting a webview with shared preferenes. 我在执行带有共享preferenes的webview时出现主题行中提到的错误。 I have posted the code and logcat as well. 我也张贴了代码和logcat。 Please advise as to where i might be going wrong? 请告知我哪里可能出问题了? I am basically trying to open a https site in webview and retrieving the id/pwd using shared preferences 我基本上是想在webview中打开一个https站点,并使用共享的首选项检索id / pwd

    package com.example.sharedpref;



    import android.app.Activity;
    import android.content.SharedPreferences;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.webkit.WebChromeClient;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.Toast;
    import com.example.sharedpref.R;

    public class MainActivity extends Activity implements OnClickListener {


        private Button mSaveButton;
        private Button mSaveButton1;
        private EditText mInputidText;
        private EditText mInputpwdText;
        private WebView mWebView;
        private WebChromeClient mWebchromeclient;
        private WebViewClient mWebViewClient;
        public static final String PREF_STRING = "https://kee.mahindrasatyam.com/_layouts/mobile/mobilesearch.aspx";


        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            mWebView = (WebView) findViewById(R.id.webView1);
            mInputidText = (EditText) findViewById(R.id.editText1);
            mInputpwdText = (EditText) findViewById(R.id.editText2);
            mSaveButton = (Button) findViewById(R.id.button1);
            mSaveButton1 = (Button) findViewById(R.id.button2);
              mSaveButton.setOnClickListener(this);
              mSaveButton1.setOnClickListener(this);

        }

        @Override
        public void onClick(View v) {
            int id = v.getId();
            String message = "";

                if (id == R.id.button1){
                    SharedPreferences sp=getPreferences(MODE_PRIVATE);
                SharedPreferences.Editor Ed=sp.edit();
                Ed.putString("Unm", mInputidText.toString() );              
                Ed.putString("Psw",mInputpwdText.toString());   
                Ed.commit();
                    message="Text Saved in Preferences";

                    }


                else   if (id == R.id.button2){

                    try{
                    SharedPreferences sp1=getPreferences(MODE_PRIVATE);;



                mWebView = new WebView(this) {

                };
                mWebchromeclient = new WebChromeClient() {

                };

                mWebView.setWebChromeClient(mWebchromeclient);
                mWebView.setWebViewClient(mWebViewClient);
                setContentView(mWebView);

                /* Load the last saved preference. */
                mWebView.loadUrl(sp1.getString(PREF_STRING, "https://kee.mahindrasatyam.com/_layouts/mobile/mobilesearch.aspx"));            }

                catch (Exception e) {
                  Log.i(" connect secon button exception:",""+PREF_STRING);
                        e.printStackTrace();
                }

            Toast.makeText(this, message, Toast.LENGTH_LONG).show();
        }



      }}



Logcat:
08-17 12:32:03.854: D/TextLayoutCache(16359): Using debug level: 0 - Debug Enabled: 0
08-17 12:32:04.144: D/libEGL(16359): loaded /system/lib/egl/libGLES_android.so
08-17 12:32:04.164: D/libEGL(16359): loaded /system/lib/egl/libEGL_adreno200.so
08-17 12:32:04.184: D/libEGL(16359): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
08-17 12:32:04.194: D/libEGL(16359): loaded /system/lib/egl/libGLESv2_adreno200.so
08-17 12:32:04.324: D/OpenGLRenderer(16359): Enabling debug mode 0
08-17 12:32:07.124: D/chromium(16359): Unknown chromium error: -400
08-17 12:32:07.204: D/dalvikvm(16359): GC_CONCURRENT freed 249K, 4% free 9001K/9287K, paused 3ms+7ms
08-17 12:32:07.274: W/Web Console(16359): The page at https://kee.mahindrasatyam.com/_layouts/mobile/mobilesearch.aspx displayed insecure content from file:///android_asset/webkit/android-weberror.png.
08-17 12:32:07.274: W/Web Console(16359):  at null:1
08-17 12:32:24.564: D/OpenGLRenderer(16359): Flushing caches (mode 1)
08-17 12:32:24.564: D/OpenGLRenderer(16359): Flushing caches (mode 0)
08-17 12:32:24.894: W/IInputConnectionWrapper(16359): showStatusIcon on inactive InputConnection
08-17 12:37:14.944: D/TextLayoutCache(16676): Using debug level: 0 - Debug Enabled: 0
08-17 12:37:15.004: D/libEGL(16676): loaded /system/lib/egl/libGLES_android.so
08-17 12:37:15.014: D/libEGL(16676): loaded /system/lib/egl/libEGL_adreno200.so
08-17 12:37:15.014: D/libEGL(16676): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
08-17 12:37:15.014: D/libEGL(16676): loaded /system/lib/egl/libGLESv2_adreno200.so
08-17 12:37:15.084: D/OpenGLRenderer(16676): Enabling debug mode 0
08-17 12:37:28.584: D/dalvikvm(16676): GC_CONCURRENT freed 270K, 4% free 9003K/9351K, paused 9ms+8ms
08-17 12:37:33.124: W/Web Console(16676): The page at https://kee.mahindrasatyam.com/_layouts/mobile/mobilesearch.aspx displayed insecure content from file:///android_asset/webkit/android-weberror.png.
08-17 12:37:33.124: W/Web Console(16676):  at null:1
08-17 12:38:59.484: D/OpenGLRenderer(16676): Flushing caches (mode 1)
08-17 12:39:00.354: D/OpenGLRenderer(16676): Flushing caches (mode 0)
08-17 12:40:48.764: D/OpenGLRenderer(16676): Flushing caches (mode 1)
08-17 12:40:48.854: D/OpenGLRenderer(16676): Flushing caches (mode 0)
08-17 12:40:49.504: W/IInputConnectionWrapper(16676): showStatusIcon on inactive InputConnection

Mixed content warning . 混合内容警告 Chromium warns on because the content is not loaded with https like the aspx page. Chromium发出警告,因为内容未像aspx页面那样通过https加载。 Chromium doesn't like the fact that you are loading mixed-content on a page accessed using https. Chromium不喜欢您在使用https访问的页面上加载混合内容的事实。 It's security warning since it could undermine the security of the page. 这是安全警告,因为它可能会破坏页面的安全性。 Is your image not displaying or being blocked? 您的图像没有显示或被遮挡吗? See this similar question SSL: Why does Chrome report mixed content? 看到类似的问题SSL:为什么Chrome会报告混合内容? (Drupal 6) . (Drupal 6) The question specfically mentions Chrome which is also based on chromium. 这个问题专门提到了铬,铬也是基于铬的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM