Android Dex分包—Gradle方式

上篇文章講到了ant方式進(jìn)行dex分包《Android Dex分包》,本篇文章再來看一下采用gradle方式進(jìn)行dex分包的實(shí)現(xiàn)。

dex分包的gradle方式實(shí)現(xiàn)

我們用同樣的demo工程采用gradle進(jìn)行multidex分包測試。由于本人的AS已經(jīng)升到2.3.1版本匣掸,對應(yīng)的gradle版本為2.3.1,gradle插件版本升到了3.3,而gradle插件3.3版本要求buildToolsVersion版本為25及以上晰骑,而buildTools 25又要求jdk版本大于等于52,即jdk1.8绊序,所以需要將android studio切換到j(luò)dk1.8硕舆,需要自行下載jdk1.8并配置好環(huán)境即可,build.gradle中不需要配置

android studio配置jdk1.8骤公,網(wǎng)上有些教程推薦直接在build.gradle中配置即可抚官,如果是在build.gradle中指定了用jdk1.8來編譯

 compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

會編譯失敗,報如下錯誤

 * What went wrong:
A problem occurred configuring project ':app'.
> Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.

要求使用Jack編譯器來支持java8特性阶捆,或者移除sourceCompatibility直接編譯凌节。

如果要使用Jack編譯器,則需要在build.gradle添加如下支持

jackOptions {
    enabled true
}

關(guān)于Jack編譯器趁猴,可參考《Android 新一代編譯 toolchain Jack & Jill 簡介》一文

Jack 是 Java Android Compiler Kit 的縮寫刊咳,它可以將 Java 代碼直接編譯為 Dalvik 字節(jié)碼彪见,并負(fù)責(zé) Minification, Obfuscation, Repackaging, Multidexing, Incremental compilation儡司。它試圖取代 javac/dx/proguard/jarjar/multidex 庫等工具

使用Jack編譯器來編譯之后,可以正常打包構(gòu)建余指,并且也進(jìn)行了mulitdex處理捕犬,但是dexOptions中的參數(shù)都未生效,究其原因就是由于采用了Jack編譯器來執(zhí)行編譯操作酵镜,不同與原來的 javac+dx編譯過程碉碉,二者區(qū)別如下:

//javac+dx編譯過程
javac (.java –> .class) –> dx (.class –> .dex)
//jack編譯過程
Jack (.java –> .jack –> .dex)

Jack是將java源碼編譯城.jack文件再轉(zhuǎn)化為.dex文件,不再執(zhí)行dx操作淮韭,所以配置的dexOptions沒有生效

本來google推出Jack 編譯器是準(zhǔn)備取代javac+dx的編譯方式垢粮,但是由于Jack在支持基本編譯功能之外的其他功能上存在一定的局限,所以在今年3月靠粪,Google宣布放棄Jack蜡吧,重新采用javac+dx的方式在Android里支持Java 8毫蚓。

所以我們這里沒有采用這種編譯方式,沒有在gradler腳本中配置jdk1.8昔善,而是直接在系統(tǒng)變量中更改編譯環(huán)境為jdk1.8

classesdex.png

demo中build.gradle腳本如下

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "25.0.0"

    defaultConfig {

        applicationId "com.example.multidextest"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        multiDexEnabled true

//這里不采用jack編譯方式
//        jackOptions {
//            enabled true
//        }
    }
    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

//    compileOptions {
//        sourceCompatibility 1.8
//        targetCompatibility 1.8
//    }

    dexOptions {
        javaMaxHeapSize "1g"
        preDexLibraries = false
        additionalParameters = [    //配置multidex參數(shù)
                                '--multi-dex',//多dex分包
                                '--set-max-idx-number=30000',//每個包內(nèi)方法數(shù)上限
                                '--main-dex-list='+projectDir+'/main-dex-rule', //打包到主classes.dex的文件列表
                                '--minimal-main-dex'
        ]
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    //multidex支持依賴
    compile 'com.android.support:multidex:1.0.0'
    testCompile 'junit:junit:4.12'
}

main-dex-rule文件內(nèi)容如下:

com/example/multidextest/MainActivity$1.class
com/example/multidextest/HelperOne.class
com/example/multidextest/MainActivity.class
com/example/multidextest/ApplicationLoader.class

執(zhí)行g(shù)radle命令后元潘,得到構(gòu)建出的apk文件,通過as可以看到已經(jīng)包含了多個dex

主dex中包含指定的類文件


classesdex.png

從dex中包含其他的未打到主dex中的類和其他依賴的jar包等

classes2dex.png

關(guān)于main-dex-rule文件的自動生成方式君仆,可以參考
可參考《Android傻瓜式分包插件》或者《android multidex異步加載》

dex文件的加載

上篇文章已經(jīng)提到翩概,apk初次安裝啟動的時候只會對主dex進(jìn)行優(yōu)化加載操作,而從dex文件需要在app啟動時手動加載返咱,AS中可以通過引入multidex包來支持從dex的加載钥庇,有三種方式,如下:

1.manifest文件中指定Application為MultiDexApplication洛姑,對于一般不需要在application中執(zhí)行初始化操作的app可以采用這種

<application
        android:name="android.support.multidex.MultiDexApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        ……>

2.自定義Application并繼承MultiDexApplication

public class MyApplication extends MultiDexApplication{
        ……
}

3.重寫Application的attachBaseContext方法

public class MyApplication extends Application{

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}

方式一二相同上沐,先來看方式二的實(shí)現(xiàn)只需要將ApplicationLoader類由原先繼承自Application類修改為繼承MultiDexApplication即可,無需在onCreate中添加其他加載dex的代碼楞艾。所以可以猜想参咙,MultiDexApplication中肯定是執(zhí)行了加載從dex的相關(guān)操作。下面來看MultiDexApplication的源碼

public class MultiDexApplication extends Application {
    public MultiDexApplication() {
    }

    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}

可以看到MultiDexApplication 繼承Application硫眯, 并在attachBaseContext()中調(diào)用了MultiDex.install(this)蕴侧,所以上述幾種方式本質(zhì)是相同的。

MultiDex.install()方法如下:

 /**
     * Patches the application context class loader by appending extra dex files
     * loaded from the application apk. This method should be called in the
     * attachBaseContext of your {@link Application}, see
     * {@link MultiDexApplication} for more explanation and an example.
     *
     * @param context application context.
     * @throws RuntimeException if an error occurred preventing the classloader
     *         extension.
     */
    public static void install(Context context) {

        //省略若干代碼...

        try {
            ApplicationInfo applicationInfo = getApplicationInfo(context);
            if (applicationInfo == null) {
                // Looks like running on a test Context, so just return without patching.
                return;
            }

            synchronized (installedApk) {
                String apkPath = applicationInfo.sourceDir;
                
                //installedApk 為set集合两入,防止dex重復(fù)加載
                if (installedApk.contains(apkPath)) {
                    return;
                }
                installedApk.add(apkPath);

                //省略若干代碼...
                
                ClassLoader loader;
                try {
                    //此處獲取到的是PathClassLoader
                    loader = context.getClassLoader();
                } catch (RuntimeException e) {
                   //...
                    return;
                }
              
                //...

                try {
                  clearOldDexDir(context);
                } catch (Throwable t) {
                  Log.w(TAG, "Something went wrong when trying to clear old MultiDex extraction, "
                      + "continuing without cleaning.", t);
                }

                //data/data/<packagename>/code_cache/secondary-dexes"   即從dex優(yōu)化后的緩存的路徑
                File dexDir = new File(applicationInfo.dataDir, SECONDARY_FOLDER_NAME);
                //從apk中抽取dex文件并存到緩存目錄下净宵,保存為zip文件
                List<File> files = MultiDexExtractor.load(context, applicationInfo, dexDir, false);
                if (checkValidZipFiles(files)) {
                    //
                    installSecondaryDexes(loader, dexDir, files);
                } else {
                    Log.w(TAG, "Files were not valid zip files.  Forcing a reload.");
                    // Try again, but this time force a reload of the zip file.
                    files = MultiDexExtractor.load(context, applicationInfo, dexDir, true);

                    if (checkValidZipFiles(files)) {
                        installSecondaryDexes(loader, dexDir, files);
                    } else {
                        // Second time didn't work, give up
                        throw new RuntimeException("Zip files were not valid.");
                    }
                }
            }

        } catch (Exception e) {
            Log.e(TAG, "Multidex installation failure", e);
            throw new RuntimeException("Multi dex installation failed (" + e.getMessage() + ").");
        }
        Log.i(TAG, "install done");
    }

重點(diǎn)關(guān)注MultiDexExtractor.load(context, applicationInfo, dexDir, false) 從apk中抽取出從dex,

該方法有四個參數(shù)
context 上下文
applicationInfo 應(yīng)用信息裹纳,用于獲取apk文件
dexDir dex文件優(yōu)化后的緩存路徑
forceReload 是否強(qiáng)制重新從apk文件中抽取dex

 /**
     * Extracts application secondary dexes into files in the application data
     * directory.
     *
     * @return a list of files that were created. The list may be empty if there
     *         are no secondary dex files.
     * @throws IOException if encounters a problem while reading or writing
     *         secondary dex files
     */
    static List<File> load(Context context, ApplicationInfo applicationInfo, File dexDir,
            boolean forceReload) throws IOException {
        Log.i(TAG, "MultiDexExtractor.load(" + applicationInfo.sourceDir + ", " + forceReload + ")");
        final File sourceApk = new File(applicationInfo.sourceDir);

        //首先進(jìn)行crc校驗(yàn)
        long currentCrc = getZipCrc(sourceApk);

        List<File> files;
        if (!forceReload && !isModified(context, sourceApk, currentCrc)) {
            try {
                  //已經(jīng)從apk中抽取出dex文件并存到緩存目錄中择葡,則直接返回zip文件list
                files = loadExistingExtractions(context, sourceApk, dexDir);
            } catch (IOException ioe) {
                Log.w(TAG, "Failed to reload existing extracted secondary dex files,"
                        + " falling back to fresh extraction", ioe);
                files = performExtractions(sourceApk, dexDir);
                putStoredApkInfo(context, getTimeStamp(sourceApk), currentCrc, files.size() + 1);

            }
        } else {
            Log.i(TAG, "Detected that extraction must be performed.");
            //從apk中復(fù)制dex文件到緩存目錄
            files = performExtractions(sourceApk, dexDir);
            //保存時間戳、crc剃氧、dex數(shù)量等信息到sp
            putStoredApkInfo(context, getTimeStamp(sourceApk), currentCrc, files.size() + 1);
        }

        Log.i(TAG, "load found " + files.size() + " secondary dex files");
        return files;
    }

forceReload為false并且已經(jīng)從apk中抽取過dex文件則直接調(diào)用loadExistingExtractions 返回dex文件的zip列表

  private static List<File> loadExistingExtractions(Context context, File sourceApk, File dexDir)
            throws IOException {
        Log.i(TAG, "loading existing secondary dex files");

        //dex文件的前綴 敏储,即data/data/packageName/code_cache/secondary-dexes/data/data/apkName.apk.classes
        final String extractedFilePrefix = sourceApk.getName() + EXTRACTED_NAME_EXT;
        //獲取dex數(shù)目
        int totalDexNumber = getMultiDexPreferences(context).getInt(KEY_DEX_NUMBER, 1);
        final List<File> files = new ArrayList<File>(totalDexNumber);

        //遍歷除主dex外的其他dex
        for (int secondaryNumber = 2; secondaryNumber <= totalDexNumber; secondaryNumber++) {
             //文件名為 data/data/packageName/code_cache/secondary-dexes/data/data/apkName.apk.classes*.zip
            String fileName = extractedFilePrefix + secondaryNumber + EXTRACTED_SUFFIX;
            //以zip文件形式返回
            File extractedFile = new File(dexDir, fileName);
            if (extractedFile.isFile()) {
                //添加到list中并返回
                files.add(extractedFile);
                if (!verifyZipFile(extractedFile)) {
                    Log.i(TAG, "Invalid zip file: " + extractedFile);
                    throw new IOException("Invalid ZIP file.");
                }
            } else {
                throw new IOException("Missing extracted secondary dex file '" +
                        extractedFile.getPath() + "'");
            }
        }

        return files;
    }

否則調(diào)用performExtractions()方法從apk中抽取dex文件

private static List<File> performExtractions(File sourceApk, File dexDir)
            throws IOException {

        final String extractedFilePrefix = sourceApk.getName() + EXTRACTED_NAME_EXT;

        // Ensure that whatever deletions happen in prepareDexDir only happen if the zip that
        // contains a secondary dex file in there is not consistent with the latest apk.  Otherwise,
        // multi-process race conditions can cause a crash loop where one process deletes the zip
        // while another had created it.
        prepareDexDir(dexDir, extractedFilePrefix);

        List<File> files = new ArrayList<File>();

        final ZipFile apk = new ZipFile(sourceApk);
        try {

            int secondaryNumber = 2;
            //獲取classes2.dex
            ZipEntry dexFile = apk.getEntry(DEX_PREFIX + secondaryNumber + DEX_SUFFIX);
            while (dexFile != null) {
                 //data/data/packageName/code_cache/secondary-dexes/data/data/apkName.apk.classes*.zip
                String fileName = extractedFilePrefix + secondaryNumber + EXTRACTED_SUFFIX;
                File extractedFile = new File(dexDir, fileName);
                //添加到list列表中
                files.add(extractedFile);

                Log.i(TAG, "Extraction is needed for file " + extractedFile);
                int numAttempts = 0;
                boolean isExtractionSuccessful = false;
                //最多重試3次
                while (numAttempts < MAX_EXTRACT_ATTEMPTS && !isExtractionSuccessful) {
                    numAttempts++;

                    // Create a zip file (extractedFile) containing only the secondary dex file
                    // (dexFile) from the apk.
                    //從apk中抽取classes*dex文件并重命名為zip文件保存到指定目錄
                    extract(apk, dexFile, extractedFile, extractedFilePrefix);

                    // Verify that the extracted file is indeed a zip file.
                    //判斷是否抽取成功
                    isExtractionSuccessful = verifyZipFile(extractedFile);

                    // Log the sha1 of the extracted zip file
                    Log.i(TAG, "Extraction " + (isExtractionSuccessful ? "success" : "failed") +
                            " - length " + extractedFile.getAbsolutePath() + ": " +
                            extractedFile.length());
                    if (!isExtractionSuccessful) {
                        // Delete the extracted file
                        extractedFile.delete();
                        if (extractedFile.exists()) {
                            Log.w(TAG, "Failed to delete corrupted secondary dex '" +
                                    extractedFile.getPath() + "'");
                        }
                    }
                }
                if (!isExtractionSuccessful) {
                    throw new IOException("Could not create zip file " +
                            extractedFile.getAbsolutePath() + " for secondary dex (" +
                            secondaryNumber + ")");
                }
                //自增以讀取下一個classes*.dex文件
                secondaryNumber++;
                dexFile = apk.getEntry(DEX_PREFIX + secondaryNumber + DEX_SUFFIX);
            }
        } finally {
            try {
                apk.close();
            } catch (IOException e) {
                Log.w(TAG, "Failed to close resource", e);
            }
        }

        return files;
}

抽取方法extract()

private static void extract(ZipFile apk, ZipEntry dexFile, File extractTo,
            String extractedFilePrefix) throws IOException, FileNotFoundException {

                //獲取classes*.dex 對應(yīng)輸入流
        InputStream in = apk.getInputStream(dexFile);
        ZipOutputStream out = null;
        //創(chuàng)建臨時文件
        File tmp = File.createTempFile(extractedFilePrefix, EXTRACTED_SUFFIX,
                extractTo.getParentFile());
        Log.i(TAG, "Extracting " + tmp.getPath());
        try {
            //輸出為zip文件,zip文件中包含classes.dex
            out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(tmp)));
            try {
                ZipEntry classesDex = new ZipEntry("classes.dex");
                // keep zip entry time since it is the criteria used by Dalvik
                classesDex.setTime(dexFile.getTime());
                out.putNextEntry(classesDex);

                byte[] buffer = new byte[BUFFER_SIZE];
                int length = in.read(buffer);
                while (length != -1) {
                    out.write(buffer, 0, length);
                    length = in.read(buffer);
                }
                out.closeEntry();
            } finally {
                out.close();
            }
            Log.i(TAG, "Renaming to " + extractTo.getPath());
            if (!tmp.renameTo(extractTo)) {
                throw new IOException("Failed to rename \"" + tmp.getAbsolutePath() +
                        "\" to \"" + extractTo.getAbsolutePath() + "\"");
            }
        } finally {
            closeQuietly(in);
            tmp.delete(); // return status ignored
        }
}

再回到MultiDex的install()方法中朋鞍,通過MultiDexExtractor.load()得到dex文件的zip列表后已添,調(diào)用installSecondaryDexes()

 private static void installSecondaryDexes(ClassLoader loader, File dexDir, List<File> files)
            throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException,
            InvocationTargetException, NoSuchMethodException, IOException {
        if (!files.isEmpty()) {
            if (Build.VERSION.SDK_INT >= 19) {
                V19.install(loader, files, dexDir);
            } else if (Build.VERSION.SDK_INT >= 14) {
                V14.install(loader, files, dexDir);
            } else {
                V4.install(loader, files);
            }
        }
    }

根據(jù)sdk版本不同,調(diào)用對應(yīng)的方法滥酥,V19更舞、V14、V4都是MultiDex的內(nèi)部類坎吻,處理的邏輯也差不多缆蝉,這里主要看一下V19

     /**
     * Installer for platform versions 19.
     */
    private static final class V19 {

        private static void install(ClassLoader loader, List<File> additionalClassPathEntries,
                File optimizedDirectory)
                        throws IllegalArgumentException, IllegalAccessException,
                        NoSuchFieldException, InvocationTargetException, NoSuchMethodException {
            /* The patched class loader is expected to be a descendant of
             * dalvik.system.BaseDexClassLoader. We modify its
             * dalvik.system.DexPathList pathList field to append additional DEX
             * file entries.
             */
             //獲取PathClassLoader的pathList成員變量,即DexPathList對象,其成員變量dexElements用于存儲dex文件相關(guān)信息
            Field pathListField = findField(loader, "pathList");
            Object dexPathList = pathListField.get(loader);
            ArrayList<IOException> suppressedExceptions = new ArrayList<IOException>();
            
            //調(diào)用makeDexElements方法刊头,內(nèi)部通過反射調(diào)用DexPathList的makeDexElements方法贝搁,返回dexElements
            //參數(shù)為/code_cache/secondary-dexes緩存目錄中包含classes.dex的zip文件list以及優(yōu)化后的dex文件存放目錄
            //expandFieldArray方法先獲取dexPathList對象的現(xiàn)有dexElements變量,然后建其和makeDexElements方法返回
            //的dexElements數(shù)組合并芽偏,然后再將合并之后的結(jié)果設(shè)置為dexPathList對象的dexElements變量
            expandFieldArray(dexPathList, "dexElements", makeDexElements(dexPathList,
                    new ArrayList<File>(additionalClassPathEntries), optimizedDirectory,
                    suppressedExceptions));
            if (suppressedExceptions.size() > 0) {
                for (IOException e : suppressedExceptions) {
                    Log.w(TAG, "Exception in makeDexElement", e);
                }
                Field suppressedExceptionsField =
                        findField(loader, "dexElementsSuppressedExceptions");
                IOException[] dexElementsSuppressedExceptions =
                        (IOException[]) suppressedExceptionsField.get(loader);

                if (dexElementsSuppressedExceptions == null) {
                    dexElementsSuppressedExceptions =
                            suppressedExceptions.toArray(
                                    new IOException[suppressedExceptions.size()]);
                } else {
                    IOException[] combined =
                            new IOException[suppressedExceptions.size() +
                                            dexElementsSuppressedExceptions.length];
                    suppressedExceptions.toArray(combined);
                    System.arraycopy(dexElementsSuppressedExceptions, 0, combined,
                            suppressedExceptions.size(), dexElementsSuppressedExceptions.length);
                    dexElementsSuppressedExceptions = combined;
                }

                suppressedExceptionsField.set(loader, dexElementsSuppressedExceptions);
            }
        }

        /**
         * A wrapper around
         * {@code private static final dalvik.system.DexPathList#makeDexElements}.
         */
        private static Object[] makeDexElements(
                Object dexPathList, ArrayList<File> files, File optimizedDirectory,
                ArrayList<IOException> suppressedExceptions)
                        throws IllegalAccessException, InvocationTargetException,
                        NoSuchMethodException {
            Method makeDexElements =
                    findMethod(dexPathList, "makeDexElements", ArrayList.class, File.class,
                            ArrayList.class);

            return (Object[]) makeDexElements.invoke(dexPathList, files, optimizedDirectory,
                    suppressedExceptions);
        }
    }

makeDexElements()其實(shí)就是通過反射方式調(diào)用dexPathList對象的makeDexElements方法雷逆,將從dex添加到其dexElements屬性中,具體的過程在前面的文章中已經(jīng)介紹過—《android Dex文件的加載》污尉,這里不再贅述膀哲。

     private static void expandFieldArray(Object instance, String fieldName,
            Object[] extraElements) throws NoSuchFieldException, IllegalArgumentException,
            IllegalAccessException {
        Field jlrField = findField(instance, fieldName);
        Object[] original = (Object[]) jlrField.get(instance);
        Object[] combined = (Object[]) Array.newInstance(
                original.getClass().getComponentType(), original.length + extraElements.length);
        System.arraycopy(original, 0, combined, 0, original.length);
        System.arraycopy(extraElements, 0, combined, original.length, extraElements.length);
        jlrField.set(instance, combined);
    }

到這里MultiDex.install(this)方法的邏輯就分析完了,可以看到其中的處理步驟和上篇文章ant方式中我們手動加載從dex的方式基本上是一致的被碗,所以這兩種方式并沒有本質(zhì)上的區(qū)別某宪。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市锐朴,隨后出現(xiàn)的幾起案子兴喂,更是在濱河造成了極大的恐慌,老刑警劉巖焚志,帶你破解...
    沈念sama閱讀 206,214評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件衣迷,死亡現(xiàn)場離奇詭異,居然都是意外死亡酱酬,警方通過查閱死者的電腦和手機(jī)壶谒,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,307評論 2 382
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來膳沽,“玉大人汗菜,你說我怎么就攤上這事√羯纾” “怎么了陨界?”我有些...
    開封第一講書人閱讀 152,543評論 0 341
  • 文/不壞的土叔 我叫張陵,是天一觀的道長痛阻。 經(jīng)常有香客問我菌瘪,道長,這世上最難降的妖魔是什么录平? 我笑而不...
    開封第一講書人閱讀 55,221評論 1 279
  • 正文 為了忘掉前任麻车,我火速辦了婚禮缀皱,結(jié)果婚禮上斗这,老公的妹妹穿的比我還像新娘。我一直安慰自己啤斗,他們只是感情好表箭,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,224評論 5 371
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著钮莲,像睡著了一般免钻。 火紅的嫁衣襯著肌膚如雪彼水。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,007評論 1 284
  • 那天极舔,我揣著相機(jī)與錄音凤覆,去河邊找鬼。 笑死拆魏,一個胖子當(dāng)著我的面吹牛盯桦,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播渤刃,決...
    沈念sama閱讀 38,313評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼拥峦,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了卖子?” 一聲冷哼從身側(cè)響起略号,我...
    開封第一講書人閱讀 36,956評論 0 259
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎洋闽,沒想到半個月后玄柠,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 43,441評論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡诫舅,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,925評論 2 323
  • 正文 我和宋清朗相戀三年随闪,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片骚勘。...
    茶點(diǎn)故事閱讀 38,018評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡铐伴,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出俏讹,到底是詐尸還是另有隱情当宴,我是刑警寧澤,帶...
    沈念sama閱讀 33,685評論 4 322
  • 正文 年R本政府宣布泽疆,位于F島的核電站户矢,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏殉疼。R本人自食惡果不足惜梯浪,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,234評論 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望瓢娜。 院中可真熱鬧挂洛,春花似錦、人聲如沸眠砾。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,240評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至柒巫,卻和暖如春励堡,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背堡掏。 一陣腳步聲響...
    開封第一講書人閱讀 31,464評論 1 261
  • 我被黑心中介騙來泰國打工应结, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人泉唁。 一個月前我還...
    沈念sama閱讀 45,467評論 2 352
  • 正文 我出身青樓摊趾,卻偏偏與公主長得像,于是被迫代替她去往敵國和親游两。 傳聞我的和親對象是個殘疾皇子砾层,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,762評論 2 345

推薦閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 171,504評論 25 707
  • 目前Android studio 2.4預(yù)覽版不再需要使用jack 工具鏈了 這件事要從一次報錯開始 如果僅僅是想...
    CalvinNing閱讀 718評論 0 1
  • 使用Proto3作為開發(fā)相當(dāng)折騰肛炮,經(jīng)常會出現(xiàn)一些想不到的問題,網(wǎng)上的資源看著比較少宝踪,所以我都記錄一下開發(fā)中遇到的問...
    黃海佳閱讀 767評論 0 2
  • 平淡的流年里抹殺了多少美好的記憶瘩燥?那些少年的浪漫情懷秕重,只會在歌詞里浩浩蕩蕩;所剩的激昂與澎湃厉膀,還會在肥皂劇里無休止...
    陳陳美美閱讀 454評論 8 3
  • 晚上9點(diǎn)溶耘,我洗完澡出來,經(jīng)過圓房間服鹅,只聽見圓爸在嘮叨:“九點(diǎn)鐘了凳兵,還看書啊……”停頓了幾秒“還要洗澡了,時間...
    彩雪麗閱讀 167評論 0 0