Full Code of hanks-zyh/hydrogenApp for AI

master f3ba707a3055 cached
308 files
1.2 MB
315.5k tokens
1145 symbols
1 requests
Download .txt
Showing preview only (1,319K chars total). Download the full file or copy to clipboard to get everything.
Repository: hanks-zyh/hydrogenApp
Branch: master
Commit: f3ba707a3055
Files: 308
Total size: 1.2 MB

Directory structure:
gitextract_ntyztauy/

├── .gitignore
├── LICENSE
├── PluginDev.md
├── README.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hydrogen-library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── pub/
│       │           └── hanks/
│       │               └── luajandroid/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   ├── androlua/
│       │   │   │   ├── LuaActivity.java
│       │   │   │   ├── LuaAdapter.java
│       │   │   │   ├── LuaBitmap.java
│       │   │   │   ├── LuaBroadcastReceiver.java
│       │   │   │   ├── LuaContext.java
│       │   │   │   ├── LuaDexClassLoader.java
│       │   │   │   ├── LuaDexLoader.java
│       │   │   │   ├── LuaDrawable.java
│       │   │   │   ├── LuaFragment.java
│       │   │   │   ├── LuaGcable.java
│       │   │   │   ├── LuaHttp.java
│       │   │   │   ├── LuaImageLoader.java
│       │   │   │   ├── LuaManager.java
│       │   │   │   ├── LuaPrint.java
│       │   │   │   ├── LuaTimer.java
│       │   │   │   ├── LuaUtil.java
│       │   │   │   ├── LuaView.java
│       │   │   │   ├── LuaWebView.java
│       │   │   │   ├── NineBitmapDrawable.java
│       │   │   │   ├── adapter/
│       │   │   │   │   ├── LuaFragmentPageAdapter.java
│       │   │   │   │   ├── LuaPagerAdapter.java
│       │   │   │   │   ├── LuaRecyclerAdapter.java
│       │   │   │   │   └── LuaRecyclerHolder.java
│       │   │   │   ├── base/
│       │   │   │   │   ├── BaseActivity.java
│       │   │   │   │   └── BaseFragment.java
│       │   │   │   ├── common/
│       │   │   │   │   ├── LuaConstants.java
│       │   │   │   │   ├── LuaFileUtils.java
│       │   │   │   │   ├── LuaLog.java
│       │   │   │   │   ├── LuaSp.java
│       │   │   │   │   ├── LuaStringUtils.java
│       │   │   │   │   └── LuaToast.java
│       │   │   │   ├── fragment/
│       │   │   │   │   └── MenuFragment.java
│       │   │   │   ├── plugin/
│       │   │   │   │   └── Plugin.java
│       │   │   │   ├── utils/
│       │   │   │   │   ├── ColorStateListFactory.java
│       │   │   │   │   ├── DialogUtils.java
│       │   │   │   │   ├── LauncherUtil.java
│       │   │   │   │   └── ShortcutUtils.java
│       │   │   │   └── widget/
│       │   │   │       ├── glide/
│       │   │   │       │   └── LuaGlideModule.java
│       │   │   │       ├── htmltext/
│       │   │   │       │   ├── URLImageParser.java
│       │   │   │       │   └── UrlDrawable.java
│       │   │   │       ├── marqueetext/
│       │   │   │       │   └── MarqueeTextView.java
│       │   │   │       ├── ninegride/
│       │   │   │       │   ├── LuaNineGridView.java
│       │   │   │       │   ├── LuaNineGridViewAdapter.java
│       │   │   │       │   ├── NineGridImageView.java
│       │   │   │       │   └── NineGridImageViewAdapter.java
│       │   │   │       ├── picture/
│       │   │   │       │   ├── ElasticDragDismissFrameLayout.java
│       │   │   │       │   └── PicturePreviewActivity.java
│       │   │   │       ├── statusbar/
│       │   │   │       │   ├── FixInsetsFrameLayout.java
│       │   │   │       │   └── StatusBarView.java
│       │   │   │       ├── swipebacklayout/
│       │   │   │       │   ├── SwipeBackLayout.java
│       │   │   │       │   ├── Utils.java
│       │   │   │       │   ├── ViewDragHelper.java
│       │   │   │       │   └── app/
│       │   │   │       │       ├── SwipeBackActivity.java
│       │   │   │       │       ├── SwipeBackActivityBase.java
│       │   │   │       │       ├── SwipeBackActivityHelper.java
│       │   │   │       │       └── SwipeBackPreferenceActivity.java
│       │   │   │       ├── video/
│       │   │   │       │   └── VideoPlayerActivity.java
│       │   │   │       ├── viewpager/
│       │   │   │       │   └── NoScrollViewPager.java
│       │   │   │       └── webview/
│       │   │   │           └── WebViewActivity.java
│       │   │   └── com/
│       │   │       └── luajava/
│       │   │           ├── Console.java
│       │   │           ├── JavaFunction.java
│       │   │           ├── LuaException.java
│       │   │           ├── LuaFunction.java
│       │   │           ├── LuaInvocationHandler.java
│       │   │           ├── LuaJavaAPI.java
│       │   │           ├── LuaList.java
│       │   │           ├── LuaMetaTable.java
│       │   │           ├── LuaObject.java
│       │   │           ├── LuaStack.java
│       │   │           ├── LuaState.java
│       │   │           ├── LuaStateFactory.java
│       │   │           └── LuaTable.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── bg_circle.xml
│       │       │   ├── bg_rect_radius.xml
│       │       │   ├── ic_loading.xml
│       │       │   ├── layout_selector_tran.xml
│       │       │   ├── loading_shap.xml
│       │       │   ├── shadow_line_bottom.xml
│       │       │   └── shadow_line_top.xml
│       │       ├── layout/
│       │       │   ├── activity_lua.xml
│       │       │   ├── activity_picture.xml
│       │       │   ├── activity_video.xml
│       │       │   ├── activity_webview.xml
│       │       │   ├── dialog_add_shortcut.xml
│       │       │   ├── dialog_input.xml
│       │       │   ├── fragment_menu.xml
│       │       │   └── item_pager_image.xml
│       │       ├── raw/
│       │       │   └── keep.xml
│       │       └── values/
│       │           ├── attrs_elastic_drag_dismiss_frame_layout.xml
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           ├── java/
│           │   └── pub/
│           │       └── hanks/
│           │           └── luajandroid/
│           │               └── ExampleUnitTest.java
│           └── lua/
│               ├── a/
│               │   └── aa.lua
│               ├── a.lua
│               ├── b/
│               │   └── ba.lua
│               └── c/
│                   └── json.lua
├── lua/
│   ├── 163news/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── 500px/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── 91pic/
│   │   ├── info.json
│   │   └── main.lua
│   ├── appinn/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── bilibili/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── btmayi/
│   │   ├── info.json
│   │   └── main.lua
│   ├── buka/
│   │   ├── detail.lua
│   │   ├── fragment_category.lua
│   │   ├── info.json
│   │   ├── main.lua
│   │   ├── search.lua
│   │   └── viewer.lua
│   ├── digit/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── dm5/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   ├── main.lua
│   │   ├── search.lua
│   │   └── viewer.lua
│   ├── douban-daily/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── doubanmovie/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── douyu/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── eyepetizer/
│   │   ├── info.json
│   │   └── main.lua
│   ├── gacha/
│   │   ├── info.json
│   │   └── main.lua
│   ├── gamesky/
│   │   ├── info.json
│   │   └── main.lua
│   ├── graphmovies/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── huaban-popular/
│   │   ├── info.json
│   │   └── main.lua
│   ├── iciba/
│   │   ├── info.json
│   │   └── main.lua
│   ├── it168/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── ithome/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── jdly/
│   │   ├── info.json
│   │   └── main.lua
│   ├── jike/
│   │   ├── fragment_feed.lua
│   │   ├── fragment_hot.lua
│   │   ├── fragment_recomend.lua
│   │   ├── info.json
│   │   ├── item_msg.lua
│   │   └── main.lua
│   ├── magmoe-cos/
│   │   ├── info.json
│   │   └── main.lua
│   ├── magmoe-image/
│   │   ├── info.json
│   │   └── main.lua
│   ├── notead/
│   │   ├── info.json
│   │   └── main.lua
│   ├── packwap/
│   │   ├── info.json
│   │   ├── main.lua
│   │   └── testwap.lua
│   ├── papapatimer/
│   │   ├── info.json
│   │   └── main.lua
│   ├── pengpai/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── pixiv/
│   │   ├── info.json
│   │   └── main.lua
│   ├── proxy_fetch/
│   │   ├── info.json
│   │   └── main.lua
│   ├── proxy_fetch_mogu/
│   │   ├── info.json
│   │   └── main.lua
│   ├── qiqu/
│   │   ├── info.json
│   │   └── main.lua
│   ├── qqtools/
│   │   ├── info.json
│   │   └── main.lua
│   ├── quanmm/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── readhub/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── splash/
│   │   ├── info.json
│   │   └── main.lua
│   ├── sspai/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── taobao/
│   │   ├── info.json
│   │   └── main.lua
│   ├── tieba/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── tv005/
│   │   ├── activity_agc_detail.lua
│   │   ├── fragment_agc_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── weather/
│   │   ├── city.lua
│   │   ├── info.json
│   │   ├── list_city.lua
│   │   ├── main.lua
│   │   └── weather.lua
│   ├── weibo-hot/
│   │   ├── info.json
│   │   ├── item_msg.lua
│   │   └── main.lua
│   ├── wikibaidu/
│   │   ├── info.json
│   │   └── main.lua
│   ├── yilin/
│   │   ├── activity_detail.lua
│   │   ├── fragment_yilin.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── zhihu-recommend/
│   │   ├── info.json
│   │   └── main.lua
│   └── zhihudaliy/
│       ├── activity_zhihu_daliy_detail.lua
│       ├── fragment_zhihu_daliy.lua
│       ├── info.json
│       └── main.lua
├── lua_main/
│   ├── activity_plugins.lua
│   ├── activity_setting.lua
│   ├── filehelper.lua
│   ├── fragment_home.lua
│   ├── fragment_list.lua
│   ├── import.lua
│   ├── json.lua
│   ├── loadbitmap.lua
│   ├── loadlayout.lua
│   ├── loadmenu.lua
│   ├── log.lua
│   ├── main.lua
│   ├── md5.lua
│   └── uihelper.lua
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── pub/
│       │           └── hanks/
│       │               └── sample/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── assets/
│       │   │   └── lua/
│       │   │       ├── activity_plugins.lua
│       │   │       ├── activity_setting.lua
│       │   │       ├── filehelper.lua
│       │   │       ├── fragment_home.lua
│       │   │       ├── fragment_list.lua
│       │   │       ├── import.lua
│       │   │       ├── json.lua
│       │   │       ├── loadbitmap.lua
│       │   │       ├── loadlayout.lua
│       │   │       ├── loadmenu.lua
│       │   │       ├── log.lua
│       │   │       ├── main.lua
│       │   │       ├── md5.lua
│       │   │       └── uihelper.lua
│       │   ├── java/
│       │   │   └── pub/
│       │   │       └── hanks/
│       │   │           └── sample/
│       │   │               ├── App.java
│       │   │               ├── ITHomeUtils.java
│       │   │               ├── SplashActivity.java
│       │   │               └── adapter/
│       │   │                   └── DragTouchHelper.java
│       │   └── res/
│       │       ├── anim/
│       │       │   ├── slide_in_from_bottom.xml
│       │       │   ├── slide_in_right.xml
│       │       │   ├── slide_out_from_bottom.xml
│       │       │   ├── slide_out_left.xml
│       │       │   └── slide_out_right.xml
│       │       ├── drawable/
│       │       │   └── shadow_splash.xml
│       │       ├── layout/
│       │       │   ├── activity_splash.xml
│       │       │   └── upgrade_dialog.xml
│       │       ├── raw/
│       │       │   └── keep.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── pub/
│                   └── hanks/
│                       └── sample/
│                           └── ExampleUnitTest.java
├── script/
│   ├── lua/
│   │   └── buildfile.lua
│   └── node/
│       └── watch/
│           ├── build_lua_main_dir.js
│           ├── exec_luac.js
│           ├── package.json
│           ├── update_plugin_info.js
│           └── watch.js
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.jks
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
.idea/
/.tags
/.tags1
/script/node/watch/node_modules/
/keystore.jks
/.vscode/
/.settings/
/sample/.settings/
/app/.settings/
/app/build/
.project
app/.classpath
app/.project


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under androlua.common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "{}"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright {yyyy} {name of copyright owner}

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: PluginDev.md
================================================
# 氢应用插件开发

## 插件介绍
插件用 lua 语言开发,所以需要能看懂 lua,插件基于 androlua 框架下,
氢应用插件结构很简单,每个插件放在手机的 sdcard/Android/data/pub.hydrogen.android/files/LLLLLua 目录下

1. 首先在上面的目录下创建插件文件夹
2. 编写插件主程序,插件**至少**包含2文件:
`info.json` 插件描述文件,`main.lua` 插件启动文件,接下来分别介绍:

## 插件结构
首先是 `info.json`
```
{
  "id": "pub.hanks.gacha",
  "name": "网易插画",
  "icon": "http://ww1.sinaimg.cn/large/8c9b876fly1fhaaa8qcofj2046046we9.jpg",
  "main": "main.lua",
  "versionName": "1.0",
  "versionCode": 1,
  "desc": "网易每日插画排行"
}
```

id: 插件唯一标识符号
name: 插件名称
icon: 插件图标
main: 插件启动文件, 可以自定义名称
versionName: 插件版本名称
versionVersion: 插件版本号
desc: 插件描述

然后是启动文件(main.lua),也就是主程序,以`网易插画`的代码为例:

```lua
require "import"
import "android.widget.*"
import "android.content.*"
import "android.view.View"
import "androlua.LuaHttp"
import "androlua.LuaAdapter"
import "androlua.LuaImageLoader"
import "android.support.v7.widget.RecyclerView"
import "androlua.adapter.LuaRecyclerAdapter"
import "androlua.adapter.LuaRecyclerHolder"
import "android.support.v7.widget.StaggeredGridLayoutManager"
import "androlua.widget.picture.PicturePreviewActivity"
import "java.util.Calendar"
local JSON = require("cjson")
local uihelper = require('uihelper')

-- 上面是需要导入用到的 class 类以及引用的 so 或 lua


local calender = Calendar.getInstance()
local max
local data = {}
local adapter
local imageWidth = uihelper.getScreenWidth() / 2

-- 布局文件
local layout = {
    RecyclerView,
    id = "recyclerView",
    layout_width = "fill",
    layout_height = "fill",
}

local item_view = {
    FrameLayout,
    layout_width = "fill",
    {
        ImageView,
        id = "iv_image",
        layout_width = "fill",
        layout_height = "200dp",
        scaleType = "fitXY",
    },
    {
        TextView,
        id = "tv_title",
        layout_gravity = "right",
        background = "#88000000",
        paddingLeft = "6dp",
        paddingRight = "6dp",
        paddingTop = "2dp",
        paddingBottom = "2dp",
        textSize = "10sp",
        visibility = 'gone',
        textColor = "#aaffffff",
    },
    {
        View,
        id = "layer",
        layout_width = "fill",
        layout_height = "fill",
        background = "@drawable/layout_selector_tran",
        clickable = true,
    },
}


local function fetchData()

    -- 获取数据
    local year = calender.get(Calendar.YEAR)
    local month = calender.get(Calendar.MONTH) + 1
    local day = calender.get(Calendar.DAY_OF_MONTH)

    local markFrom = string.format('%04d-%02d-%02d', year, month, day)
    calender.add(Calendar.DAY_OF_MONTH, -1)
    year = calender.get(Calendar.YEAR)
    month = calender.get(Calendar.MONTH) + 1
    day = calender.get(Calendar.DAY_OF_MONTH)
    local mark = string.format('%04d-%02d-%02d', year, month, day)

    local url = string.format("http://gacha.163.com/api/v1/ranking/pic?type=0&mark=%s&fromMark=%s", mark, markFrom)
    -- 发起请求
    LuaHttp.request({ url = url }, function(error, code, body)
        local json = JSON.decode(body)
        local html = json.result.rankingHtml
        -- 异步回调
        uihelper.runOnUiThread(activity, function()
            -- UI 线程执行
            local s = #data
            for w, h, url in string.gmatch(html, 'data[-]width="([0-9]+)" data[-]height="([0-9]+)".-data[-]src="(.-)"') do
                local item = { url = url, w = w, h = h }
                local id, type = string.match(item.url, 'http://gacha[.]nosdn[.]127[.]net/([0-9a-z]+)[.]([a-z]+)')
                item.id = id
                item.type = type
                item.fullUrl = string.format('http://gacha.nosdn.127.net/%s.%s', id, type)
                item.calcHeight = math.floor(imageWidth * tonumber(item.h) / tonumber(item.w))
                data[#data + 1] = item
            end
            adapter.notifyItemRangeChanged(s, #data)
        end)
    end)
end

local function launchDetail(item)
    local args = { uris = { item.fullUrl } }
    PicturePreviewActivity.start(activity, JSON.encode(args))
end


function onCreate(savedInstanceState)
    activity.setStatusBarColor(0x33000000) -- 设置状态栏颜色
    activity.setContentView(loadlayout(layout)) -- 设置布局
    -- 创建Adapter
    adapter = LuaRecyclerAdapter(luajava.createProxy('androlua.adapter.LuaRecyclerAdapter$AdapterCreator', {
        getItemCount = function()
            return #data
        end,
        getItemViewType = function(position)
            return 0
        end,
        onCreateViewHolder = function(parent, viewType)
            local views = {}
            local holder = LuaRecyclerHolder(loadlayout(item_view, views, RecyclerView))
            holder.itemView.getLayoutParams().width = imageWidth
            holder.itemView.setTag(views)
            views.layer.onClick = function(view)
                local position = holder.getAdapterPosition() + 1
                launchDetail(data[position])
            end
            return holder
        end,
        onBindViewHolder = function(holder, position)
            position = position + 1
            local item = data[position]
            local views = holder.itemView.getTag()
            views.iv_image.getLayoutParams().height = item.calcHeight
            LuaImageLoader.load(views.iv_image, item.url)
            if position == #data then fetchData() end
        end,
    }))
    recyclerView.setLayoutManager(StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL))
    recyclerView.setAdapter(adapter)
    fetchData()
end
```

插件开发完毕


### 参考链接
[AndroLua_pro](https://github.com/nirenr/AndroLua_pro)
[lua语法](http://www.runoob.com/lua/lua-basic-syntax.html)
[lua的手册](https://cloudwu.github.io/lua53doc/manual.html)
[Android文档](https://developer.android.com/develop/index.html?hl=zh-cn)





================================================
FILE: README.md
================================================
# hydrogenApp

hydrogen is a **pluggable** android app, use `Lua` develop android, minSdkVersion="15", lua 5.3
plugin wrote by `lua` program language

[APK Download](https://www.coolapk.com/apk/pub.hydrogen.android)

<img src="http://ww1.sinaimg.cn/large/8c9b876fly1fxadl4x1lfj20780780sk.jpg"/>

## App Plugin

![](http://image.coolapk.com/apk_image/2017/0706/1-for-148937-o_1bkb0ue7m16mp165il5srd41ei815-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0706/2-for-148937-o_1bkb0ue7n1h1p1ke3ssuj4q1dab16-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0706/3-for-148937-o_1bkb0ue7n1sn1nc01k8b17bk3h017-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0706/4-for-148937-o_1bkb0ue7natj1uk010qm1kbgdq218-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0901/S70901-173605-for-148937-o_1boucs1494kp1qo81qul1656ei9q-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0901/S70901-173626-for-148937-o_1boucsbvrkcu1omqrte5d8amc10-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0901/S70901-173652-for-148937-o_1boucsgnk6rlsvn1j9f1q8177n16-uid-518407.jpg.t.jpg)
![](http://image.coolapk.com/apk_image/2017/0901/S70901-173716-for-148937-o_1boucsl56mdt10am1vgsqs099m1c-uid-518407.jpg.t.jpg)


## 项目结构

宿主:`sample`  
宿主用到的 lua 文件: `lua_main`  

插件目录:`lua`  
脚本:script  


### 插件开发步骤

插件目录:lua  
插件包含文件 `info.json` `main.lua`

```
{
  "id": "pub.hanks.gacha",
  "name": "网易插画",
  "icon": "http://ww1.sinaimg.cn/large/8c9b876fly1fhaaa8qcofj2046046we9.jpg",
  "main": "main.lua",
  "versionName": "1.0",
  "versionCode": 1,
  "desc": "网易每日插画排行"
}

id: 插件唯一标识符号
name: 插件名称
icon: 插件图标
main: 插件启动文件
versionName: 插件版本名称
versionVersion: 插件版本号
desc: 插件描述
```

### 插件发布

插件生成目录 api_luanroid, 执行 java 单元测试 `zipPlugin`, 该方法会打包好插件并更新获取插件的 api, 成功后,然后 push 到线上

[lua语法](http://www.runoob.com/lua/lua-basic-syntax.html)
[lua的手册](https://cloudwu.github.io/lua53doc/manual.html)

```

require "import"
import "android.widget.*"
import "android.view.*"
import "android.app.*"
import "android.net.*"
import "android.content.*"

```


### 更新每日壁纸

https://coding.net/u/zhangyuhan/p/api_luanroid/git/blob/master/api/splash

### 版本更新

https://coding.net/u/zhangyuhan/p/api_luanroid/git/blob/master/api/update


## 插件开发

请看[插件开发指南](https://github.com/hanks-zyh/hydrogenApp/blob/master/PluginDev.md),更多的功能使用可以参考已有的[插件列表](https://github.com/hanks-zyh/hydrogenApp/tree/master/lua),目录为 lua 目录




================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options androlua.common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Nov 16 10:45:13 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true


================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: hydrogen-library/.gitignore
================================================
/build


================================================
FILE: hydrogen-library/build.gradle
================================================
apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    signingConfigs {
        release {
            keyAlias 'luajandroid'
            keyPassword 'CeRRV5eG'
            storeFile file('../keystore/luajandroid_keystore.jks')
            storePassword 'CeRRV5eG'
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            zipAlignEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        preRelease {
            debuggable true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
    productFlavors {
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

def support_version = '28.0.0'
dependencies {
    // test
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    // local
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    // remote
    implementation "com.android.support:appcompat-v7:$support_version"
    implementation "com.android.support:design:$support_version"
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'cn.jzvd:jiaozivideoplayer:6.2.3'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2'
    implementation 'jp.wasabeef:glide-transformations:2.0.2'
}


================================================
FILE: hydrogen-library/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class android.**{*;}
-keep class androlua.**{*;}
-keep class com.**{*;}
-keep class androlua.common.**{*;}
-keep class pub.**{*;}

# Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

# Okhttp
-dontwarn okio.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault


================================================
FILE: hydrogen-library/src/androidTest/java/pub/hanks/luajandroid/ExampleInstrumentedTest.java
================================================
package pub.hanks.luajandroid;

import android.animation.LayoutTransition;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

import org.junit.Test;
import org.junit.runner.RunWith;

import java.io.File;
import java.net.URI;

import static junit.framework.Assert.assertEquals;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        new ColorDrawable(0xff);

        LinearLayout linearLayout = new LinearLayout(appContext);
        linearLayout.setOrientation(LinearLayout.VERTICAL);
        assertEquals("pub.hanks.luajandroid", appContext.getPackageName());
        linearLayout.animate().scaleX(2).scaleY(2).translationX(100).setDuration(3000).start();
        VectorDrawableCompat.createFromPath("");

        linearLayout.setClickable(true);
        linearLayout.setFocusable(true);
        linearLayout.setFocusableInTouchMode(true);
        linearLayout.setBackgroundResource(R.drawable.layout_selector_tran);

        Intent intent = new Intent();
        new File(new URI(intent.getData().getPath())).getAbsolutePath();

        RecyclerView recyclerView = new RecyclerView(appContext);
        recyclerView.setVerticalFadingEdgeEnabled(false);

        GridView gridLayout = new GridView(appContext);
        gridLayout.setNumColumns(5);
        gridLayout.setStretchMode(GridView.STRETCH_SPACING);
        gridLayout.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            }
        });
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            gridLayout.setElevation(20);
        }
        gridLayout.postDelayed(new Runnable() {
            @Override
            public void run() {

            }
        }, 1000);

        BottomSheetBehavior<RecyclerView> sheetBehavior = BottomSheetBehavior.from(recyclerView);
        if (sheetBehavior.getState() != BottomSheetBehavior.STATE_COLLAPSED) {
            sheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
        }

        new GridLayoutManager(appContext, 3);

        HorizontalScrollView horizontalScrollView = new HorizontalScrollView(appContext);
        horizontalScrollView.setHorizontalScrollBarEnabled(false);
        ListView listView = new ListView(appContext);
        listView.setDividerHeight(0);
        TextView textView = new TextView(appContext);
        textView.setMaxLines(1);
        textView.setSingleLine(true);
        TabLayout tabLayout = new TabLayout(appContext);
        tabLayout.setVisibility(View.VISIBLE);
        WebView webView = new WebView(appContext);
        webView.setWebChromeClient(new WebChromeClient());
        //webView.addJavascriptInterface(this, "");
        Bitmap bitmap = BitmapFactory.decodeResource(appContext.getResources(), R.id.et_url);
        tabLayout.setLayoutTransition(new LayoutTransition());
        final BottomNavigationView bottomView = new BottomNavigationView(appContext);
        ColorStateList textColor = ColorStateList.valueOf(0xFFFF0000);
        bottomView.setItemTextColor(textColor);
        bottomView.getMenu().add("");
        bottomView.getMenu().add("");
        bottomView.getMenu().add("");
        bottomView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                item.getTitle();
                item.setChecked(true);
                return true;
            }
        });

        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);

        new AlertDialog.Builder(appContext)
                .setItems(new String[]{}, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .setSingleChoiceItems(new String[]{}, 0, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .show();
        RadioGroup radioGroup = new RadioGroup(appContext);
        RadioButton radioButton = new RadioButton(appContext);
        radioGroup.addView(radioButton);


        new Toolbar(appContext).setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        GradientDrawable drawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{});


        CollapsingToolbarLayout collapsingToolbarLayout = new CollapsingToolbarLayout(appContext);
        CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) collapsingToolbarLayout.getLayoutParams();
        params.setBehavior(new AppBarLayout.ScrollingViewBehavior());


        new AlertDialog.Builder(appContext).setTitle("").setMessage("")
                .setPositiveButton("取消", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
        .show();

        GradientDrawable gd = new GradientDrawable();
        gd.setShape(GradientDrawable.OVAL);
        gd.setColor(0xFFFFFFFF);
        // 动态代理





    }

    class MyAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return 0;
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return 0;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            return null;
        }
    }
}


================================================
FILE: hydrogen-library/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="pub.hanks.luajandroid">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:resizeableActivity="true">
        <activity
            android:theme="@style/AppTheme"
            android:name="androlua.LuaActivity"
            android:exported="true"
            android:screenOrientation="user"
            android:supportsPictureInPicture="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>
        <activity android:name="androlua.widget.picture.PicturePreviewActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="pub.hydrogen.android"
                    android:scheme="hydrogen" />
            </intent-filter>
        </activity>
        <activity
            android:name="androlua.widget.webview.WebViewActivity"
            android:hardwareAccelerated="true" />
        <activity
            android:name="androlua.widget.video.VideoPlayerActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:screenOrientation="portrait" />

        <meta-data
            android:name="androlua.widget.glide.LuaGlideModule"
            android:value="GlideModule" />
    </application>
</manifest>

================================================
FILE: hydrogen-library/src/main/java/androlua/LuaActivity.java
================================================
package androlua;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.FragmentManager;
import android.support.v4.widget.DrawerLayout;
import android.view.ContextMenu;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;

import com.luajava.JavaFunction;
import com.luajava.LuaException;
import com.luajava.LuaObject;
import com.luajava.LuaState;
import com.luajava.LuaStateFactory;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;

import androlua.base.BaseActivity;
import androlua.common.LuaLog;
import androlua.fragment.MenuFragment;
import pub.hanks.luajandroid.R;

public class LuaActivity extends BaseActivity implements LuaContext {

    public Handler handler;
    public TextView status;
    private LuaState L;
    private ScrollView errorLayout;
    private LuaObject mOnKeyDown;
    private LuaObject mOnKeyUp;
    private LuaObject mOnKeyLongPress;
    private LuaObject mOnTouchEvent;
    private LuaDexLoader luaDexLoader;
    private LuaManager luaManager;
    private FrameLayout main;
    private MenuFragment menuFragment;
    private DrawerLayout layout_drawer;

    public static void start(Context context, String luaPath) {
        Intent starter = new Intent(context, LuaActivity.class);
        starter.putExtra("luaPath", luaPath);
        context.startActivity(starter);
    }

    public void setContentView(View view) {
        main.removeAllViews();
        main.addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

        FragmentManager fragmentManager = getSupportFragmentManager();
        if (fragmentManager.findFragmentByTag("menu") == null) {
            fragmentManager.beginTransaction()
                    .replace(R.id.menu, menuFragment, "menu").commitAllowingStateLoss();
        }
    }

    public void closeDrawer() {
        if (layout_drawer == null) {
            return;
        }
        layout_drawer.closeDrawer(Gravity.RIGHT);
    }


    @Override
    public void setContentView(View view, LayoutParams params) {
        super.setContentView(view, params);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lua);
        main = (FrameLayout) findViewById(R.id.main);
        layout_drawer = (DrawerLayout) findViewById(R.id.layout_drawer);
        menuFragment = MenuFragment.newInstance();
        handler = new MainHandler(this);

        // 用于出错时显示
        initErrorLayout();

        initLua(savedInstanceState);
    }

    public void disableDrawer(){
        if (layout_drawer == null) {
            return;
        }
        layout_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
    }

    private void initLua(Bundle savedInstanceState) {
        try {
            Object[] arg = LuaUtil.IntentHelper.getArgs(getIntent());
            luaManager = LuaManager.getInstance();
            String luaFile = LuaUtil.IntentHelper.getLuaPath(getIntent());

            L = LuaStateFactory.newLuaState();
            L.openLibs();

            L.pushJavaObject(this);
            L.setGlobal("activity");

            L.getGlobal("activity");
            L.setGlobal("this");

            L.pushContext(this);
            L.getGlobal("luajava");

            L.pushString(luaManager.getLuaExtDir());
            L.setField(-2, "luaextdir");

            L.pushString(luaManager.getLuaDir());
            L.setField(-2, "luadir");


            L.pushString(luaManager.getLuaLpath());
            L.setField(-2, "luapath");

            L.pop(1);

            JavaFunction print = new LuaPrint(L);
            print.register("print");

            L.getGlobal("package");
            L.pushString(luaManager.getLuaLpath());
            L.setField(-2, "path");
            L.pushString(luaManager.getLuaCpath());
            L.setField(-2, "cpath");
            L.pop(1);


            mOnKeyDown = L.getLuaObject("onKeyDown");
            if (mOnKeyDown.isNil())
                mOnKeyDown = null;
            mOnKeyUp = L.getLuaObject("onKeyUp");
            if (mOnKeyUp.isNil())
                mOnKeyUp = null;
            mOnKeyLongPress = L.getLuaObject("onKeyLongPress");
            if (mOnKeyLongPress.isNil())
                mOnKeyLongPress = null;
            mOnTouchEvent = L.getLuaObject("onTouchEvent");
            if (mOnTouchEvent.isNil())
                mOnTouchEvent = null;

            luaDexLoader = new LuaDexLoader();
            luaDexLoader.loadLibs();
            if (!luaFile.startsWith("/")) {
                luaFile = luaManager.getLuaExtDir() + "/" + luaFile;
            }
            luaManager.doFile(L, luaFile, arg);
            luaManager.runFunc(L, "onCreate", savedInstanceState);
        } catch (Exception e) {
            sendMsg(e.getMessage());
            setContentView(this.errorLayout);
        }
    }

    private void initErrorLayout() {
        errorLayout = new ScrollView(this);
        errorLayout.setFillViewport(true);
        errorLayout.setBackgroundColor(Color.WHITE);

        status = new TextView(this);
        status.setPadding(10, 100, 10, 0);
        status.setTextColor(Color.BLACK);
        status.setText("");
        status.setTextIsSelectable(true);

        errorLayout.addView(status, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    }

    public ArrayList<ClassLoader> getClassLoaders() {
        return luaDexLoader.getClassLoaders();
    }

    public HashMap<String, String> getLibrarys() {
        return luaDexLoader.getLibrarys();
    }

    public void loadResources(String path) {
        luaDexLoader.loadResources(path);
    }

    public LuaState getLuaState() {
        return L;
    }

    @Override
    protected void onStart() {
        super.onStart();
        luaManager.runFunc(L, "onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        luaManager.runFunc(L, "onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        luaManager.runFunc(L, "onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        luaManager.runFunc(L, "onStop");
    }

    @Override
    protected void onNewIntent(Intent intent) {
        luaManager.runFunc(L, "onNewIntent", intent);
        super.onNewIntent(intent);
    }

    @Override
    protected void onDestroy() {
        try {
            luaManager.runFunc(L, "onDestroy");
            super.onDestroy();
//            L.close();
            L.gc(LuaState.LUA_GCCOLLECT, 1);
            System.gc();
        } catch (Exception e) {
            LuaLog.e(e);
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        luaManager.runFunc(L, "onActivityResult", requestCode, resultCode, data);
        super.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public void onBackPressed() {
        Object ret = luaManager.runFunc(L, "onBackPressed");
        if (ret != null && ret.getClass() == Boolean.class && (Boolean) ret) {
            return;
        }
        super.onBackPressed();
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (mOnKeyDown != null) {
            try {
                Object ret = mOnKeyDown.call(keyCode, event);
                if (ret != null && ret.getClass() == Boolean.class && (Boolean) ret)
                    return true;
            } catch (LuaException e) {
                sendMsg("onKeyDown " + e.getMessage());
            }
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (mOnKeyUp != null) {
            try {
                Object ret = mOnKeyUp.call(keyCode, event);
                if (ret != null && ret.getClass() == Boolean.class && (Boolean) ret)
                    return true;
            } catch (LuaException e) {
                sendMsg("onKeyUp " + e.getMessage());
            }
        }
        return super.onKeyUp(keyCode, event);
    }

    @Override
    public boolean onKeyLongPress(int keyCode, KeyEvent event) {
        if (mOnKeyLongPress != null) {
            try {
                Object ret = mOnKeyLongPress.call(keyCode, event);
                if (ret != null && ret.getClass() == Boolean.class && (Boolean) ret)
                    return true;
            } catch (LuaException e) {
                sendMsg("onKeyLongPress " + e.getMessage());
            }
        }
        return super.onKeyLongPress(keyCode, event);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (mOnTouchEvent != null) {
            try {
                Object ret = mOnTouchEvent.call(event);
                if (ret != null && ret.getClass() == Boolean.class && (Boolean) ret)
                    return true;
            } catch (LuaException e) {
                sendMsg("onTouchEvent " + e.getMessage());
            }
        }
        return super.onTouchEvent(event);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        luaManager.runFunc(L, "onCreateOptionsMenu", menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        Object ret = null;
        if (!item.hasSubMenu())
            ret = luaManager.runFunc(L, "onOptionsItemSelected", item);
        if (ret != null && ret.getClass() == Boolean.class && (Boolean) ret)
            return true;
        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
        luaManager.runFunc(L, "onCreateContextMenu", menu, v, menuInfo);
        super.onCreateContextMenu(menu, v, menuInfo);
    }

    @Override
    public boolean onContextItemSelected(MenuItem item) {
        luaManager.runFunc(L, "onContextItemSelected", item);
        return super.onContextItemSelected(item);
    }

    public int getWidth() {
        return getResources().getDisplayMetrics().widthPixels;
    }

    public int getHeight() {
        return getResources().getDisplayMetrics().heightPixels;
    }

    public void toast(String msg) {
        Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
    }


    //显示信息
    public void sendMsg(String msg) {
        Message message = new Message();
        Bundle bundle = new Bundle();
        bundle.putString("data", msg);
        message.setData(bundle);
        message.what = 0;
        handler.sendMessage(message);
        LuaLog.e(msg);
    }


    // avoid handler leak memory
    private static class MainHandler extends Handler {
        WeakReference<Activity> activityWeakReference;

        private MainHandler(Activity activity) {
            activityWeakReference = new WeakReference<>(activity);
        }

        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            Activity activity = activityWeakReference.get();
            if (activity == null || !(activity instanceof LuaActivity)) {
                return;
            }
            LuaActivity luaActivity = (LuaActivity) activity;
            switch (msg.what) {
                case 0: {
                    String data = msg.getData().getString("data");
                    luaActivity.toast(data);
                    luaActivity.status.append(data + "\n");
                    luaActivity.setContentView(luaActivity.errorLayout);
                }
                break;
                //                case 1: {
                //                    Bundle data = msg.getData();
                //                    luaActivity.setField(data.getString("data"), ((Object[]) data.getSerializable("args"))[0]);
                //                }
                //                break;
                //                case 2: {
                //                    String src = msg.getData().getString("data");
                //                    luaActivity.luaManager.runFunc(L, src);
                //                }
                //                break;
                //                case 3: {
                //                    String src = msg.getData().getString("data");
                //                    Serializable args = msg.getData().getSerializable("args");
                //                    luaActivity.luaManager.runFunc(L, src, (Object[]) args);
                //                }
            }
        }
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaAdapter.java
================================================
package androlua;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * LuaAdapter
 * Created by hanks on 2017/5/13.
 */

public class LuaAdapter extends BaseAdapter {

    AdapterCreator adapterCreator;

    public LuaAdapter(AdapterCreator adapterCreator) {
        this.adapterCreator = adapterCreator;
    }

    @Override
    public int getCount() {
        return (int) adapterCreator.getCount();
    }

    @Override
    public Object getItem(int position) {
        return adapterCreator.getItem(position);
    }

    @Override
    public long getItemId(int position) {
        return adapterCreator.getItemId(position);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return adapterCreator.getView(position, convertView, parent);
    }

    public interface AdapterCreator {
        long getCount();

        Object getItem(int position);

        long getItemId(int position);

        View getView(int position, View convertView, ViewGroup parent);
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaBitmap.java
================================================
package androlua;


import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.WeakHashMap;

public class LuaBitmap {
    static WeakHashMap<String, WeakReference<Bitmap>> cache = new WeakHashMap<String, WeakReference<Bitmap>>();

    private static int l;

    public static boolean checkCache(LuaContext context, String url) {
        // TODO: Implement this method
        String path = LuaManager.getInstance().getLuaExtDir() + "/" + url.hashCode();
        File f = new File(path);
        return f.exists();
    }

    public static Bitmap getLoacalBitmap(String url) throws FileNotFoundException, IOException {

        FileInputStream fis = new FileInputStream(url);
        Bitmap bitmap = BitmapFactory.decodeStream(fis);
        fis.close();
        return bitmap;
    }

    public static Bitmap getLoacalBitmap(LuaContext context, String url) {
        return decodeScale(1080, new File(url));
    }

    public static Bitmap getHttpBitmap(String url) throws IOException {
        //Log.d(TAG, url);
        URL myFileUrl = new URL(url);
        HttpURLConnection conn = (HttpURLConnection) myFileUrl.openConnection();
        //conn.setConnectTimeout(0);
        conn.setDoInput(true);
        conn.connect();
        InputStream is = conn.getInputStream();
        Bitmap bitmap = BitmapFactory.decodeStream(is);
        is.close();
        return bitmap;
    }

    public static Bitmap getHttpBitmap(LuaContext context, String url) throws IOException {
        //Log.d(TAG, url);
        String path = LuaManager.getInstance().getLuaExtDir() + "/" + url.hashCode();
        File f = new File(path);
        if (f.exists()) {
            try {
                /*HttpURLConnection con=(HttpURLConnection) new URL(url).openConnection();
                con.setRequestMethod("HEAD");
				con.setConnectTimeout(1000);
				con.connect();
				l = con.getContentLength();
				android.util.Log.d("lua",l+","+f.length());
				if(l==f.length())*/
                return decodeScale(1080, new File(path));
            } catch (Exception e) {
                return decodeScale(1080, new File(path));
            }
        }
        URL myFileUrl = new URL(url);
        HttpURLConnection conn = (HttpURLConnection) myFileUrl.openConnection();
        //conn.setConnectTimeout(0);
        conn.setDoInput(true);
        conn.connect();
        InputStream is = conn.getInputStream();
        FileOutputStream out = new FileOutputStream(path);
        //LuaUtil.copyFile(is, out);
        //Bitmap bitmap = BitmapFactory.decodeStream(is);
        Bitmap bitmap = decodeScale(1080, new File(path));
        is.close();
        return bitmap;
    }

    public static Bitmap getAssetBitmap(Context context, String name) throws IOException {
        AssetManager am = context.getAssets();
        InputStream is = am.open(name);
        Bitmap bitmap = BitmapFactory.decodeStream(is);
        is.close();
        return bitmap;
    }

    public static Bitmap getBitmap(LuaContext context, String path) throws IOException {

        WeakReference<Bitmap> wRef = cache.get(path);
        if (wRef != null) {
            Bitmap bt = wRef.get();
            if (bt != null)
                return bt;
        }

        Bitmap bitmap;
        if (path.indexOf("http://") == 0) {
            bitmap = getHttpBitmap(context, path);
        } else if (path.charAt(0) != '/') {
            bitmap = getLoacalBitmap(context, LuaManager.getInstance().getLuaDir() + "/" + path);
        } else {
            bitmap = getLoacalBitmap(context, path);
        }

        cache.put(path, new WeakReference<Bitmap>(bitmap));
        return bitmap;
    }

    private static Bitmap decodeScale(int IMAGE_MAX_SIZE, File fis) {
        Bitmap b = null;

        BitmapFactory.Options o = new BitmapFactory.Options();
        o.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(fis.getAbsolutePath(), o);
        int scale = 1;
        if (o.outHeight > IMAGE_MAX_SIZE || o.outWidth > IMAGE_MAX_SIZE) {
            scale = (int) Math.pow(2, (int) Math.round(Math.log(IMAGE_MAX_SIZE / (double) Math.max(o.outHeight, o.outWidth)) / Math.log(0.5)));
        }
        BitmapFactory.Options o2 = new BitmapFactory.Options();
        o2.inSampleSize = scale;

        b = BitmapFactory.decodeFile(fis.getAbsolutePath(), o2);


        return b;
    }

    public static Bitmap getImageFromPath(String filePath) {

        Bitmap bitmap = null;
        BitmapFactory.Options opts = new BitmapFactory.Options();
        opts.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(filePath, opts);

        //缩放图片,避免内存不足
        opts.inSampleSize = computeSampleSize(opts, -1, 250 * 250);
        opts.inJustDecodeBounds = false;

        try {
            bitmap = BitmapFactory.decodeFile(filePath, opts);
        } catch (Exception e) {
            // TODO: handle exception
        }
        return bitmap;
    }

    //缩放图片算法
    private static int computeSampleSize(BitmapFactory.Options options, int minSideLength, int maxNumOfPixels) {
        int initialSize = computeInitialSampleSize(options, minSideLength, maxNumOfPixels);
        int roundedSize;
        if (initialSize <= 8) {
            roundedSize = 1;
            while (roundedSize < initialSize) {
                roundedSize <<= 1;
            }
        } else {
            roundedSize = (initialSize + 7) / 8 * 8;
        }
        return roundedSize;
    }

    private static int computeInitialSampleSize(BitmapFactory.Options options, int minSideLength, int maxNumOfPixels) {
        double w = options.outWidth;
        double h = options.outHeight;
        int lowerBound = (maxNumOfPixels == -1) ? 1 : (int) Math.ceil(Math.sqrt(w * h / maxNumOfPixels));
        int upperBound = (minSideLength == -1) ? 128 : (int) Math.min(Math.floor(w / minSideLength), Math.floor(h / minSideLength));
        if (upperBound < lowerBound) {
            // return the larger one when there is no overlapping zone.
            return lowerBound;
        }
        if ((maxNumOfPixels == -1) && (minSideLength == -1)) {
            return 1;
        } else if (minSideLength == -1) {
            return lowerBound;
        } else {
            return upperBound;
        }
    }

    public static Bitmap getBitmapFromFile(File file, int width, int height) {

        BitmapFactory.Options opts = null;
        if (null != file && file.exists()) {

            if (width > 0 && height > 0) {
                opts = new BitmapFactory.Options();
                // 只是返回的是图片的宽和高,并不是返回一个Bitmap对象
                opts.inJustDecodeBounds = true;
                // 信息没有保存在bitmap里面,而是保存在options里面
                BitmapFactory.decodeFile(file.getPath(), opts);
                // 计算图片缩放比例
                final int minSideLength = Math.min(width, height);
                // 缩略图大小为原始图片大小的几分之一。根据业务需求来做。
                opts.inSampleSize = computeSampleSize(opts, minSideLength,
                        width * height);
                // 重新读入图片,注意此时已经把options.inJustDecodeBounds设回false
                opts.inJustDecodeBounds = false;
                // 设置是否深拷贝,与inPurgeable结合使用
                opts.inInputShareable = true;
                // 设置为True时,表示系统内存不足时可以被回 收,设置为False时,表示不能被回收。
                opts.inPurgeable = true;
            }
            try {
                return BitmapFactory.decodeFile(file.getPath(), opts);
            } catch (OutOfMemoryError e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaBroadcastReceiver.java
================================================
package androlua;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class LuaBroadcastReceiver extends BroadcastReceiver {

    private OnReceiveListener mRlt;

    public LuaBroadcastReceiver(OnReceiveListener rlt) {
        mRlt = rlt;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if (mRlt == null) {
            return;
        }
        mRlt.onReceive(context, intent);
    }

    public interface OnReceiveListener {
        void onReceive(Context context, Intent intent);
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaContext.java
================================================
package androlua;

public interface LuaContext {


}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaDexClassLoader.java
================================================
package androlua;

import java.util.HashMap;

import dalvik.system.DexClassLoader;

public class LuaDexClassLoader extends DexClassLoader {
    private HashMap<String, Class<?>> classCache = new HashMap();
    private String mDexPath;

    public LuaDexClassLoader(String dexPath, String optimizedDirectory, String libraryPath, ClassLoader parent) {
        super(dexPath, optimizedDirectory, libraryPath, parent);
        this.mDexPath = dexPath;
    }

    public String getDexPath() {
        return this.mDexPath;
    }

    protected Class<?> findClass(String name) throws ClassNotFoundException {
        Class<?> cls = (Class) this.classCache.get(name);
        if (cls != null) {
            return cls;
        }
        cls = super.findClass(name);
        this.classCache.put(name, cls);
        return cls;
    }
}

================================================
FILE: hydrogen-library/src/main/java/androlua/LuaDexLoader.java
================================================
package androlua;


import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.Resources.Theme;

import com.luajava.LuaException;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;

import dalvik.system.DexClassLoader;

public class LuaDexLoader {
    private static HashMap<String, LuaDexClassLoader> dexCache = new HashMap();
    private final LuaManager luaManager;
    private ArrayList<ClassLoader> dexList = new ArrayList();
    private HashMap<String, String> libCache = new HashMap();
    private String luaDir;
    private AssetManager mAssetManager;
    private LuaContext mContext;
    private Resources mResources;
    private Theme mTheme;
    private String odexDir;

    public LuaDexLoader() {
        luaManager = LuaManager.getInstance();
        this.luaDir = luaManager.getLuaDir();
        this.odexDir = luaManager.getOdexDir();
    }

    public Theme getTheme() {
        return this.mTheme;
    }

    public ArrayList<ClassLoader> getClassLoaders() {
        return this.dexList;
    }

    public void loadLibs() throws LuaException {
        File[] libs = new File(LuaManager.getInstance().getLuaExtDir() + "/libs").listFiles();
        if (libs != null) {
            for (File f : libs) {
                if (f.getAbsolutePath().endsWith(".so")) {
                    loadLib(f.getName());
                } else {
                    loadDex(f.getAbsolutePath());
                }
            }
        }
    }

    public void loadLib(String name) throws LuaException {
//        String fn = name;
//        int i = name.indexOf(".");
//        if (i > 0) {
//            fn = name.substring(0, i);
//        }
//        if (fn.startsWith("lib")) {
//            fn = fn.substring(3);
//        }
//        String libPath = this.mContext.getContext().getDir(fn, 0).getAbsolutePath() + "/lib" + fn + ".so";
//        if (!new File(libPath).exists()) {
//            if (new File(this.luaDir + "/libs/lib" + fn + ".so").exists()) {
//                LuaUtil.copyFile(this.luaDir + "/libs/lib" + fn + ".so", libPath);
//            } else {
//                throw new LuaException("can not find lib " + name);
//            }
//        }
//        this.libCache.put(fn, libPath);
    }

    public HashMap<String, String> getLibrarys() {
        return this.libCache;
    }

    public DexClassLoader loadDex(String path) throws LuaException {
        String name = path;
        LuaDexClassLoader dex = (LuaDexClassLoader) dexCache.get(name);
//        if (dex == null) {
//            if (path.charAt(0) != '/') {
//                path = this.luaDir + "/" + path;
//            }
//            if (!new File(path).exists()) {
//                if (new File(path + ".dex").exists()) {
//                    path = path + ".dex";
//                } else if (new File(path + ".jar").exists()) {
//                    path = path + ".jar";
//                } else {
//                    throw new LuaException(path + " not found");
//                }
//            }
//            dex = new LuaDexClassLoader(path, this.odexDir,luaManager.getContext().getApplicationInfo().nativeLibraryDir, this.mContext.getContext().getClassLoader());
//            dexCache.put(name, dex);
//        }
//        if (!this.dexList.contains(dex)) {
//            this.dexList.add(dex);
//            path = dex.getDexPath();
//            if (path.endsWith(".jar")) {
//                loadResources(path);
//            }
//        }
        return dex;
    }

    public void loadResources(String path) {
        try {
//            AssetManager assetManager = (AssetManager) AssetManager.class.newInstance();
//            if (((Integer) assetManager.getClass().getMethod("addAssetPath", new Class[]{String.class}).invoke(assetManager, new Object[]{path})).intValue() != 0) {
//                this.mAssetManager = assetManager;
//                Resources superRes = this.mContext.getContext().getResources();
//                this.mResources = new Resources(this.mAssetManager, superRes.getDisplayMetrics(), superRes.getConfiguration());
//                this.mTheme = this.mResources.newTheme();
//                this.mTheme.setTo(this.mContext.getContext().getTheme());
//            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public AssetManager getAssets() {
        return this.mAssetManager;
    }

    public Resources getResources() {
        return this.mResources;
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaDrawable.java
================================================
package androlua;


import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

import com.luajava.LuaException;
import com.luajava.LuaFunction;
import com.luajava.LuaObject;

import androlua.common.LuaLog;

public class LuaDrawable extends Drawable {
    private LuaObject mDraw;
    private final LuaContext mContext = this.mDraw.getLuaState().getContext();
    private LuaFunction mOnDraw;
    private Paint mPaint = new Paint();

    public LuaDrawable(LuaFunction func) {
        this.mDraw = func;
    }

    public static Drawable create(String filePath) {
        if (!filePath.startsWith("/")) {
            filePath = LuaManager.getInstance().getLuaExtDir() + "/" + filePath;
        }
        return new BitmapDrawable(LuaManager.getInstance().getContext().getResources(), BitmapFactory.decodeFile(filePath));
    }

    public void draw(Canvas p1) {
        try {
            if (this.mOnDraw == null) {
                Object r = this.mDraw.call(p1, this.mPaint, this);
                if (r != null && (r instanceof LuaFunction)) {
                    this.mOnDraw = (LuaFunction) r;
                }
            }
            if (this.mOnDraw != null) {
                this.mOnDraw.call(p1);
            }
        } catch (LuaException e) {
            LuaLog.e(e);
        }
    }

    public void setAlpha(int p1) {
        this.mPaint.setAlpha(p1);
    }

    public void setColorFilter(ColorFilter p1) {
        this.mPaint.setColorFilter(p1);
    }

    public int getOpacity() {
        return PixelFormat.UNKNOWN;
    }

    public Paint getPaint() {
        return this.mPaint;
    }
}

================================================
FILE: hydrogen-library/src/main/java/androlua/LuaFragment.java
================================================
package androlua;


import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by hanks on 2017/5/26. Copyright (C) 2017 Hanks
 */

public class LuaFragment extends Fragment {

    private FragmentCreator creator;

    public static LuaFragment newInstance() {
        Bundle args = new Bundle();
        LuaFragment fragment = new LuaFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onPause() {
        super.onPause();
        if (creator != null) {
            creator.onPause();
        }
    }

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if (creator != null) creator.onUserVisible(isVisibleToUser);
    }

    public void setCreator(FragmentCreator creator) {
        this.creator = creator;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (creator != null)creator.onAttach(context);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        if (creator != null)creator.onCreate(savedInstanceState);
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (creator != null) {
            return creator.onCreateView(inflater, container, savedInstanceState);
        }
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        if (creator != null)creator.onActivityCreated(savedInstanceState);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        if (creator != null)creator.onViewCreated(view, savedInstanceState);
    }


    @Override
    public void onStart() {
        if (creator != null) creator.onStart();
        super.onStart();
    }

    @Override
    public void onResume() {
        if (creator != null)creator.onResume();
        super.onResume();
    }

    @Override
    public void onStop() {
        if (creator != null)creator.onStop();
        super.onStop();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        if (creator != null)creator.onDestroyView();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (creator != null)creator.onDestroy();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        if (creator != null)creator.onDetach();
    }

    public interface FragmentCreator {
        void onCreate(@Nullable Bundle savedInstanceState);

        void onAttach(Context context);

        View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);

        void onActivityCreated(Bundle savedInstanceState);

        void onViewCreated(View view, @Nullable Bundle savedInstanceState);

        void onStart();

        void onResume();

        void onStop();

        void onPause();

        void onDestroyView();

        void onDestroy();

        void onDetach();

        void onUserVisible(boolean isVisibleToUser);

    }


}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaGcable.java
================================================
package androlua;


public interface LuaGcable {
    void gc();
}

================================================
FILE: hydrogen-library/src/main/java/androlua/LuaHttp.java
================================================
package androlua;

import android.support.annotation.NonNull;

import com.luajava.LuaException;
import com.luajava.LuaObject;
import com.luajava.LuaTable;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import androlua.common.LuaFileUtils;
import androlua.common.LuaLog;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
import pub.hanks.luajandroid.BuildConfig;

/**
 * context client for lua
 * Created by hanks on 2017/5/15. Copyright (C) 2017 Hanks
 */

public class LuaHttp {

    private static LuaHttp instance;
    private final OkHttpClient httpClient;

    private LuaHttp() {

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        if (!"release".equals(BuildConfig.BUILD_TYPE)) {
            builder.addInterceptor(interceptor);
        }
        httpClient = builder.build();

    }

    public static LuaHttp getInstance() {
        if (instance == null) {
            synchronized (LuaHttp.class) {
                if (instance == null) {
                    instance = new LuaHttp();
                }
            }
        }
        return instance;
    }

    public static void cancelAll() {
        getInstance().httpClient.dispatcher().cancelAll();
    }

    public static void request(final LuaTable options, final LuaObject callback) {
        getInstance().httpClient.newCall(buildRequest(options))
                .enqueue(new Callback() {
                    @Override
                    public void onFailure(Call call, IOException e) {
                        try {
                            callback.call(e);
                        } catch (LuaException e1) {
                            LuaLog.e(e1);
                        }
                    }

                    @Override
                    public void onResponse(Call call, Response response) throws IOException {
                        try {
                            Object o = options.get("outputFile");
                            if (o != null) {
                                InputStream inputStream = response.body().byteStream();
                                String filePath;
                                if (o instanceof String) {
                                    filePath = (String) o;
                                } else {
                                    filePath = o.toString();
                                }
                                String outputFile = LuaFileUtils.saveToFile(inputStream, filePath);
                                callback.call(null, response.code(), outputFile);
                                return;
                            }
                            callback.call(null, response.code(), response.body().string());
                        } catch (LuaException e) {
                            LuaLog.e(e);
                        }
                    }
                });
    }

    public static void requestSync(final LuaTable options, final LuaObject callback) {
        try {
            Response response = getInstance().httpClient.newCall(buildRequest(options)).execute();
            Object o = options.get("outputFile");
            if (o != null) {
                InputStream inputStream = response.body().byteStream();
                String filePath;
                if (o instanceof String) {
                    filePath = (String) o;
                } else {
                    filePath = o.toString();
                }
                String outputFile = LuaFileUtils.saveToFile(inputStream, filePath);
                callback.call(null, response.code(), outputFile);
                return;
            }
            callback.call(null, response.code(), response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @NonNull
    private static Request buildRequest(LuaTable options) {
        Request.Builder builder = new Request.Builder();
        String url = (String) options.get("url");
        builder.url(url);

        String method = (String) options.get("method");
        if ("GET".equals(method)) {
            builder.get();
        } else if ("POST".equals(method)) {
            RequestBody requestBody = getRequestBody(options);
            if (requestBody != null) {
                builder.post(requestBody);
            }
        } else if ("PUT".equals(method)) {
            RequestBody requestBody = getRequestBody(options);
            if (requestBody != null) {
                builder.put(requestBody);
            }
        } else if ("DELETE".equals(method)) {
            RequestBody requestBody = getRequestBody(options);
            if (requestBody != null) {
                builder.delete(requestBody);
            } else {
                builder.delete();
            }
        } else {
            builder.get();
        }

        LuaTable headers = (LuaTable) options.get("headers");
        if (headers != null) {
            for (Object key : headers.keySet()) {
                String value = (String) headers.get(key);
                int i = value.indexOf(":");
                if (i == -1) {
                    continue;
                }
                String[] header = new String[]{
                        value.substring(0, i),
                        value.substring(i + 1)
                };
                builder.header(header[0].trim(), header[1].trim());
            }
        }
        return builder.build();
    }

    private static RequestBody getRequestBody(LuaTable options) {

        String body = (String) options.get("body");
        if (body != null) {
            return RequestBody.create(MediaType.parse("application/json; charset=utf-8"), body);
        }


        Map formData = (Map) options.get("formData");
        if (formData != null) {
            FormBody.Builder bodyBuilder = new FormBody.Builder();
            for (Object key : formData.keySet()) {
                String value = (String) formData.get(key);
                int i = value.indexOf(":");
                if (i == -1) {
                    continue;
                }
                String[] params = new String[]{
                        value.substring(0, i),
                        value.substring(i + 1)
                };
                bodyBuilder.add(params[0].trim(), params[1].trim());
            }
            return bodyBuilder.build();
        }

        Map multipart = (Map) options.get("multipart");
        if (multipart != null) {
            MultipartBody.Builder bodyBuilder = new MultipartBody.Builder()
                    .setType(MultipartBody.FORM);
            for (Object key : multipart.keySet()) {
                String value = (String) multipart.get(key);
                int i = value.indexOf(":");
                if (i == -1) {
                    continue;
                }
                String[] params = new String[]{
                        value.substring(0, i),
                        value.substring(i + 1)
                };
                String itemKey = params[0].trim();
                String itemValue = params[1].trim();
                if (itemValue.startsWith("/")) {
                    File file = new File(itemValue);
                    if (file.exists()) {
                        bodyBuilder.addFormDataPart(itemKey, file.getName(),
                                RequestBody.create(MediaType.parse("image/png"), file));
                    }
                } else {
                    bodyBuilder.addFormDataPart(itemKey, itemValue);
                }
            }
            return bodyBuilder.build();
        }
        return new FormBody.Builder().build();
    }

    public static boolean downloadFile(String url, String savePath) {
        return downloadFile(url, savePath, null);
    }

    public static boolean downloadFile(String url, String savePath, ArrayList<String> headers) {
        try {
            final File file = new File(savePath);
            if (file.exists()) {
                return true;
            }
            OkHttpClient client = new OkHttpClient.Builder()
                    .connectTimeout(10, TimeUnit.SECONDS)
                    .writeTimeout(10, TimeUnit.SECONDS)
                    .readTimeout(30, TimeUnit.SECONDS)
                    .build();
            Request.Builder builder = new Request.Builder().url(url);
            if (headers != null) {
                for (String header : headers) {
                    int i = header.indexOf(":");
                    if (i <= 0) {
                        continue;
                    }
                    String key = header.substring(0, i);
                    String v = header.substring(i + 1);
                    builder.addHeader(key, v);
                }
            }
            final Request request = builder.build();
            Response response = client.newCall(request).execute();

            InputStream is = null;
            byte[] buf = new byte[2048];
            FileOutputStream fos = null;
            try {
                is = response.body().byteStream();
                fos = new FileOutputStream(file);
                int len = 0;
                while ((len = is.read(buf)) != -1) {
                    fos.write(buf, 0, len);
                }
                fos.flush();
            } catch (IOException e) {
                LuaLog.e(e);
            } finally {
                try {
                    if (is != null) {
                        is.close();
                    }
                    if (fos != null) {
                        fos.close();
                    }
                } catch (IOException e) {
                    LuaLog.e(e);
                }
            }
            return true;
        } catch (IOException e) {
            LuaLog.e(e);
            return false;
        }
    }

}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaImageLoader.java
================================================
package androlua;

import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.widget.ImageView;

import com.bumptech.glide.DrawableTypeRequest;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.load.model.LazyHeaders;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;

import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pub.hanks.luajandroid.R;

/**
 * user image loader
 * Created by hanks on 2017/5/12. Copyright (C) 2017 Hanks
 */

public class LuaImageLoader {

    public static void load(ImageView imageView, String uri) {
        load(imageView.getContext(), imageView, uri);
    }
    public static void loadWithRadius(ImageView imageView, float radius, String uri) {
        Context context = imageView.getContext();
        GradientDrawable gd = new GradientDrawable();
        gd.setCornerRadius(LuaUtil.dp2px(radius));
        gd.setColor(0xffebf0f2);
        load(context, imageView, uri, radius, 0, gd, gd);

    }

    public static void load(Context context, ImageView imageView, String uri) {

        load(context, imageView, uri, 0, 0,
                ContextCompat.getDrawable(context, R.drawable.ic_loading),
                ContextCompat.getDrawable(context, R.drawable.ic_loading));
    }

    public static void load(Context context, ImageView imageView, String uri, float radius, float blueRadius,
                            Drawable placeholderDrawable, Drawable errorDrawable) {
        if (imageView == null || uri == null) {
            return;
        }
        boolean loadLocal = false;
        if (uri.startsWith("#")) { // load local file
            uri = uri.substring(1);
            loadLocal = true;
        }

        if (!uri.startsWith("http://") && !uri.startsWith("https://")
                && !uri.startsWith("content://") && !uri.startsWith("file://")) {
            String path = uri;
            if (!uri.startsWith("/")) {
                path = LuaManager.getInstance().getLuaExtDir() + "/" + uri;
            }
            if (loadLocal) {
                imageView.setImageBitmap(BitmapFactory.decodeFile(path));
                return;
            }
            uri = "file://" + path;
        }
        DrawableTypeRequest manager = Glide.with(context).load(uri);
        BlurTransformation blurTransformation = null;
        RoundedCornersTransformation roundedCornersTransformation = null;

        if (radius > 0){
            roundedCornersTransformation = new RoundedCornersTransformation(context, LuaUtil.dp2px(radius), 0);
        }
        if (blueRadius > 0) {
            blurTransformation = new BlurTransformation(context, (int) blueRadius);
        }
        if (radius > 0 && blueRadius > 0) {
            manager.bitmapTransform(new CenterCrop(context),roundedCornersTransformation, blurTransformation);
        } else if (radius > 0) {
            manager.bitmapTransform(new CenterCrop(context),roundedCornersTransformation);
        } else if (blueRadius > 0) {
            manager.bitmapTransform(new CenterCrop(context),blurTransformation);
        }
        manager
                .placeholder(placeholderDrawable)
                .error(errorDrawable)
                .crossFade()
                .into(imageView);
    }

    public static void load(ImageView imageView, String uri, String referer) {
        if (imageView == null || uri == null) {
            return;
        }
        LazyHeaders headers = new LazyHeaders.Builder()
                .addHeader("Referer", referer)
                .build();
        GlideUrl glideUrl = new GlideUrl(uri, headers);
        Glide.with(imageView.getContext())
                .load(glideUrl)
                .placeholder(R.drawable.ic_loading)
                .error(R.drawable.ic_loading)
                .crossFade()
                .into(imageView);
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaManager.java
================================================
package androlua;

import android.content.Context;

import com.luajava.JavaFunction;
import com.luajava.LuaException;
import com.luajava.LuaObject;
import com.luajava.LuaState;
import com.luajava.LuaStateFactory;

import java.io.File;

import androlua.common.LuaFileUtils;
import androlua.common.LuaLog;
import dalvik.system.DexClassLoader;

public class LuaManager {

    private static LuaManager instance;
    private Context context;
    private String odexDir;
    private String libDir; // 外部 so 文件路径
    private String luaDir; // 内部 lua 文件路径
    private String luaExtDir; // 外部 lua 文件路径
    private String luaCpath; // 相当于 LUA_CPATH
    private String luaLpath; // 相当于 LUA_PATH
    private boolean debugable = true;

    private LuaManager() {

    }

    public static LuaManager getInstance() {
        if (instance == null) {
            synchronized (LuaManager.class) {
                if (instance == null) {
                    instance = new LuaManager();
                }
            }
        }
        return instance;
    }

    public void init(Context context) {
        this.context = context;
        // 注册crashHandler
        // CrashHandler crashHandler = CrashHandler.getInstance();
        // crashHandler.init(context.getApplicationContext());

        //初始化AndroLua工作目录
        luaExtDir = LuaFileUtils.getAndroLuaDir();
        //定义文件夹
        odexDir = context.getDir("odex", Context.MODE_PRIVATE).getAbsolutePath();
        libDir = context.getDir("lib", Context.MODE_PRIVATE).getAbsolutePath();
        luaDir = context.getDir("lua", Context.MODE_PRIVATE).getAbsolutePath();
        luaCpath = context.getApplicationInfo().nativeLibraryDir + "/lib?.so" + ";" + libDir + "/lib?.so";
        luaLpath = luaDir + "/?.lua;" + luaDir + "/lua/?.lua;" + luaDir + "/?/initEnv.lua;" + luaExtDir + "/?.lua;";
    }

    public boolean isDebugable() {
        return debugable;
    }

    public LuaManager setDebugable(boolean debugable) {
        this.debugable = debugable;
        return this;
    }

    //运行lua脚本
    public Object doFile(LuaState L, String filePath) throws LuaException {
        return doFile(L, filePath, new Object[0]);
    }

    public Object doFile(LuaState L, String filePath, Object[] args) throws LuaException {
        appendLuaDir(L, filePath);
        int ok = 0;
        L.setTop(0);
        ok = L.LloadFile(filePath);
        if (ok == 0) {
            L.getGlobal("debug");
            L.getField(-1, "traceback");
            L.remove(-2);
            L.insert(-2);
            int l = args.length;
            for (Object arg : args) {
                L.pushObjectValue(arg);
            }
            ok = L.pcall(l, 1, -2 - l);
            if (ok == 0) {
                return L.toJavaObject(-1);
            }
        }
        throw new LuaException(errorReason(ok) + ": " + L.toString(-1));
    }


    //运行lua函数
    public Object runFunc(LuaState L, String funcName, Object... args) {
        try {
            L.setTop(0);
            L.getGlobal(funcName);
            if (L.isFunction(-1)) {
                L.getGlobal("debug");
                L.getField(-1, "traceback");
                L.remove(-2);
                L.insert(-2);
                int argsLength = args.length;
                for (Object arg : args) {
                    L.pushObjectValue(arg);
                }
                int ok = L.pcall(argsLength, 1, -2 - argsLength);
                if (ok == 0) {
                    return L.toJavaObject(-1);
                }
                throw new LuaException(errorReason(ok) + ": " + L.toString(-1));
            }
        } catch (LuaException e) {
            LuaLog.e(e);
        }
        return null;
    }

    //运行lua代码
    public Object doString(LuaState L, String funcSrc, Object... args) throws LuaException {
        L.setTop(0);
        int ok = L.LloadString(funcSrc);
        if (ok == 0) {
            L.getGlobal("debug");
            L.getField(-1, "traceback");
            L.remove(-2);
            L.insert(-2);
            int l = args.length;
            for (Object arg : args) {
                L.pushObjectValue(arg);
            }
            ok = L.pcall(l, 1, -2 - l);
            if (ok == 0) {
                return L.toJavaObject(-1);
            }
        }
        throw new LuaException(errorReason(ok) + ": " + L.toString(-1));
    }


    public DexClassLoader loadDex(ClassLoader parent, String path) throws LuaException {
        if (path.charAt(0) != '/')
            path = getLuaDir() + "/" + path;
        if (!new File(path).exists())
            if (new File(path + ".dex").exists())
                path += ".dex";
            else if (new File(path + ".jar").exists())
                path += ".jar";
            else
                throw new LuaException(path + " not found");
        return new DexClassLoader(path, odexDir, getContext().getApplicationInfo().nativeLibraryDir, parent);
    }

    public Object loadLib(LuaState L, String soPath) throws LuaException {
        if (!soPath.startsWith("/")) {
            soPath = libDir + "/" + soPath;
        }
        File soFile = new File(soPath);
        if (!soFile.exists()) {
            throw new LuaException("can not find lib " + soFile.getAbsolutePath());
        }
        if (!libDir.equals(soFile.getParent())) {
            LuaUtil.copyFile(soFile.getAbsolutePath(), libDir + "/lib" + soFile.getName() + ".so");
        }
        LuaObject require = L.getLuaObject("require");
        return require.call(soFile.getName());
    }

    //生成错误信息
    private String errorReason(int error) {
        switch (error) {
            case 6:
                return "error error";
            case 5:
                return "GC error";
            case 4:
                return "Out of memory";
            case 3:
                return "Syntax error";
            case 2:
                return "Runtime error";
            case 1:
                return "Yield error";
        }
        return "Unknown error " + error;
    }

    public void appendSoDir(String dir) {
        if (!dir.startsWith("/")) {
            dir = getLibDir() + "/" + dir;
        }
        if (dir.endsWith(".so")) {
            dir = dir.substring(0, dir.lastIndexOf('/'));
        }
        String newPath = String.format(";%s/?.so", dir);
        if (luaCpath.contains(newPath)) {
            return;
        }
        luaCpath += newPath;
    }

    public void appendLuaDir(LuaState L, String dir) {
        if (!dir.startsWith("/")) {
            dir = getLuaExtDir() + "/" + dir;
        }
        if (dir.endsWith(".lua")) {
            dir = dir.substring(0, dir.lastIndexOf('/'));
        }
        String newPath = String.format(";%s/?.lua", dir);
        if (luaLpath.contains(newPath)) {
            return;
        }
        luaLpath += newPath;
        initLuaPath(L);
    }

    public Context getContext() {
        return context;
    }

    public String getOdexDir() {
        return odexDir;
    }

    public String getLibDir() {
        return libDir;
    }

    public String getLuaDir() {
        return luaDir;
    }

    public String getLuaExtDir() {
        return luaExtDir;
    }

    public String getLuaCpath() {
        return luaCpath;
    }

    public String getLuaLpath() {
        return luaLpath;
    }


    public LuaState initLua() {
        try {
            LuaState L = LuaStateFactory.newLuaState();
            L.openLibs();

//            // push 一个 context
//            L.pushJavaObject(getContext());
//            // pop 并赋值给 activity
//            L.setGlobal("activity");
//
//            // 把全局变量 activity 的值 push 进栈
//            L.getGlobal("activity");
//            // pop 并赋值给 this
//            L.setGlobal("this");
//
////            L.pushJavaObject(this);
////            L.getGlobal("luajava");
//
//            L.pushString(getLuaExtDir());
//            L.setField(-2, "luaextdir");
//
//            L.pushString(getLuaDir());
//            L.setField(-2, "luadir");
//
//
//            L.pushString(getLuaLpath());
//            L.setField(-2, "luapath");
//
//            // 彈出一个元素
//            L.pop(1);

            // 注册全局函数 print
            JavaFunction print = new LuaPrint(L);
            print.register("print");

            initLuaPath(L);
            L.pop(1);
            return L;
        } catch (LuaException e) {
            e.printStackTrace();
            return null;
        }
    }

    private void initLuaPath(LuaState L) {
        L.getGlobal("package");
        L.pushString(getLuaLpath());
        L.setField(-2, "path");
        L.pushString(getLuaCpath());
        L.setField(-2, "cpath");
    }
}





================================================
FILE: hydrogen-library/src/main/java/androlua/LuaPrint.java
================================================
package androlua;


import android.util.Log;

import com.luajava.JavaFunction;
import com.luajava.LuaException;
import com.luajava.LuaState;

import androlua.common.LuaLog;

public class LuaPrint extends JavaFunction {

    private LuaState L;
    private StringBuilder output = new StringBuilder();

    public LuaPrint(LuaState L) {
        super(L);
        this.L = L;
    }

    @Override
    public int execute() throws LuaException {
        if (L.getTop() < 2) {
            LuaLog.e("error print");
            return 0;
        }
        for (int i = 2; i <= L.getTop(); i++) {
            int type = L.type(i);
            String val = null;
            String stype = L.typeName(type);
            if (stype.equals("userdata")) {
                Object obj = L.toJavaObject(i);
                if (obj != null)
                    val = obj.toString();
            } else if (stype.equals("boolean")) {
                val = L.toBoolean(i) ? "true" : "false";
            } else {
                val = L.toString(i);
            }
            if (val == null)
                val = stype;
            output.append("\t");
            output.append(val);
            output.append("\t");
        }
        Log.e("Luandroid", output.toString().substring(1, output.length() - 1));
        output.setLength(0);
        return 0;
    }


}



================================================
FILE: hydrogen-library/src/main/java/androlua/LuaTimer.java
================================================
package androlua;


public class LuaTimer {
//    private LuaTimerTask task;
//
//    public LuaTimer(LuaContext main, String src) throws LuaException {
//        this(main, src, null);
//    }
//
//    public LuaTimer(LuaContext main, String src, Object[] arg) throws LuaException {
//        super("LuaTimer");
//        this.task = new LuaTimerTask(main, src, arg);
//    }
//
//    public LuaTimer(LuaContext main, LuaObject func) throws LuaException {
//        this(main, func, null);
//    }
//
//    public LuaTimer(LuaContext main, LuaObject func, Object[] arg) throws LuaException {
//        super("LuaTimer");
//        this.task = new LuaTimerTask(main, func, arg);
//    }
//
//    public void gc() {
//        stop();
//    }
//
//    public void start(long delay, long period) {
//        schedule(this.task, delay, period);
//    }
//
//    public void start(long delay) {
//        schedule(this.task, delay);
//    }
//
//    public void stop() {
//        this.task.cancel();
//    }
//
//    public boolean isEnabled() {
//        return this.task.isEnabled();
//    }
//
//    public boolean getEnabled() {
//        return this.task.isEnabled();
//    }
//
//    public void setEnabled(boolean enabled) {
//        this.task.setEnabled(enabled);
//    }
//
//    public long getPeriod() {
//        return this.task.getPeriod();
//    }
//
//    public void setPeriod(long period) {
//        this.task.setPeriod(period);
//    }
}

================================================
FILE: hydrogen-library/src/main/java/androlua/LuaUtil.java
================================================
package androlua;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;

import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import androlua.common.LuaStringUtils;

public class LuaUtil {


    /**
     * 截屏
     *
     * @param activity
     * @return
     */
    public static Bitmap captureScreen(Activity activity) {
        // 获取屏幕大小:
        DisplayMetrics metrics = new DisplayMetrics();
        WindowManager WM = (WindowManager) activity
                .getSystemService(Context.WINDOW_SERVICE);
        Display display = WM.getDefaultDisplay();
        display.getMetrics(metrics);
        int height = metrics.heightPixels; // 屏幕高
        int width = metrics.widthPixels; // 屏幕的宽
        // 获取显示方式
        int pixelformat = display.getPixelFormat();
        PixelFormat localPixelFormat1 = new PixelFormat();
        PixelFormat.getPixelFormatInfo(pixelformat, localPixelFormat1);
        int deepth = localPixelFormat1.bytesPerPixel;// 位深
        byte[] piex = new byte[height * width * deepth];
        try {
            Runtime.getRuntime().exec(
                    new String[]{"/system/bin/su", "-c",
                            "chmod 777 /dev/graphics/fb0"});
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            // 获取fb0数据输入流
            InputStream stream = new FileInputStream(new File(
                    "/dev/graphics/fb0"));
            DataInputStream dStream = new DataInputStream(stream);
            dStream.readFully(piex);
        } catch (Exception e) {
            e.printStackTrace();
        }
        // 保存图片
        int[] colors = new int[height * width];
        for (int m = 0; m < colors.length; m++) {
            int r = (piex[m * 4] & 0xFF);
            int g = (piex[m * 4 + 1] & 0xFF);
            int b = (piex[m * 4 + 2] & 0xFF);
            int a = (piex[m * 4 + 3] & 0xFF);
            colors[m] = (a << 24) + (r << 16) + (g << 8) + b;
        }
        // piex生成Bitmap
        Bitmap bitmap = Bitmap.createBitmap(colors, width, height,
                Bitmap.Config.ARGB_8888);
        return bitmap;
    }

    public static byte[] readAsset(Context context, String name) throws IOException {
        AssetManager am = context.getAssets();
        InputStream is = am.open(name);
        byte[] ret = readAll(is);
        is.close();
        //am.close();
        return ret;
    }

    //读取asset文件

    private static byte[] readAll(InputStream input) throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream(4096);
        byte[] buffer = new byte[4096];
        int n = 0;
        while (-1 != (n = input.read(buffer))) {
            output.write(buffer, 0, n);
        }
        byte[] ret = output.toByteArray();
        output.close();
        return ret;
    }

    //复制asset文件到sd卡
    public static void assetsToSD(Context context, String InFileName, String OutFileName) throws IOException {
        InputStream myInput;
        OutputStream myOutput = new FileOutputStream(OutFileName);
        myInput = context.getAssets().open(InFileName);
        byte[] buffer = new byte[8192];
        int length = myInput.read(buffer);
        while (length > 0) {
            myOutput.write(buffer, 0, length);
            length = myInput.read(buffer);
        }

        myOutput.flush();
        myInput.close();
        myOutput.close();
    }

    public static void copyFile(String oldPath, String newPath) {
        try {
            int bytesum = 0;
            int byteread = 0;
            File oldfile = new File(oldPath);
            if (oldfile.exists()) { //文件存在时
                InputStream inStream = new FileInputStream(oldPath); //读入原文件
                FileOutputStream fs = new FileOutputStream(newPath);
                byte[] buffer = new byte[4096];
                int length;
                while ((byteread = inStream.read(buffer)) != -1) {
                    bytesum += byteread; //字节数 文件大小
                    System.out.println(bytesum);
                    fs.write(buffer, 0, byteread);
                }
                inStream.close();
            }
        } catch (Exception e) {
            System.out.println("复制文件操作出错");
            e.printStackTrace();

        }

    }

    public static void rmDir(File dir) {
        File[] fs = dir.listFiles();
        for (File f : fs) {
            if (f.isDirectory())
                rmDir(f);
            else
                f.delete();
        }
        dir.delete();
    }

    public static void rmDir(File dir, String ext) {
        File[] fs = dir.listFiles();
        for (File f : fs) {
            if (f.isDirectory())
                rmDir(f);
            else if (f.getName().endsWith(ext))
                f.delete();
        }
        //dir.delete();
    }

    public static Context getContext() {
        return LuaManager.getInstance().getContext();
    }

    public static float getDensity() {
        return getContext().getResources().getDisplayMetrics().density;
    }

    public static int dp2px(float dp) {
        float density = getContext().getResources().getDisplayMetrics().density;
        return (int) (0.5F + dp * density);
    }

    public static int getScreenWidth() {
        return getContext().getResources().getDisplayMetrics().widthPixels;
    }

    protected int getStatusBarHeight() {
        int identifier = getContext().getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (identifier > 0) {
            return getContext().getResources().getDimensionPixelSize(identifier);
        }
        return 0;
    }

    public static class IntentHelper {
        public static String getLuaPath(Intent intent) {
            String luaPath = intent.getStringExtra("luaPath");
            return LuaStringUtils.isEmpty(luaPath) ? "main.lua" : luaPath;

        }

        public static Object[] getArgs(Intent intent) {
            Object[] arg = (Object[]) intent.getSerializableExtra("arg");
            if (arg == null)
                arg = new Object[0];
            return arg;
        }
    }

    public static boolean isWifi(){
        ConnectivityManager cm =
                (ConnectivityManager)getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        return activeNetwork != null &&
                activeNetwork.isConnectedOrConnecting() && activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;
    }

}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaView.java
================================================
package androlua;

import android.content.Context;
import android.graphics.Canvas;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

/**
 * custom view
 * Created by hanks on 2017/6/6.
 */

public class LuaView extends View {

    private Creator creator;

    public LuaView(Context context) {
        this(context, null);
    }

    public LuaView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public LuaView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        if (creator != null) {
            creator.init(context, attrs, defStyleAttr);
        }
    }

    public void setCreator(Creator creator) {
        this.creator = creator;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        if (creator != null) {
            creator.onMeasure(widthMeasureSpec, heightMeasureSpec);
        }
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        if (creator != null) {
            creator.onFinishInflate();
        }
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (creator != null) {
            creator.onDraw(canvas);
        }
    }

    public interface Creator {
        void init(Context context, @Nullable AttributeSet attrs, int defStyleAttr);

        void onDraw(Canvas canvas);

        void onFinishInflate();

        void onMeasure(int widthMeasureSpec, int heightMeasureSpec);
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/LuaWebView.java
================================================
package androlua;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.support.v7.app.AlertDialog;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.HttpAuthHandler;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.luajava.LuaException;
import com.luajava.LuaObject;

/**
 * LuaWebView
 * Created by hanks on 2017/5/27.
 */
public class LuaWebView extends WebView {
    private WebChromeClientListener webChromeClientListener;
    private WebViewClientListener webViewClientListener;

    public LuaWebView(Context context) {
        this(context, null);
    }

    public LuaWebView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public LuaWebView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        if (Build.VERSION.SDK_INT >= 19) {
            setLayerType(View.LAYER_TYPE_HARDWARE, null);
        } else {
            setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        }
        WebSettings setting = getSettings();
        setting.setSupportZoom(false);
        setting.setBuiltInZoomControls(false);
        setting.setDefaultFontSize(14);
        setting.setDefaultFixedFontSize(14);
        setting.setUseWideViewPort(true);
        setting.setLoadWithOverviewMode(true);
        setting.setDomStorageEnabled(true);
        setting.setAllowContentAccess(true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            setting.setAllowFileAccessFromFileURLs(true);
        }
        setting.setAppCacheEnabled(true);
        setting.setDatabaseEnabled(true);
        setting.setSaveFormData(true);
        setting.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
        setting.setAllowFileAccess(true);
        setting.setJavaScriptEnabled(true);
        setWebChromeClient(new LuaWebChromeClient());
        setWebViewClient(new LuaWebViewClient());
        if (Build.VERSION.SDK_INT >= 19) {
            setWebContentsDebuggingEnabled(true);
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            setting.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
        }

        setFocusable(true);
        setFocusableInTouchMode(true);
    }

    public void release() {
        if (getParent() == null || !(getParent() instanceof ViewGroup)) {
            return;
        }
        ((ViewGroup) getParent()).removeView(this);
        destroy();
    }


    public void injectObjectToJavascript(LuaObject luaObject, String objectName) {
        addJavascriptInterface(new JavascriptInterface(luaObject), objectName);
    }

    public void setWebChromeClientListener(WebChromeClientListener webChromeClientListener) {
        this.webChromeClientListener = webChromeClientListener;
    }

    public void setWebViewClientListener(WebViewClientListener webViewClientListener) {
        this.webViewClientListener = webViewClientListener;
    }

    public interface WebViewClientListener {
        boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request);

        boolean shouldOverrideKeyEvent(WebView view, KeyEvent event);

        WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request);

        void onPageFinished(WebView view, String url);

        void onPageStarted(WebView view, String url, Bitmap favicon);

        void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error);

    }

    public interface WebChromeClientListener {

        void onProgressChanged(WebView view, int newProgress);

        void onReceivedTitle(WebView view, String title);

        void onReceivedIcon(WebView view, Bitmap icon);

        void onReceivedTouchIconUrl(WebView view, String url, boolean precomposed);
    }

    public static class JavascriptInterface {
        private final LuaObject luaObject;

        public JavascriptInterface(LuaObject luaObject) {
            this.luaObject = luaObject;
        }

        @android.webkit.JavascriptInterface
        public void call(String json) {
            try {
                luaObject.call(json);
            } catch (LuaException e) {
                e.printStackTrace();
            }
        }
    }

    public class LuaWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (url.startsWith("hydrogen://")) {
                Intent intent = new Intent();
                intent.setAction(Intent.ACTION_VIEW);
                intent.addCategory(Intent.CATEGORY_BROWSABLE);
                intent.addCategory(Intent.CATEGORY_DEFAULT);
                intent.setData(Uri.parse(url));
                if (intent.resolveActivity(view.getContext().getPackageManager()) != null) {
                    view.getContext().startActivity(intent);
                }
                return true;
            }
            return super.shouldOverrideUrlLoading(view, url);
        }

        @Override
        public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
            try {
                Context context = getContext();
                if (context == null || !(context instanceof Activity)) {
                    super.onReceivedSslError(view, handler, error);
                    return;
                }
                new AlertDialog.Builder(context)
                        .setMessage("error ssl cert invalid")
                        .setPositiveButton("continue", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                handler.proceed();
                            }
                        }).setNegativeButton("cancel", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        handler.cancel();
                    }
                }).show();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {

            if (webViewClientListener != null) {
                return webViewClientListener.shouldOverrideUrlLoading(view, request);
            }
            return super.shouldOverrideUrlLoading(view, request);
        }

        @Override
        public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
            return super.shouldOverrideKeyEvent(view, event);
        }

        @Override
        public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
            handler.proceed(host.trim(), realm.trim());
        }

        @Override
        public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
            super.onReceivedHttpError(view, request, errorResponse);
        }

        @Override
        public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
            if (webViewClientListener != null) {
                return webViewClientListener.shouldInterceptRequest(view, request);
            }
            return super.shouldInterceptRequest(view, request);
        }

        @Override
        public void onPageFinished(WebView view, String url) {
            if (webViewClientListener != null) {
                webViewClientListener.onPageFinished(view, url);
            }
            super.onPageFinished(view, url);
        }

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            if (webViewClientListener != null) {
                webViewClientListener.onPageStarted(view, url, favicon);
            }
            super.onPageStarted(view, url, favicon);
        }

        @Override
        public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
            if (webViewClientListener != null) {
                webViewClientListener.onReceivedError(view, request, error);
            }
            super.onReceivedError(view, request, error);
        }
    }

    public class LuaWebChromeClient extends WebChromeClient {

        @Override
        public void onProgressChanged(WebView view, int newProgress) {
            if (webChromeClientListener != null) {
                webChromeClientListener.onProgressChanged(view, newProgress);
            }
            super.onProgressChanged(view, newProgress);
        }

        @Override
        public void onReceivedTitle(WebView view, String title) {
            if (webChromeClientListener != null) {
                webChromeClientListener.onReceivedTitle(view, title);
            }
            super.onReceivedTitle(view, title);
        }

        @Override
        public void onReceivedIcon(WebView view, Bitmap icon) {
            if (webChromeClientListener != null) {
                webChromeClientListener.onReceivedIcon(view, icon);
            }
            super.onReceivedIcon(view, icon);
        }

        @Override
        public void onReceivedTouchIconUrl(WebView view, String url, boolean precomposed) {
            if (webChromeClientListener != null) {
                webChromeClientListener.onReceivedTouchIconUrl(view, url, precomposed);
            }
            super.onReceivedTouchIconUrl(view, url, precomposed);
        }
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/NineBitmapDrawable.java
================================================
package androlua;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

import java.io.IOException;

public class NineBitmapDrawable extends Drawable {
    private Paint mPaint = new Paint();
    private Bitmap mBitmap;

    private int mX1;
    private int mY1;
    private int mX2;
    private int mY2;

    private Rect mRect1;
    private Rect mRect2;
    private Rect mRect3;

    private Rect mRect4;
    private Rect mRect5;
    private Rect mRect6;

    private Rect mRect7;
    private Rect mRect8;
    private Rect mRect9;

    public NineBitmapDrawable(String path) throws IOException {
        this(LuaBitmap.getLoacalBitmap(path));
    }

    public NineBitmapDrawable(Bitmap bitmap) {
        int w = bitmap.getWidth();
        int h = bitmap.getHeight();
        int c = Color.BLACK;
        int x1 = 0;
        int x2 = 0;
        for (int i = 0; i < w; i++) {
            if (bitmap.getPixel(i, 0) == c) {
                x1 = i;
                break;
            }
        }
        if (x1 == 0 || x1 == w - 1)
            throw new IllegalArgumentException("not found x1");
        for (int i = x1; i < w; i++) {
            if (bitmap.getPixel(i, 0) != c) {
                x2 = w - i;
                break;
            }
        }
        if (x2 == 0 || x2 == 1)
            throw new IllegalArgumentException("not found x2");

        int y1 = 0;
        int y2 = 0;
        for (int i = 0; i < h; i++) {
            if (bitmap.getPixel(0, i) == c) {
                y1 = i;
                break;
            }
        }
        if (y1 == 0 || y1 == h - 1)
            throw new IllegalArgumentException("not found y1");
        for (int i = y1; i < h; i++) {
            if (bitmap.getPixel(0, i) != c) {
                y2 = h - i;
                break;
            }
        }
        if (y2 == 0 || y2 == 1)
            throw new IllegalArgumentException("not found y2");

        init(bitmap, x1, y1, x2, y2);
    }


    public NineBitmapDrawable(Bitmap bitmap, int x1, int y1, int x2, int y2) {
        init(bitmap, x1, y1, x2, y2);
    }

    private void init(Bitmap bitmap, int x1, int y1, int x2, int y2) {
        mBitmap = bitmap;
        int w = bitmap.getWidth();
        int h = bitmap.getHeight();

        mX1 = x1;
        mY1 = y1;
        mX2 = x2;
        mY2 = y2;

        x2 = w - x2;
        y2 = h - y2;
        mRect1 = new Rect(1, 1, x1, y1);
        mRect2 = new Rect(x1, 1, x2, y1);
        mRect3 = new Rect(x2, 1, w - 1, y1);

        mRect4 = new Rect(1, y1, x1, y2);
        mRect5 = new Rect(x1, y1, x2, y2);
        mRect6 = new Rect(x2, y1, w - 1, y2);

        mRect7 = new Rect(1, y2, x1, h - 1);
        mRect8 = new Rect(x1, y2, x2, h - 1);
        mRect9 = new Rect(x2, y2, w - 1, h - 1);
    }

    @Override
    public void draw(Canvas canvas) {

        Rect rect = getBounds();
        int w = rect.right;
        int h = rect.bottom;

        Rect rect1 = new Rect(0, 0, mX1, mY1);
        Rect rect2 = new Rect(mX1, 0, w - mX2, mY1);
        Rect rect3 = new Rect(w - mX2, 0, w, mY1);

        Rect rect4 = new Rect(0, mY1, mX1, h - mY2);
        Rect rect5 = new Rect(mX1, mY1, w - mX2, h - mY2);
        Rect rect6 = new Rect(w - mX2, mY1, w, h - mY2);

        Rect rect7 = new Rect(0, h - mY2, mX1, h);
        Rect rect8 = new Rect(mX1, h - mY2, w - mX2, h);
        Rect rect9 = new Rect(w - mX2, h - mY2, w, h);

        canvas.drawBitmap(mBitmap, mRect1, rect1, mPaint);
        canvas.drawBitmap(mBitmap, mRect2, rect2, mPaint);
        canvas.drawBitmap(mBitmap, mRect3, rect3, mPaint);

        canvas.drawBitmap(mBitmap, mRect4, rect4, mPaint);
        canvas.drawBitmap(mBitmap, mRect5, rect5, mPaint);
        canvas.drawBitmap(mBitmap, mRect6, rect6, mPaint);

        canvas.drawBitmap(mBitmap, mRect7, rect7, mPaint);
        canvas.drawBitmap(mBitmap, mRect8, rect8, mPaint);
        canvas.drawBitmap(mBitmap, mRect9, rect9, mPaint);
    }

    @Override
    public void setAlpha(int p1) {
        mPaint.setAlpha(p1);
    }

    @Override
    public void setColorFilter(ColorFilter p1) {
        mPaint.setColorFilter(p1);
    }

    @Override
    public int getOpacity() {
        return PixelFormat.UNKNOWN;
    }

}


================================================
FILE: hydrogen-library/src/main/java/androlua/adapter/LuaFragmentPageAdapter.java
================================================
package androlua.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by hanks on 2017/5/26. Copyright (C) 2017 Hanks
 */

public class LuaFragmentPageAdapter extends FragmentPagerAdapter {

    private AdapterCreator creator;

    public LuaFragmentPageAdapter(FragmentManager fm, AdapterCreator creator) {
        super(fm);
        this.creator = creator;
    }

    @Override
    public Fragment getItem(int position) {
        return creator.getItem(position);
    }

    @Override
    public int getCount() {
        return (int) creator.getCount();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return creator.getPageTitle(position);
    }

    public interface AdapterCreator {
        long getCount();

        Fragment getItem(int position);

        String getPageTitle(int position);
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/adapter/LuaPagerAdapter.java
================================================
package androlua.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import com.luajava.LuaTable;

import java.util.ArrayList;
import java.util.List;

/**
 * adapter for viewpager
 * Created by hanks on 2017/5/13.
 */

public class LuaPagerAdapter extends PagerAdapter {

    public List<View> mListViews = new ArrayList<>();

    public LuaPagerAdapter(LuaTable luaTable) {
        addViews(luaTable);
    }

    public void addViews(LuaTable luaTable) {
        if (luaTable == null) {
            return;
        }
        int size = luaTable.keySet().size();
        for (int i = 1; i <= size; i++) {
            Object v = luaTable.get(i);
            if (v != null && v instanceof View) {
                mListViews.add((View) v);
            }
        }
    }

    @Override
    public int getCount() {
        return mListViews != null ? mListViews.size() : 0;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        View view = mListViews.get(position);
        container.addView(view);
        return view;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView((View) object);
    }

}


================================================
FILE: hydrogen-library/src/main/java/androlua/adapter/LuaRecyclerAdapter.java
================================================
package androlua.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

/**
 * Created by hanks on 2017/5/31. Copyright (C) 2017 Hanks
 */

public class LuaRecyclerAdapter extends RecyclerView.Adapter {

    AdapterCreator adapterCreator;

    public LuaRecyclerAdapter(AdapterCreator adapterCreator) {
        this.adapterCreator = adapterCreator;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return adapterCreator.onCreateViewHolder(parent, viewType);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        adapterCreator.onBindViewHolder(holder, position);
    }

    @Override
    public int getItemViewType(int position) {
        return (int) adapterCreator.getItemViewType(position);
    }

    @Override
    public int getItemCount() {
        return (int) adapterCreator.getItemCount();
    }

    public interface AdapterCreator {
        RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType);

        void onBindViewHolder(RecyclerView.ViewHolder holder, int position);

        long getItemViewType(int position);

        long getItemCount();
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/adapter/LuaRecyclerHolder.java
================================================
package androlua.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by hanks on 2017/5/31. Copyright (C) 2017 Hanks
 */

public class LuaRecyclerHolder extends RecyclerView.ViewHolder {
    public LuaRecyclerHolder(View itemView) {
        super(itemView);
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/base/BaseActivity.java
================================================
package androlua.base;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import androlua.widget.statusbar.StatusBarView;
import androlua.widget.swipebacklayout.app.SwipeBackActivity;
import pub.hanks.luajandroid.R;

/**
 * Created by hanks on 2017/6/2. Copyright (C) 2017 Hanks
 */

public class BaseActivity extends SwipeBackActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= 21) {
            View decorView = getWindow().getDecorView();
            int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_IMMERSIVE
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
            decorView.setSystemUiVisibility(option);
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
    }

    public void setStatusBarColor(int color) {
        View statusbar = findViewById(R.id.view_statusbar);
        if (statusbar != null && statusbar instanceof StatusBarView) {
            ((StatusBarView) statusbar).setStatusBarColor(color);
            return;
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(color);
        }
    }

    public void setLightStatusBar() {
        if (Build.VERSION.SDK_INT >= 23) {
            View decorView = getWindow().getDecorView();
            int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
            decorView.setSystemUiVisibility(option);
            setStatusBarColor(0xFFFFFFFF);
        } else if (Build.VERSION.SDK_INT >= 21) {
            setStatusBarColor(0x33000000);
        }
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/base/BaseFragment.java
================================================
package androlua.base;

import android.support.v4.app.Fragment;

/**
 * Created by hanks on 2017/6/2. Copyright (C) 2017 Hanks
 */

public class BaseFragment extends Fragment {
}


================================================
FILE: hydrogen-library/src/main/java/androlua/common/LuaConstants.java
================================================
package androlua.common;

/**
 * Created by hanks on 2017/6/19.
 */

public class LuaConstants {
    public static final String KEY_VERSION = "key_version";
}


================================================
FILE: hydrogen-library/src/main/java/androlua/common/LuaFileUtils.java
================================================
package androlua.common;

import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.view.View;

import com.luajava.LuaObject;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

import androlua.LuaHttp;
import androlua.LuaManager;
import androlua.plugin.Plugin;

import static android.graphics.Bitmap.CompressFormat.JPEG;
import static android.graphics.Bitmap.CompressFormat.PNG;

/**
 * LuaFileUtils
 * Created by hanks on 16/6/28.
 */
public class LuaFileUtils {

    // 缓存文件头信息-文件头信息
    public static final HashMap<String, String> mFileTypes = new HashMap<>();
    private static final String APP_DIR = "LLLLLua";
    // 32k 缩略图的限制,所以采用 RGB_565 比较小
    private static final Bitmap.Config CONFIG = Bitmap.Config.RGB_565;

    static {
        // images
        mFileTypes.put("FFD8FFE1", "jpg");
        mFileTypes.put("FFD8FFE0", "jpg");
        mFileTypes.put("FFD8", "jpg");
        mFileTypes.put("89504E47", "png");
        mFileTypes.put("47494638", "gif");
        mFileTypes.put("49492A00", "tif");
        mFileTypes.put("424D", "bmp");
        //
        mFileTypes.put("41433130", "dwg"); // CAD
        mFileTypes.put("38425053", "psd");
        mFileTypes.put("7B5C727466", "rtf"); // 日记本
        mFileTypes.put("3C3F786D6C", "xml");
        mFileTypes.put("68746D6C3E", "html");
        mFileTypes.put("44656C69766572792D646174653A", "eml"); // 邮件
        mFileTypes.put("D0CF11E0", "doc");
        mFileTypes.put("5374616E64617264204A", "mdb");
        mFileTypes.put("252150532D41646F6265", "ps");
        mFileTypes.put("255044462D312E", "pdf");
        mFileTypes.put("504B0304", "docx");
        mFileTypes.put("52617221", "rar");
        mFileTypes.put("57415645", "wav");
        mFileTypes.put("41564920", "avi");
        mFileTypes.put("2E524D46", "rm");
        mFileTypes.put("000001BA", "mpg");
        mFileTypes.put("000001B3", "mpg");
        mFileTypes.put("6D6F6F76", "mov");
        mFileTypes.put("3026B2758E66CF11", "asf");
        mFileTypes.put("4D546864", "mid");
        mFileTypes.put("1F8B08", "gz");
        mFileTypes.put("4D5A9000", "exe/dll");
        mFileTypes.put("75736167", "txt");
    }

    private static Context getContext() {
        return LuaManager.getInstance().getContext();
    }

    /**
     * 根据文件路径获取文件头信息
     *
     * @param filePath 文件路径
     * @return 文件头信息
     */
    public static String getFileType(String filePath) {
        String fileHeader = getFileHeader(filePath);
        if (LuaStringUtils.isEmpty(fileHeader) || fileHeader.startsWith("FFD8")) {
            return "jpg";
        }
        return mFileTypes.get(fileHeader);
    }

    /**
     * 根据文件路径获取文件头信息
     *
     * @param filePath 文件路径
     * @return 文件头信息
     */
    public static String getFileHeader(String filePath) {
        FileInputStream is = null;
        String value = null;
        try {
            is = new FileInputStream(filePath);
            byte[] b = new byte[4];
            /*
             * int read() 从此输入流中读取一个数据字节。 int read(byte[] b) 从此输入流中将最多 b.length
             * 个字节的数据读入一个 byte 数组中。 int read(byte[] b, int off, int len)
             * 从此输入流中将最多 len 个字节的数据读入一个 byte 数组中。
             */
            is.read(b, 0, b.length);
            value = bytesToHexString(b);
        } catch (Exception e) {
        } finally {
            if (null != is) {
                try {
                    is.close();
                } catch (IOException e) {
                }
            }
        }
        return value;
    }
    /**
     * 将要读取文件头信息的文件的byte数组转换成string类型表示
     *
     * @param src 要读取文件头信息的文件的byte数组
     * @return 文件头信息
     */
    private static String bytesToHexString(byte[] src) {
        StringBuilder builder = new StringBuilder();
        if (src == null || src.length <= 0) {
            return null;
        }
        String hv;
        for (int i = 0; i < src.length; i++) {
            // 以十六进制(基数 16)无符号整数形式返回一个整数参数的字符串表示形式,并转换为大写
            hv = Integer.toHexString(src[i] & 0xFF).toUpperCase();
            if (hv.length() < 2) {
                builder.append(0);
            }
            builder.append(hv);
        }
        return builder.toString();
    }


    public static void downloadPlugin(final String url, final String pluginName, final LuaObject callback) {
        new Thread() {
            @Override
            public void run() {
                super.run();
                try {
                    String destDirectory = getPluginsDir() + "/" + pluginName;
                    String savePath = destDirectory + ".zip";
                    LuaHttp.downloadFile(url, savePath);
                    LuaFileUtils.unzip(savePath, getPluginsDir());
                    deleteFileOrDir(new File(savePath));
                    callback.call(destDirectory);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public static void downloadLuaFile(final String url, final LuaObject callback) {
        new Thread() {
            @Override
            public void run() {
                super.run();
                try {
                    String destDirectory = LuaManager.getInstance().getLuaExtDir() + "/lua";
                    String savePath = destDirectory + ".zip";
                    LuaHttp.downloadFile(url, savePath);
                    LuaFileUtils.unzip(savePath, LuaManager.getInstance().getLuaExtDir());
                    deleteFileOrDir(new File(savePath));
                    if (callback != null) callback.call(destDirectory);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public static void deleteFileOrDir(File file) {
        if (file == null || !file.exists()) {
            return;
        }
        if (!file.isDirectory()) {
            file.delete();
            return;
        }
        File[] files = file.listFiles();
        if (files == null) {
            return;
        }
        for (File f : files) {
            deleteFileOrDir(f);
        }
        file.delete();
    }

    public static void removePlugin(String pluginId) {
        for (Plugin plugin : getPluginList()) {
            if (pluginId.equals(plugin.getId())) {
                File file = new File(plugin.getPath());
                deleteFileOrDir(file);
            }
        }
    }

    public static String getPluginsDir() {
        return getAndroLuaDir();
    }

    public static List<Plugin> getPluginList() {
        // 读取总目录
        File pluginDir = new File(getPluginsDir());
        if (!pluginDir.exists()) {
            return Collections.emptyList();
        }
        List<Plugin> pluginList = new ArrayList<>();
        for (File file : pluginDir.listFiles()) {
            // 读取单个插件文件
            Plugin plugin = parsePluginInfo(file);
            if (plugin == null) {
                continue;
            }
            pluginList.add(plugin);
        }
        Collections.sort(pluginList, new Comparator<Plugin>() {
            @Override
            public int compare(Plugin o1, Plugin o2) {
                return (int) (o1.getUpdateAt() - o2.getUpdateAt());
            }
        });
        return pluginList;
    }

    // 解析插件
    private static Plugin parsePluginInfo(File pluginDir) {
        if (pluginDir == null || !pluginDir.isDirectory()) {
            return null;
        }
        File info = null;
        for (File pFile : pluginDir.listFiles()) {
            if ("info.json".equals(pFile.getName())) {
                info = pFile;
            }
        }
        if (info == null) {
            return null;
        }

        String str = file2String(info);
        try {
            Plugin plugin = new Plugin();
            plugin.setUpdateAt(info.lastModified());
            JSONObject jsonObject = new JSONObject(str);
            plugin.setPath(pluginDir.getAbsolutePath());
            plugin.setPlugin(true);
            plugin.setId(jsonObject.getString("id"));
            plugin.setName(jsonObject.getString("name"));
            plugin.setIconPath(jsonObject.getString("icon"));
            plugin.setMainPath(jsonObject.getString("main"));
            plugin.setVersionName(jsonObject.getString("versionName"));
            plugin.setVersionCode(jsonObject.getInt("versionCode"));
            return plugin;
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static void copyAssetsFlies(String assetDir, String outputDir) {
        try {
            String[] files = getContext().getAssets().list(assetDir);
            if (files == null) {
                return;
            }
            for (String file : files) {
                copyFile(getContext().getAssets().open(assetDir + "/" + file), outputDir + "/" + file);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public static void copyFile(InputStream inStream, String newPath) throws IOException {
        int len;
        FileOutputStream fs = new FileOutputStream(newPath);
        byte[] buffer = new byte[4096];
        while ((len = inStream.read(buffer)) != -1) {
            fs.write(buffer, 0, len);
        }
        inStream.close();
    }


    private static String file2String(File file) {
        BufferedReader br = null;
        try {
            br = new BufferedReader(new FileReader(file));
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) {
                sb.append(line);
                sb.append("\n");
                line = br.readLine();
            }
            return sb.toString();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (br != null) br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return "";
    }

    public static File convertViewToImage(View view, @NonNull String filePath) throws Exception {
        if (view.getWidth() == 0 || view.getHeight() == 0) {
            throw new Exception("width or height must not be 0");
        }

        if (view.getHeight() > 100000) {
            throw new Exception("must small");
        }

        final File saveFile = new File(filePath);
        Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(createBitmap);
        canvas.save();
        view.draw(canvas);
        canvas.restore();
        String imageType = createBitmap.getHeight() > 20000 ? "jpg" : "png";
        Bitmap.CompressFormat compressFormat = "jpg".equals(imageType) ? PNG : JPEG;
        bitmapToFile(createBitmap, saveFile, compressFormat, "jpg".equals(imageType) ? 90 : 100);
        if (createBitmap != null) {
            createBitmap.recycle();
        }
        canvas.setBitmap(null);
        System.gc();
        return saveFile;
    }

    public static File bitmapToFile(Bitmap bitmap, File file, Bitmap.CompressFormat compressFormat, int quality) {
        if (file == null) {
            return null;
        }
        FileOutputStream fileOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(file);
            bitmap.compress(compressFormat, quality, fileOutputStream);
            fileOutputStream.flush();
            fileOutputStream.close();
            return file;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        } finally {
            try {
                if (fileOutputStream != null) fileOutputStream.close();
            } catch (IOException e22) {
                e22.printStackTrace();
            }
        }
    }

    public static String saveImage(String imagePath) {
        File file = new File(imagePath);
        if (!file.exists()) {
            return null;
        }
        try {
            String fileName = System.currentTimeMillis() + ".png";
            String outputPath = getProjectImagePath();
            //create output directory if it doesn't exist
            File dir = new File(outputPath);
            if (!dir.exists()) {
                dir.mkdirs();
            }
            InputStream in = new FileInputStream(imagePath);
            OutputStream out = new FileOutputStream(outputPath + "/" + fileName);
            byte[] buffer = new byte[1024];
            int read;
            while ((read = in.read(buffer)) != -1) {
                out.write(buffer, 0, read);
            }
            in.close();
            // write the output file (You have now copied the file)
            out.flush();
            out.close();
            return fileName;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static String getImagePath(String name) {
        return getProjectImagePath() + "/" + name;
    }

    public static String getPublicPicturePath(String fileName) {
        // Get the directory for the user's public pictures directory.
        File file = new File(Environment.getExternalStoragePublicDirectory(
                Environment.DIRECTORY_PICTURES), APP_DIR);
        if (!file.mkdirs()) {
            LuaLog.e("Directory not created");
        }
        return file.getAbsolutePath() + "/" + fileName;
    }

    public static Bitmap getBitmapFromFile(String name) {
        String filePath = getProjectImagePath() + "/" + name;
        return BitmapFactory.decodeFile(filePath);
    }

    public static void makeDefaultCSSFile() {
        String path = getProjectCSSPath() + "/marked.css";
        File file = new File(path);
        if (!file.exists()) {
            makeDefaultCSSFile(path);
        }
    }

    private static void makeDefaultCSSFile(String path) {
        try {
            InputStream inputStream = getContext().getResources().getAssets().open("marked.css");
            saveToFile(inputStream, path);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String convertStreamToString(InputStream is) {
        BufferedReader br = null;
        StringBuilder sb = new StringBuilder();
        String line;
        try {
            br = new BufferedReader(new InputStreamReader(is));
            while ((line = br.readLine()) != null) {
                sb.append(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return sb.toString();
    }

    public static String getProjectCSSPath() {
        return insureDirExists(getProjectPath() + "/css");
    }

    public static String getBackupPath() {
        return insureDirExists(getProjectPath() + "/backup");
    }

    public static String getBackupNotePath() {
        return insureDirExists(getProjectPath() + "/notejson");
    }

    private static String insureDirExists(String dir) {
        File file = new File(dir);
        if (!file.exists()) {
            file.mkdirs();
        }
        return file.getAbsolutePath();
    }

    public static String getProjectImagePath() {
        String path = getProjectPath() + "/images";
        insureDirExists(path);
        File noMediaFile = new File(path, ".nomedia");
        if (!noMediaFile.exists()) {
            try {
                noMediaFile.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return path;
    }

    public static String getProjectPath() {
        String downloadDir = getContext().getExternalFilesDir(APP_DIR).getAbsolutePath();
        String filePath = downloadDir;
        File file = new File(filePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return filePath;
    }

    public static boolean sdCardAvaible() {
        return Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
    }


    public static String saveToFile(InputStream in, String filePath) {
        try {
            FileOutputStream out = new FileOutputStream(filePath);
            byte[] buffer = new byte[1024];
            int read;
            while ((read = in.read(buffer)) != -1) {
                out.write(buffer, 0, read);
            }
            in.close();
            out.flush();
            out.close();
            return filePath;
        } catch (Exception e) {
            e.printStackTrace();
            return filePath;
        }
    }

    public static String saveToFile(String txt, String filePath) {
        try {
            File file = new File(filePath);
            if (!file.exists()) {
                file.getParentFile().mkdirs();
                file.createNewFile();
            }
            FileWriter fooWriter = new FileWriter(file, false); // true to append // false to overwrite.
            fooWriter.write(txt);
            fooWriter.close();
            return file.getAbsolutePath();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return txt;
    }

    public static String getFontPath(String fontAlias) {
        String path = getProjectPath() + File.separator + "font";
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        return (dir + File.separator + fontAlias).toLowerCase();
    }

    /**
     * Extracts a zip file specified by the zipFilePath to a directory specified by
     * destDirectory (will be created if does not exists)
     *
     * @param zipFilePath
     * @param destDirectory
     * @throws IOException
     */
    public static void unzip(String zipFilePath, String destDirectory) throws IOException {
        File destDir = new File(destDirectory);
        if (!destDir.exists()) {
            destDir.mkdir();
        }
        ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
        ZipEntry entry = zipIn.getNextEntry();
        // iterates over entries in the zip file
        while (entry != null) {
            String filePath = (destDirectory + File.separator + entry.getName()).toLowerCase();
            if (!entry.isDirectory()) {
                // if the entry is a file, extracts it
                extractFile(zipIn, filePath);
            } else {
                // if the entry is a directory, make the directory
                File dir = new File(filePath);
                dir.mkdir();
            }
            zipIn.closeEntry();
            entry = zipIn.getNextEntry();
        }
        zipIn.close();
    }

    /**
     * Extracts a zip entry (file entry)
     *
     * @param zipIn
     * @param filePath
     * @throws IOException
     */
    private static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
        byte[] bytesIn = new byte[2048];
        int read = 0;
        while ((read = zipIn.read(bytesIn)) != -1) {
            bos.write(bytesIn, 0, read);
        }
        bos.close();
    }

    public static void rewriteFile(File file, String content) {
        BufferedWriter bw = null;
        FileWriter fw = null;

        try {
            fw = new FileWriter(file);
            bw = new BufferedWriter(fw);
            bw.write(content);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (bw != null)
                    bw.close();
                if (fw != null)
                    fw.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }

    public static String getFileContent(File file) {
        BufferedReader br = null;
        try {
            br = new BufferedReader(new FileReader(file));
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();

            while (line != null) {
                sb.append(line);
                sb.append("\n");
                line = br.readLine();
            }
            return sb.toString();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (br != null) br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public static void deleteFile(String path) {
        File file = new File(path);
        if (file.exists()) {
            file.delete();
        }
    }

    public static void deleteDir(String dirPath) {
        File dir = new File(dirPath);
        if (!dir.exists()) {
            return;
        }
        if (dir.isDirectory()) {
            if (dir.listFiles() == null) {
                dir.delete();
                return;
            }
            for (File file : dir.listFiles()) {
                deleteDir(file.getAbsolutePath());
            }
        } else {
            dir.delete();
        }
    }

    public static void writeZip(File file, String parentPath, ZipOutputStream zos) {
        if (file.exists()) {
            if (file.isDirectory()) {//处理文件夹
                parentPath += file.getName() + File.separator;
                File[] files = file.listFiles();
                if (files == null) {
                    return;
                }
                for (File f : files) {
                    writeZip(f, parentPath, zos);
                }
            } else {
                FileInputStream fis = null;
                try {
                    fis = new FileInputStream(file);
                    ZipEntry ze = new ZipEntry(parentPath + file.getName());
                    zos.putNextEntry(ze);
                    byte[] content = new byte[1024];
                    int len;
                    while ((len = fis.read(content)) != -1) {
                        zos.write(content, 0, len);
                        zos.flush();
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                } finally {
                    try {
                        if (fis != null) {
                            fis.close();
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }

    public static String getAndroLuaDir() {
        File appDir;
        if (sdCardAvaible()) {
            appDir = getContext().getExternalFilesDir(APP_DIR);
        } else {
            appDir = new File(getContext().getFilesDir(), APP_DIR);
        }
        appDir.mkdirs(); // dont need judge dir exits

        return appDir.getAbsolutePath();
    }

    public static byte[] readAsset(String name) throws IOException {
        AssetManager am = getContext().getAssets();
        InputStream is = am.open(name);
        byte[] ret = readAll(is);
        is.close();
        //am.close();
        return ret;
    }

    private static byte[] readAll(InputStream input) throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream(4096);
        byte[] buffer = new byte[4096];
        int n = 0;
        while (-1 != (n = input.read(buffer))) {
            output.write(buffer, 0, n);
        }
        byte[] ret = output.toByteArray();
        output.close();
        return ret;
    }

    //复制asset文件到sd卡
    public static void assetsToSD(String InFileName, String OutFileName) throws IOException {
        InputStream myInput;
        OutputStream myOutput = new FileOutputStream(OutFileName);
        myInput = getContext().getAssets().open(InFileName);
        byte[] buffer = new byte[8192];
        int length = myInput.read(buffer);
        while (length > 0) {
            myOutput.write(buffer, 0, length);
            length = myInput.read(buffer);
        }

        myOutput.flush();
        myInput.close();
        myOutput.close();
    }

    /**
     * 解压Assets中的文件
     */
    public static void unZipAssets(String assetName, String outputDirectory) throws IOException {
        //创建解压目标目录
        File file = new File(outputDirectory);
        //如果目标目录不存在,则创建
        if (!file.exists()) {
            file.mkdirs();
        }
        InputStream inputStream = null;
        //打开压缩文件
        try {
            inputStream = getContext().getAssets().open(assetName);
        } catch (IOException e) {
            return;
        }

        ZipInputStream zipInputStream = new ZipInputStream(inputStream);
        //读取一个进入点
        ZipEntry zipEntry = zipInputStream.getNextEntry();
        //使用1Mbuffer
        byte[] buffer = new byte[1024 * 32];
        //解压时字节计数
        int count = 0;
        //如果进入点为空说明已经遍历完所有压缩包中文件和目录
        while (zipEntry != null) {
            //如果是一个目录
            if (zipEntry.isDirectory()) {
                //String name = zipEntry.getName();
                //name = name.substring(0, name.length() - 1);
                file = new File(outputDirectory + File.separator + zipEntry.getName());
                file.mkdir();
            } else {
                //如果是文件
                file = new File(outputDirectory + File.separator
                        + zipEntry.getName());
                //创建该文件
                file.createNewFile();
                FileOutputStream fileOutputStream = new FileOutputStream(file);
                while ((count = zipInputStream.read(buffer)) > 0) {
                    fileOutputStream.write(buffer, 0, count);
                }
                fileOutputStream.close();
            }
            //定位到下一个文件入口
            zipEntry = zipInputStream.getNextEntry();
        }
        zipInputStream.close();
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/common/LuaLog.java
================================================
package androlua.common;

import android.util.Log;

import androlua.LuaManager;


/**
 * LuaLog
 * Created by hanks on 2016/11/19.
 */

public class LuaLog {
    private static final String TAG = "LLogs";

    public static boolean showLog() {
        return LuaManager.getInstance().isDebugable();
    }

    public static void i(String s) {
        if (showLog()) {
            Log.i(TAG, s == null ? "null" : s);
        }
    }

    public static void w(String s) {
        if (showLog()) {
            Log.w(TAG, s == null ? "null" : s);
        }
    }

    public static void d(String s) {
        if (showLog()) {
            Log.d(TAG, s == null ? "null" : s);
        }
    }

    public static void e(String s) {
        if (showLog()) {
            Log.e(TAG, s == null ? "null" : s);
        }
    }

    public static void e(Throwable e) {
        if (showLog() && e != null) {
            e.printStackTrace();
        }
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/common/LuaSp.java
================================================
package androlua.common;

import android.content.Context;
import android.content.SharedPreferences;

import androlua.LuaManager;

/**
 * SharedPreferences
 * Created by hanks on 2017/6/19.
 */

public class LuaSp {

    private static LuaSp instance;
    private final SharedPreferences sp;

    public static LuaSp getInstance(String fileName) {
        if (instance == null) {
            synchronized (LuaSp.class) {
                if (instance == null) {
                    instance = new LuaSp(fileName);
                }
            }
        }
        return instance;
    }

    private LuaSp(String fileName) {
        Context context = LuaManager.getInstance().getContext();
        sp = context.getSharedPreferences(fileName, Context.MODE_PRIVATE);
    }

    public void save(String key, Object value) {
        SharedPreferences.Editor editor = sp.edit();
        if (value instanceof Boolean) {
            editor.putBoolean(key, (Boolean) value);
        } else if (value instanceof String) {
            editor.putString(key, (String) value);
        } else if (value instanceof Integer) {
            editor.putInt(key, (Integer) value);
        } else if (value instanceof Float) {
            editor.putFloat(key, (Float) value);
        } else if (value instanceof Long) {
            editor.putLong(key, (Long) value);
        }
        editor.apply();
    }

    public <T> T get(String key, T defaultValue) {
        Object value = null;
        if (defaultValue instanceof Boolean) {
            value = sp.getBoolean(key, (Boolean) defaultValue);
        } else if (defaultValue instanceof String) {
            value = sp.getString(key, (String) defaultValue);
        } else if (defaultValue instanceof Float) {
            value = sp.getFloat(key, (Float) defaultValue);
        } else if (defaultValue instanceof Long) {
            value = sp.getLong(key, (Long) defaultValue);
        } else if (defaultValue instanceof Integer) {
            value = sp.getInt(key, (Integer) defaultValue);
        }
        return (T) value;
    }

    /**
     * 移除某个key值已经对应的值
     */
    public void remove(String key) {
        SharedPreferences.Editor editor = sp.edit();
        editor.remove(key);
        editor.apply();
    }

    /**
     * 是否已经存在该 key
     */
    public boolean contains(String key) {
        return sp.contains(key);
    }


    /**
     * 清除所有数据
     */
    public void clear() {
        SharedPreferences.Editor editor = sp.edit();
        editor.clear();
        editor.apply();
    }

}


================================================
FILE: hydrogen-library/src/main/java/androlua/common/LuaStringUtils.java
================================================
package androlua.common;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * 字符串处理
 * Created by hanks on 2016/11/29.
 */

public class LuaStringUtils {
    public static final String EMPTY_CHAR = "\u200B";

    public static boolean isEmpty(String s) {
        return s == null || s.length() == 0;
    }

    // 去除最后一行换行
    public static String trimEnd(String s) {
        if (!isEmpty(s) && (s.endsWith("\n") || s.endsWith(EMPTY_CHAR))) {
            return s.substring(0, s.length() - 1);
        } else {
            return s;
        }
    }

    public static boolean isEmptyTrim(String s) {
        return s == null || s.trim().length() == 0 || EMPTY_CHAR.equals(s);
    }

    public static String md5(String source) {
        String target = "";
        if (source == null)
            source = "";
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(source.getBytes());
            byte b[] = md.digest();
            int i;
            StringBuffer buf = new StringBuffer("");
            for (int offset = 0; offset < b.length; offset++) {
                i = b[offset];
                if (i < 0)
                    i += 256;
                if (i < 16)
                    buf.append("0");
                buf.append(Integer.toHexString(i));
            }
            target = buf.toString();

        } catch (NoSuchAlgorithmException e) {
        }
        return target;
    }

    public static boolean isUrl(String str) {
        return str != null && (str.startsWith("http://") || str.startsWith("https://"));
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/common/LuaToast.java
================================================
package androlua.common;

import android.widget.Toast;

import androlua.LuaManager;

/**
 * Created by hanks on 2017/6/19.
 */

public class LuaToast {
    public static void show(String s) {
        Toast.makeText(LuaManager.getInstance().getContext(), s, Toast.LENGTH_SHORT).show();
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/fragment/MenuFragment.java
================================================
package androlua.fragment;

import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;

import java.io.File;
import java.util.List;

import androlua.LuaActivity;
import androlua.LuaManager;
import androlua.LuaUtil;
import androlua.base.BaseFragment;
import androlua.common.LuaFileUtils;
import androlua.common.LuaStringUtils;
import androlua.plugin.Plugin;
import androlua.utils.ShortcutUtils;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pub.hanks.luajandroid.R;

/**
 * MenuFragment
 * Created by hanks on 2017/8/22.
 */

public class MenuFragment extends BaseFragment {
    public static MenuFragment newInstance() {
        Bundle args = new Bundle();
        MenuFragment fragment = new MenuFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_menu, container, false);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        view.findViewById(R.id.add_shortcut).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (getActivity() == null || !(getActivity() instanceof LuaActivity)) {
                    return;
                }

                Intent intent = getActivity().getIntent();
                String luaFile = LuaUtil.IntentHelper.getLuaPath(intent);
                String luaExtDir = LuaManager.getInstance().getLuaExtDir();
                if (!luaFile.startsWith("/")) {
                    luaFile = luaExtDir + "/" + luaFile;
                }
                File file = new File(luaFile);
                if (!file.exists()) {
                    return;
                }
                String pluginRoot;
                do {
                    pluginRoot = file.getAbsolutePath();
                    file = file.getParentFile();
                } while (!luaExtDir.equals(file.getAbsolutePath()));

                String name = "氢-" + file.getName();
                Plugin p = null;

                List<Plugin> pluginList = LuaFileUtils.getPluginList();
                for (Plugin plugin : pluginList) {
                    if (plugin.getPath().equals(pluginRoot)) {
                        name = plugin.getName();
                        p = plugin;
                        break;
                    }
                }
                if (p != null) {
                    showAddShortcutDialog(intent, name, p.getIconPath());
                } else {
                    showAddShortcutDialog(intent, name, null);
                }
            }
        });
    }

    private void showAddShortcutDialog(final Intent intent, String name, String iconPath) {
        if (getActivity() == null || !(getActivity() instanceof LuaActivity)) {
            return;
        }
        ((LuaActivity) getActivity()).closeDrawer();
        View view = View.inflate(getActivity(), R.layout.dialog_add_shortcut, null);
        final EditText et_name = (EditText) view.findViewById(R.id.name);
        final ImageView iv_icon = (ImageView) view.findViewById(R.id.icon);
        et_name.setText("氢 · " +  name);
        final Bitmap[] bm = new Bitmap[1];
        if (!LuaStringUtils.isEmpty(iconPath)) {
            GradientDrawable gd = new GradientDrawable();
            gd.setCornerRadius(LuaUtil.dp2px(100));
            gd.setColor(0xffebf0f2);
            Glide.with(this)
                    .load(iconPath)
                    .asBitmap()
                    .placeholder(gd)
                    .transform(new RoundedCornersTransformation(getContext(), LuaUtil.dp2px(100), 0))
                    .listener(new RequestListener<String, Bitmap>() {
                        @Override
                        public boolean onException(Exception e, String model, Target<Bitmap> target, boolean isFirstResource) {
                            return false;
                        }

                        @Override
                        public boolean onResourceReady(Bitmap resource, String model, Target<Bitmap> target, boolean isFromMemoryCache, boolean isFirstResource) {
                            bm[0] = resource;
                            return false;
                        }
                    }).into(iv_icon);
        }
        new AlertDialog.Builder(getActivity())
                .setTitle("放到桌面")
                .setView(view)
                .setNegativeButton("取消", null)
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        String name = et_name.getText().toString();
                        if (LuaStringUtils.isEmpty(name)) {
                            name = " ";
                        }
                        if (bm[0] == null) {
                            bm[0] = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
                        }
                        ShortcutUtils.installShortcut(getActivity(), name, bm[0], intent);
                    }
                })
                .show();

    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/plugin/Plugin.java
================================================
package androlua.plugin;

import com.luajava.LuaState;

import androlua.LuaManager;

/**
 * Created by hanks on 2017/5/5. Copyright (C) 2017 Hanks
 */

public class Plugin {
    private final LuaManager luaManager;
    private String path;
    private String id;
    private String name;
    private String iconPath;
    private String mainPath;
    private String versionName;
    private int versionCode;
    private boolean isPlugin;
    private long updateAt;
    private LuaState L;

    public Plugin() {
        luaManager = LuaManager.getInstance();
    }

    public boolean isPlugin() {
        return isPlugin;
    }

    public void setPlugin(boolean plugin) {
        isPlugin = plugin;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setUpdateAt(long updateAt) {
        this.updateAt = updateAt;
    }

    public long getUpdateAt() {
        return updateAt;
    }

    public String getIconPath() {
        if (iconPath == null) {
            return "http://image.coolapk.com/apk_logo/2016/0108/12202_1452248424_4592.png";
        }

        if (iconPath.startsWith("http://") || iconPath.startsWith("https://")) {
            return iconPath;
        }
        if (!iconPath.startsWith("/")) {
            iconPath = getPath() + "/" + iconPath;
        }
        if (iconPath.startsWith("/")) {
            iconPath = "file://" + iconPath;
        }
        return iconPath;
    }

    public void setIconPath(String iconPath) {
        this.iconPath = iconPath;
    }

    public String getMainPath() {
        if (!mainPath.startsWith("/")) {
            setMainPath(getPath() + "/" + mainPath);
        }
        return mainPath;
    }

    public void setMainPath(String mainPath) {
        this.mainPath = mainPath;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    public int getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(int versionCode) {
        this.versionCode = versionCode;
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/utils/ColorStateListFactory.java
================================================
package androlua.utils;

import android.content.res.ColorStateList;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.os.Build;

import java.util.Arrays;

/**
 * Created by hanks on 2017/5/31. Copyright (C) 2017 Hanks
 */

public class ColorStateListFactory {

    public static ColorStateList newInstance(int normalColor) {
        return ColorStateList.valueOf(normalColor);
    }

    public static ColorStateList newInstance(int normalColor, int selectedColor) {
        int[][] states = new int[][]{
                {-android.R.attr.state_checked},
                {android.R.attr.state_checked},
                {android.R.attr.state_pressed},
                {android.R.attr.state_enabled},
                {android.R.attr.state_selected},
        };
        int[] colorList = new int[9];
        colorList[0] = normalColor;
        colorList[1] = selectedColor;
        colorList[2] = selectedColor;
        colorList[3] = selectedColor;
        colorList[4] = selectedColor;
        return new ColorStateList(states, colorList);
    }


    public static Drawable getRippleDrawable(
            int normalColor, int pressedColor) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return new RippleDrawable(ColorStateList.valueOf(pressedColor),
                    null, getRippleMask(normalColor));
        } else {
            return getStateListDrawable(normalColor, pressedColor);
        }
    }

    private static Drawable getRippleMask(int color) {
        float[] outerRadii = new float[8];
        // 3 is radius of final ripple,
        // instead of 3 you can give required final radius
        Arrays.fill(outerRadii, 3);

        RoundRectShape r = new RoundRectShape(outerRadii, null, null);
        ShapeDrawable shapeDrawable = new ShapeDrawable(r);
        shapeDrawable.getPaint().setColor(color);
        return shapeDrawable;
    }

    public static StateListDrawable getStateListDrawable(
            int normalColor, int pressedColor) {
        StateListDrawable states = new StateListDrawable();
        states.addState(new int[]{android.R.attr.state_pressed},
                new ColorDrawable(pressedColor));
        states.addState(new int[]{android.R.attr.state_focused},
                new ColorDrawable(pressedColor));
        states.addState(new int[]{android.R.attr.state_activated},
                new ColorDrawable(pressedColor));
        states.addState(new int[]{},
                new ColorDrawable(normalColor));
        return states;
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/utils/DialogUtils.java
================================================
package androlua.utils;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
import android.widget.EditText;

import com.luajava.LuaException;
import com.luajava.LuaObject;
import com.luajava.LuaTable;

import pub.hanks.luajandroid.R;

/**
 * DialogUtils
 * Created by hanks on 2017/6/30.
 */
public class DialogUtils {
    public static AlertDialog showWithInput(Context context, LuaTable config, final LuaObject callback) {
        if (!(context instanceof Activity)) {
            return null;
        }
        View view = View.inflate(context, R.layout.dialog_input, null);
        final EditText et = (EditText) view.findViewById(R.id.et);
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        if (config.containsKey("title")) {
            builder.setTitle((String) config.get("title"));
        }
        if (config.containsKey("msg")) {
            builder.setMessage((String) config.get("msg"));
        }
        if (config.containsKey("cancelable")) {
            builder.setCancelable((Boolean) config.get("cancelable"));
        }
        if (config.containsKey("content")) {
            et.setText((String) config.get("content"));
        }
        if (config.containsKey("hit")) {
            et.setText((String) config.get("content"));
        }
        if (config.containsKey("title")) {
            builder.setTitle((String) config.get("title"));
        }
        if (config.containsKey("ok")) {
            builder.setPositiveButton((String) config.get("ok"), new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    try {
                        callback.call(et.getText().toString());
                    } catch (LuaException e) {
                        e.printStackTrace();
                    }
                }
            });
        } else {
            builder.setPositiveButton("确定", null);
        }
        if (config.containsKey("cancel")) {
            builder.setNegativeButton((String) config.get("cancel"), null);
        } else {
            builder.setNegativeButton("取消", null);
        }
        return  builder.create();
    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/utils/LauncherUtil.java
================================================
package androlua.utils;


import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.text.TextUtils;

public class LauncherUtil {
    public static final String READ_SETTINGS = "READ_SETTINGS";
    public static final String WRITE_SETTINGS = "WRITE_SETTINGS";

    private LauncherUtil() {
    }

    public static String getDefaultLauncher(Context context) {
        try {
            Intent intent = new Intent("android.intent.action.MAIN");
            intent.addCategory("android.intent.category.HOME");
            ResolveInfo resolveActivity = context.getPackageManager().resolveActivity(intent, 0);
            if (resolveActivity.activityInfo.packageName.equals("android")) {
                return null;
            }
            return resolveActivity.activityInfo.packageName;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static String getAuthorityFromPermission(Context context, String str) {
        String str2 = null;
        if (!(TextUtils.isEmpty(str) || context == null)) {
            String defaultLauncher = getDefaultLauncher(context);
            if (!TextUtils.isEmpty(defaultLauncher)) {
                try {
                    PackageInfo packageInfo = context.getPackageManager().getPackageInfo(defaultLauncher, PackageManager.GET_PROVIDERS);
                    if (packageInfo != null) {
                        ProviderInfo[] providerInfoArr = packageInfo.providers;
                        if (providerInfoArr != null) {
                            for (ProviderInfo providerInfo : providerInfoArr) {
                                if ((!TextUtils.isEmpty(providerInfo.readPermission) && providerInfo.readPermission.contains(str)) || (!TextUtils.isEmpty(providerInfo.writePermission) && providerInfo.writePermission.contains(str))) {
                                    str2 = providerInfo.authority;
                                    break;
                                }
                            }
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        return str2;
    }
}

================================================
FILE: hydrogen-library/src/main/java/androlua/utils/ShortcutUtils.java
================================================
package androlua.utils;

import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.text.TextUtils;

import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;

public class ShortcutUtils {

    private static final String ACTION_INSTALL_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT";
    private static final String ACTION_UNINSTALL_SHORTCUT = "com.android.launcher.action.UNINSTALL_SHORTCUT";
    private static final String KEY_DUPLICATE = "duplicate";
    private static final int POOL_SIZE = 3;
    private static final String TAG = "ShortcutUtil";
    private static ThreadPoolExecutor EXECUTOR = null;

    static {
        EXECUTOR = new ScheduledThreadPoolExecutor(POOL_SIZE);
    }

    private ShortcutUtils() {
    }

    public static void installShortcut(Context context, String str, int i, Intent intent) {
        installShortcut(context, str, i, intent, null);
    }

    public static void installShortcut(final Context context, final String str, final int i, final Intent intent, final ActionListener actionListener) {
        EXECUTOR.execute(new Runnable() {
            @Override
            public void run() {
                addShortcut(context, str, i, intent);
                if (actionListener != null) {
                    actionListener.onSuccess();
                }
            }
        });
    }

    public static void installShortcut(Context context, String str, Bitmap bm,  Intent intent) {
        installShortcut(context, str, bm, intent, null);
    }

    public static void installShortcut(final Context context, final String str, final Bitmap bm, final Intent intent, final ActionListener actionListener) {
        EXECUTOR.execute(new Runnable() {
            @Override
            public void run() {
                addShortcut(context, str, bm,  intent);
                if (actionListener != null) {
                    actionListener.onSuccess();
                }
            }
        });
    }

    public static void uninstallShortcut(Context context, String str, Intent intent) {
        uninstallShortcut(context, str, intent, null);
    }

    public static void uninstallShortcut(final Context context, final String str, final Intent intent, final ActionListener actionListener) {
        EXECUTOR.execute(new Runnable() {
            @Override
            public void run() {
                removeShortcut(context, str, intent);
                if (actionListener != null) {
                    actionListener.onSuccess();
                }
            }
        });
    }

    private static boolean addShortcut(Context context, String str, int i, Intent intent) {
        intent.setAction("android.intent.action.MAIN");
        intent.addFlags(65536);
        Intent intent2 = new Intent(ACTION_INSTALL_SHORTCUT);
        intent2.putExtra("android.intent.extra.shortcut.INTENT", intent);
        intent2.putExtra("android.intent.extra.shortcut.NAME", str);
        intent2.putExtra("android.intent.extra.shortcut.ICON", BitmapFactory.decodeResource(context.getResources(), i));
        intent2.putExtra("android.intent.extra.shortcut.ICON_RESOURCE", Intent.ShortcutIconResource.fromContext(context, i));
        intent2.putExtra(KEY_DUPLICATE, false);
        context.sendBroadcast(intent2);
        return true;
    }

    private static boolean addShortcut(Context context, String str, Bitmap bm,  Intent intent) {
        intent.setAction("android.intent.action.MAIN");
        intent.addFlags(65536);
        Intent intent2 = new Intent(ACTION_INSTALL_SHORTCUT);
        intent2.putExtra("android.intent.extra.shortcut.INTENT", intent);
        intent2.putExtra("android.intent.extra.shortcut.NAME", str);
        intent2.putExtra("android.intent.extra.shortcut.ICON", bm);
        intent2.putExtra(KEY_DUPLICATE, false);
        context.sendBroadcast(intent2);
        return true;
    }

    private static void removeShortcut(Context context, String str, Intent intent) {
        intent.setAction("android.intent.action.MAIN");
        Intent intent2 = new Intent(ACTION_UNINSTALL_SHORTCUT);
        intent2.putExtra("android.intent.extra.shortcut.INTENT", intent);
        intent2.putExtra("android.intent.extra.shortcut.NAME", str);
        context.sendBroadcast(intent2);
    }

    public static boolean hasShortcut(Context context, String str) {
        boolean z = false;
        Exception e;
        Throwable th;
        Cursor cursor = null;
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        String authorityFromPermission = LauncherUtil.getAuthorityFromPermission(context, LauncherUtil.READ_SETTINGS);
        if (TextUtils.isEmpty(authorityFromPermission)) {
            return false;
        }
        Cursor query;
        try {
            query = context.getContentResolver().query(Uri.parse("content://" + authorityFromPermission + "/favorites?notify=true"), null, "title=?", new String[]{str}, null);
            if (query != null) {
                try {
                    if (query.getCount() > 0) {
                        z = true;
                        if (query != null) {
                            query.close();
                        }
                        return z;
                    }
                } catch (Exception e2) {
                    e = e2;
                    try {
                        e.printStackTrace();
                        if (query == null) {
                            query.close();
                            z = false;
                        } else {
                            z = false;
                        }
                        return z;
                    } catch (Throwable th2) {
                        th = th2;
                        cursor = query;
                        if (cursor != null) {
                            cursor.close();
                        }
                        throw th;
                    }
                }
            }
            z = false;
            if (query != null) {
                query.close();
            }
        } catch (Exception e3) {
            e = e3;
            query = null;
            e.printStackTrace();
            if (query == null) {
                z = false;
            } else {
                query.close();
                z = false;
            }
            return z;
        } catch (Throwable th3) {
            th = th3;
            if (cursor != null) {
                cursor.close();
            }
        }
        return z;
    }

    public interface ActionListener {
        void onFailure(int i);

        void onSuccess();
    }
}

================================================
FILE: hydrogen-library/src/main/java/androlua/widget/glide/LuaGlideModule.java
================================================
package androlua.widget.glide;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool;
import com.bumptech.glide.load.engine.cache.LruResourceCache;
import com.bumptech.glide.module.GlideModule;

/**
 * custom glide
 * Created by hanks on 2017/6/1.
 */

public class LuaGlideModule implements GlideModule {
    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        int memoryCacheSize = 1024 * 1024 * 10;//设置图片内存缓存占用八分之一
        //设置内存缓存大小
        builder.setMemoryCache(new LruResourceCache(memoryCacheSize));
        //设置BitmapPool缓存内存大小
        builder.setBitmapPool(new LruBitmapPool(memoryCacheSize));
    }

    @Override
    public void registerComponents(Context context, Glide glide) {

    }
}


================================================
FILE: hydrogen-library/src/main/java/androlua/widget/htmltext/URLImageParser.java
================================================
package androlua.widget.htmltext;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.WindowManager;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.target.ViewTarget;


public class URLImageParser implements Html.ImageGetter {
    private TextView container;

    public URLImageParser(TextView v) {
        this.container = v;
    }

    @Override
    public Drawable getDrawable(String url) {
        final UrlDrawable urlDrawable = new UrlDrawable();
        final String source = url;

        debug("Url is " + url);
        DisplayMetrics metrics = new DisplayMetrics();
        ((WindowManager) container.getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics);
        final float dpi = (int) metrics.density;

        Glide.with(container.getContext()).load(source).diskCacheStrategy(DiskCacheStrategy.ALL).
                listener(new RequestListener<String, GlideDrawable>() {
                    @Override
                    public boolean onException(Exception e, String s, Target<GlideDrawable> glideDrawableTarget, boolean b) {
                        debug("Error in Glide listener");
                        if (e != null) {
                            e.printStackTrace();
                        }
                        return false;
                    }

                    @Override
                    public boolean onResourceReady(GlideDrawable glideDrawable, String s, Target<GlideDrawable> glideDrawableTarget, boolean b, boolean b2) {
                        return false;
                    }
                }).
                into(new ViewTarget<TextView, GlideDrawable>(container) {
                    @Override
                    public void onResourceReady(GlideDrawable d, GlideAnimation<? super GlideDrawable> glideAnimation) {
                        int width = (int) (d.getIntrinsicWidth() * dpi);
                        int height = (int) (d.getIntrinsicHeight() * dpi);
                        d.setBounds(0, 0, width, height);
                        d.setVisible(true, true);

                        d.setCallback(new Drawable.Callback() {
                            @Override
                            public void invalidateDrawable(Drawable who) {

                            }

                            @Override
                            public void scheduleDrawable(Drawable who, Runnable what, long when) {

                            }

                            @Override
                            public void unscheduleDrawable(Drawable who, Runnable what) {

                            }
                        });

                        urlDrawable.setBounds(0, 0, width, height);
                        urlDrawable.drawable = d;
                        debug("Lisnt1er ended " + width + ", " + height + ", source: " + source + ", animated? " + d.isAnimated() + ", " + d.getClass().getSimpleName());

                        if (d instanceof GifDrawable) {
                            debug("Gif drawable ! animated? " + d.isAnimated() + ", " + (d.getCallback() == null));
                            GifDrawable a = (GifDrawable) d;
                            d.setLoopCount(GlideDrawable.LOOP_FOREVER);
                            d.start();
                        }
                    }

                });
        return urlDrawable;
    }

    private void debug(String msg) {
        Log.d("AAA", msg);
    }
}

================================================
FILE: hydrogen-library/src/main/java/androlua/widget/htmltext/UrlDrawable.java
================================================
package androlua.widget.htmltext;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;

import com.bumptech.glide.load.resource.drawable.GlideDrawable;


public class UrlDrawable extends Drawable {
    public GlideDrawable drawable;

    public UrlDrawable() {
        super();
    }

    @Override
    public void setAlpha(int alpha) {
        if (drawable != null) {
            drawable.setAlpha(alpha);
        }
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
        if (drawable != null) {
            drawable.setColorFilter(cf);
        }
    }

    @Override
    public int getOpacity() {
        if (drawable != null) {
            retu
Download .txt
gitextract_ntyztauy/

├── .gitignore
├── LICENSE
├── PluginDev.md
├── README.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hydrogen-library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── pub/
│       │           └── hanks/
│       │               └── luajandroid/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   ├── androlua/
│       │   │   │   ├── LuaActivity.java
│       │   │   │   ├── LuaAdapter.java
│       │   │   │   ├── LuaBitmap.java
│       │   │   │   ├── LuaBroadcastReceiver.java
│       │   │   │   ├── LuaContext.java
│       │   │   │   ├── LuaDexClassLoader.java
│       │   │   │   ├── LuaDexLoader.java
│       │   │   │   ├── LuaDrawable.java
│       │   │   │   ├── LuaFragment.java
│       │   │   │   ├── LuaGcable.java
│       │   │   │   ├── LuaHttp.java
│       │   │   │   ├── LuaImageLoader.java
│       │   │   │   ├── LuaManager.java
│       │   │   │   ├── LuaPrint.java
│       │   │   │   ├── LuaTimer.java
│       │   │   │   ├── LuaUtil.java
│       │   │   │   ├── LuaView.java
│       │   │   │   ├── LuaWebView.java
│       │   │   │   ├── NineBitmapDrawable.java
│       │   │   │   ├── adapter/
│       │   │   │   │   ├── LuaFragmentPageAdapter.java
│       │   │   │   │   ├── LuaPagerAdapter.java
│       │   │   │   │   ├── LuaRecyclerAdapter.java
│       │   │   │   │   └── LuaRecyclerHolder.java
│       │   │   │   ├── base/
│       │   │   │   │   ├── BaseActivity.java
│       │   │   │   │   └── BaseFragment.java
│       │   │   │   ├── common/
│       │   │   │   │   ├── LuaConstants.java
│       │   │   │   │   ├── LuaFileUtils.java
│       │   │   │   │   ├── LuaLog.java
│       │   │   │   │   ├── LuaSp.java
│       │   │   │   │   ├── LuaStringUtils.java
│       │   │   │   │   └── LuaToast.java
│       │   │   │   ├── fragment/
│       │   │   │   │   └── MenuFragment.java
│       │   │   │   ├── plugin/
│       │   │   │   │   └── Plugin.java
│       │   │   │   ├── utils/
│       │   │   │   │   ├── ColorStateListFactory.java
│       │   │   │   │   ├── DialogUtils.java
│       │   │   │   │   ├── LauncherUtil.java
│       │   │   │   │   └── ShortcutUtils.java
│       │   │   │   └── widget/
│       │   │   │       ├── glide/
│       │   │   │       │   └── LuaGlideModule.java
│       │   │   │       ├── htmltext/
│       │   │   │       │   ├── URLImageParser.java
│       │   │   │       │   └── UrlDrawable.java
│       │   │   │       ├── marqueetext/
│       │   │   │       │   └── MarqueeTextView.java
│       │   │   │       ├── ninegride/
│       │   │   │       │   ├── LuaNineGridView.java
│       │   │   │       │   ├── LuaNineGridViewAdapter.java
│       │   │   │       │   ├── NineGridImageView.java
│       │   │   │       │   └── NineGridImageViewAdapter.java
│       │   │   │       ├── picture/
│       │   │   │       │   ├── ElasticDragDismissFrameLayout.java
│       │   │   │       │   └── PicturePreviewActivity.java
│       │   │   │       ├── statusbar/
│       │   │   │       │   ├── FixInsetsFrameLayout.java
│       │   │   │       │   └── StatusBarView.java
│       │   │   │       ├── swipebacklayout/
│       │   │   │       │   ├── SwipeBackLayout.java
│       │   │   │       │   ├── Utils.java
│       │   │   │       │   ├── ViewDragHelper.java
│       │   │   │       │   └── app/
│       │   │   │       │       ├── SwipeBackActivity.java
│       │   │   │       │       ├── SwipeBackActivityBase.java
│       │   │   │       │       ├── SwipeBackActivityHelper.java
│       │   │   │       │       └── SwipeBackPreferenceActivity.java
│       │   │   │       ├── video/
│       │   │   │       │   └── VideoPlayerActivity.java
│       │   │   │       ├── viewpager/
│       │   │   │       │   └── NoScrollViewPager.java
│       │   │   │       └── webview/
│       │   │   │           └── WebViewActivity.java
│       │   │   └── com/
│       │   │       └── luajava/
│       │   │           ├── Console.java
│       │   │           ├── JavaFunction.java
│       │   │           ├── LuaException.java
│       │   │           ├── LuaFunction.java
│       │   │           ├── LuaInvocationHandler.java
│       │   │           ├── LuaJavaAPI.java
│       │   │           ├── LuaList.java
│       │   │           ├── LuaMetaTable.java
│       │   │           ├── LuaObject.java
│       │   │           ├── LuaStack.java
│       │   │           ├── LuaState.java
│       │   │           ├── LuaStateFactory.java
│       │   │           └── LuaTable.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── bg_circle.xml
│       │       │   ├── bg_rect_radius.xml
│       │       │   ├── ic_loading.xml
│       │       │   ├── layout_selector_tran.xml
│       │       │   ├── loading_shap.xml
│       │       │   ├── shadow_line_bottom.xml
│       │       │   └── shadow_line_top.xml
│       │       ├── layout/
│       │       │   ├── activity_lua.xml
│       │       │   ├── activity_picture.xml
│       │       │   ├── activity_video.xml
│       │       │   ├── activity_webview.xml
│       │       │   ├── dialog_add_shortcut.xml
│       │       │   ├── dialog_input.xml
│       │       │   ├── fragment_menu.xml
│       │       │   └── item_pager_image.xml
│       │       ├── raw/
│       │       │   └── keep.xml
│       │       └── values/
│       │           ├── attrs_elastic_drag_dismiss_frame_layout.xml
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           ├── java/
│           │   └── pub/
│           │       └── hanks/
│           │           └── luajandroid/
│           │               └── ExampleUnitTest.java
│           └── lua/
│               ├── a/
│               │   └── aa.lua
│               ├── a.lua
│               ├── b/
│               │   └── ba.lua
│               └── c/
│                   └── json.lua
├── lua/
│   ├── 163news/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── 500px/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── 91pic/
│   │   ├── info.json
│   │   └── main.lua
│   ├── appinn/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── bilibili/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── btmayi/
│   │   ├── info.json
│   │   └── main.lua
│   ├── buka/
│   │   ├── detail.lua
│   │   ├── fragment_category.lua
│   │   ├── info.json
│   │   ├── main.lua
│   │   ├── search.lua
│   │   └── viewer.lua
│   ├── digit/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── dm5/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   ├── main.lua
│   │   ├── search.lua
│   │   └── viewer.lua
│   ├── douban-daily/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── doubanmovie/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── douyu/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── eyepetizer/
│   │   ├── info.json
│   │   └── main.lua
│   ├── gacha/
│   │   ├── info.json
│   │   └── main.lua
│   ├── gamesky/
│   │   ├── info.json
│   │   └── main.lua
│   ├── graphmovies/
│   │   ├── detail.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── huaban-popular/
│   │   ├── info.json
│   │   └── main.lua
│   ├── iciba/
│   │   ├── info.json
│   │   └── main.lua
│   ├── it168/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── ithome/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── jdly/
│   │   ├── info.json
│   │   └── main.lua
│   ├── jike/
│   │   ├── fragment_feed.lua
│   │   ├── fragment_hot.lua
│   │   ├── fragment_recomend.lua
│   │   ├── info.json
│   │   ├── item_msg.lua
│   │   └── main.lua
│   ├── magmoe-cos/
│   │   ├── info.json
│   │   └── main.lua
│   ├── magmoe-image/
│   │   ├── info.json
│   │   └── main.lua
│   ├── notead/
│   │   ├── info.json
│   │   └── main.lua
│   ├── packwap/
│   │   ├── info.json
│   │   ├── main.lua
│   │   └── testwap.lua
│   ├── papapatimer/
│   │   ├── info.json
│   │   └── main.lua
│   ├── pengpai/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── pixiv/
│   │   ├── info.json
│   │   └── main.lua
│   ├── proxy_fetch/
│   │   ├── info.json
│   │   └── main.lua
│   ├── proxy_fetch_mogu/
│   │   ├── info.json
│   │   └── main.lua
│   ├── qiqu/
│   │   ├── info.json
│   │   └── main.lua
│   ├── qqtools/
│   │   ├── info.json
│   │   └── main.lua
│   ├── quanmm/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── readhub/
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── splash/
│   │   ├── info.json
│   │   └── main.lua
│   ├── sspai/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── taobao/
│   │   ├── info.json
│   │   └── main.lua
│   ├── tieba/
│   │   ├── activity_news_detail.lua
│   │   ├── fragment_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── tv005/
│   │   ├── activity_agc_detail.lua
│   │   ├── fragment_agc_news.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── weather/
│   │   ├── city.lua
│   │   ├── info.json
│   │   ├── list_city.lua
│   │   ├── main.lua
│   │   └── weather.lua
│   ├── weibo-hot/
│   │   ├── info.json
│   │   ├── item_msg.lua
│   │   └── main.lua
│   ├── wikibaidu/
│   │   ├── info.json
│   │   └── main.lua
│   ├── yilin/
│   │   ├── activity_detail.lua
│   │   ├── fragment_yilin.lua
│   │   ├── info.json
│   │   └── main.lua
│   ├── zhihu-recommend/
│   │   ├── info.json
│   │   └── main.lua
│   └── zhihudaliy/
│       ├── activity_zhihu_daliy_detail.lua
│       ├── fragment_zhihu_daliy.lua
│       ├── info.json
│       └── main.lua
├── lua_main/
│   ├── activity_plugins.lua
│   ├── activity_setting.lua
│   ├── filehelper.lua
│   ├── fragment_home.lua
│   ├── fragment_list.lua
│   ├── import.lua
│   ├── json.lua
│   ├── loadbitmap.lua
│   ├── loadlayout.lua
│   ├── loadmenu.lua
│   ├── log.lua
│   ├── main.lua
│   ├── md5.lua
│   └── uihelper.lua
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── pub/
│       │           └── hanks/
│       │               └── sample/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── assets/
│       │   │   └── lua/
│       │   │       ├── activity_plugins.lua
│       │   │       ├── activity_setting.lua
│       │   │       ├── filehelper.lua
│       │   │       ├── fragment_home.lua
│       │   │       ├── fragment_list.lua
│       │   │       ├── import.lua
│       │   │       ├── json.lua
│       │   │       ├── loadbitmap.lua
│       │   │       ├── loadlayout.lua
│       │   │       ├── loadmenu.lua
│       │   │       ├── log.lua
│       │   │       ├── main.lua
│       │   │       ├── md5.lua
│       │   │       └── uihelper.lua
│       │   ├── java/
│       │   │   └── pub/
│       │   │       └── hanks/
│       │   │           └── sample/
│       │   │               ├── App.java
│       │   │               ├── ITHomeUtils.java
│       │   │               ├── SplashActivity.java
│       │   │               └── adapter/
│       │   │                   └── DragTouchHelper.java
│       │   └── res/
│       │       ├── anim/
│       │       │   ├── slide_in_from_bottom.xml
│       │       │   ├── slide_in_right.xml
│       │       │   ├── slide_out_from_bottom.xml
│       │       │   ├── slide_out_left.xml
│       │       │   └── slide_out_right.xml
│       │       ├── drawable/
│       │       │   └── shadow_splash.xml
│       │       ├── layout/
│       │       │   ├── activity_splash.xml
│       │       │   └── upgrade_dialog.xml
│       │       ├── raw/
│       │       │   └── keep.xml
│       │       └── values/
│       │           ├── colors.xml
│       │           ├── strings.xml
│       │           └── styles.xml
│       └── test/
│           └── java/
│               └── pub/
│                   └── hanks/
│                       └── sample/
│                           └── ExampleUnitTest.java
├── script/
│   ├── lua/
│   │   └── buildfile.lua
│   └── node/
│       └── watch/
│           ├── build_lua_main_dir.js
│           ├── exec_luac.js
│           ├── package.json
│           ├── update_plugin_info.js
│           └── watch.js
└── settings.gradle
Download .txt
SYMBOL INDEX (1145 symbols across 83 files)

FILE: hydrogen-library/src/androidTest/java/pub/hanks/luajandroid/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 56) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 58) | @Test
    class MyAdapter (line 192) | class MyAdapter extends BaseAdapter {
      method getCount (line 194) | @Override
      method getItem (line 199) | @Override
      method getItemId (line 204) | @Override
      method getView (line 209) | @Override

FILE: hydrogen-library/src/main/java/androlua/LuaActivity.java
  class LuaActivity (line 41) | public class LuaActivity extends BaseActivity implements LuaContext {
    method start (line 57) | public static void start(Context context, String luaPath) {
    method setContentView (line 63) | public void setContentView(View view) {
    method closeDrawer (line 74) | public void closeDrawer() {
    method setContentView (line 82) | @Override
    method onCreate (line 87) | @Override
    method disableDrawer (line 102) | public void disableDrawer(){
    method initLua (line 109) | private void initLua(Bundle savedInstanceState) {
    method initErrorLayout (line 176) | private void initErrorLayout() {
    method getClassLoaders (line 190) | public ArrayList<ClassLoader> getClassLoaders() {
    method getLibrarys (line 194) | public HashMap<String, String> getLibrarys() {
    method loadResources (line 198) | public void loadResources(String path) {
    method getLuaState (line 202) | public LuaState getLuaState() {
    method onStart (line 206) | @Override
    method onResume (line 212) | @Override
    method onPause (line 218) | @Override
    method onStop (line 224) | @Override
    method onNewIntent (line 230) | @Override
    method onDestroy (line 236) | @Override
    method onActivityResult (line 249) | @Override
    method onBackPressed (line 255) | @Override
    method onKeyDown (line 264) | @Override
    method onKeyUp (line 278) | @Override
    method onKeyLongPress (line 292) | @Override
    method onTouchEvent (line 306) | @Override
    method onCreateOptionsMenu (line 320) | @Override
    method onOptionsItemSelected (line 326) | @Override
    method onCreateContextMenu (line 336) | @Override
    method onContextItemSelected (line 342) | @Override
    method getWidth (line 348) | public int getWidth() {
    method getHeight (line 352) | public int getHeight() {
    method toast (line 356) | public void toast(String msg) {
    method sendMsg (line 362) | public void sendMsg(String msg) {
    class MainHandler (line 374) | private static class MainHandler extends Handler {
      method MainHandler (line 377) | private MainHandler(Activity activity) {
      method handleMessage (line 381) | @Override

FILE: hydrogen-library/src/main/java/androlua/LuaAdapter.java
  class LuaAdapter (line 12) | public class LuaAdapter extends BaseAdapter {
    method LuaAdapter (line 16) | public LuaAdapter(AdapterCreator adapterCreator) {
    method getCount (line 20) | @Override
    method getItem (line 25) | @Override
    method getItemId (line 30) | @Override
    method getView (line 35) | @Override
    type AdapterCreator (line 40) | public interface AdapterCreator {
      method getCount (line 41) | long getCount();
      method getItem (line 43) | Object getItem(int position);
      method getItemId (line 45) | long getItemId(int position);
      method getView (line 47) | View getView(int position, View convertView, ViewGroup parent);

FILE: hydrogen-library/src/main/java/androlua/LuaBitmap.java
  class LuaBitmap (line 20) | public class LuaBitmap {
    method checkCache (line 25) | public static boolean checkCache(LuaContext context, String url) {
    method getLoacalBitmap (line 32) | public static Bitmap getLoacalBitmap(String url) throws FileNotFoundEx...
    method getLoacalBitmap (line 40) | public static Bitmap getLoacalBitmap(LuaContext context, String url) {
    method getHttpBitmap (line 44) | public static Bitmap getHttpBitmap(String url) throws IOException {
    method getHttpBitmap (line 57) | public static Bitmap getHttpBitmap(LuaContext context, String url) thr...
    method getAssetBitmap (line 89) | public static Bitmap getAssetBitmap(Context context, String name) thro...
    method getBitmap (line 97) | public static Bitmap getBitmap(LuaContext context, String path) throws...
    method decodeScale (line 119) | private static Bitmap decodeScale(int IMAGE_MAX_SIZE, File fis) {
    method getImageFromPath (line 138) | public static Bitmap getImageFromPath(String filePath) {
    method computeSampleSize (line 158) | private static int computeSampleSize(BitmapFactory.Options options, in...
    method computeInitialSampleSize (line 172) | private static int computeInitialSampleSize(BitmapFactory.Options opti...
    method getBitmapFromFile (line 190) | public static Bitmap getBitmapFromFile(File file, int width, int heigh...

FILE: hydrogen-library/src/main/java/androlua/LuaBroadcastReceiver.java
  class LuaBroadcastReceiver (line 7) | public class LuaBroadcastReceiver extends BroadcastReceiver {
    method LuaBroadcastReceiver (line 11) | public LuaBroadcastReceiver(OnReceiveListener rlt) {
    method onReceive (line 15) | @Override
    type OnReceiveListener (line 23) | public interface OnReceiveListener {
      method onReceive (line 24) | void onReceive(Context context, Intent intent);

FILE: hydrogen-library/src/main/java/androlua/LuaContext.java
  type LuaContext (line 3) | public interface LuaContext {

FILE: hydrogen-library/src/main/java/androlua/LuaDexClassLoader.java
  class LuaDexClassLoader (line 7) | public class LuaDexClassLoader extends DexClassLoader {
    method LuaDexClassLoader (line 11) | public LuaDexClassLoader(String dexPath, String optimizedDirectory, St...
    method getDexPath (line 16) | public String getDexPath() {
    method findClass (line 20) | protected Class<?> findClass(String name) throws ClassNotFoundException {

FILE: hydrogen-library/src/main/java/androlua/LuaDexLoader.java
  class LuaDexLoader (line 16) | public class LuaDexLoader {
    method LuaDexLoader (line 28) | public LuaDexLoader() {
    method getTheme (line 34) | public Theme getTheme() {
    method getClassLoaders (line 38) | public ArrayList<ClassLoader> getClassLoaders() {
    method loadLibs (line 42) | public void loadLibs() throws LuaException {
    method loadLib (line 55) | public void loadLib(String name) throws LuaException {
    method getLibrarys (line 75) | public HashMap<String, String> getLibrarys() {
    method loadDex (line 79) | public DexClassLoader loadDex(String path) throws LuaException {
    method loadResources (line 108) | public void loadResources(String path) {
    method getAssets (line 123) | public AssetManager getAssets() {
    method getResources (line 127) | public Resources getResources() {

FILE: hydrogen-library/src/main/java/androlua/LuaDrawable.java
  class LuaDrawable (line 18) | public class LuaDrawable extends Drawable {
    method LuaDrawable (line 24) | public LuaDrawable(LuaFunction func) {
    method create (line 28) | public static Drawable create(String filePath) {
    method draw (line 35) | public void draw(Canvas p1) {
    method setAlpha (line 51) | public void setAlpha(int p1) {
    method setColorFilter (line 55) | public void setColorFilter(ColorFilter p1) {
    method getOpacity (line 59) | public int getOpacity() {
    method getPaint (line 63) | public Paint getPaint() {

FILE: hydrogen-library/src/main/java/androlua/LuaFragment.java
  class LuaFragment (line 16) | public class LuaFragment extends Fragment {
    method newInstance (line 20) | public static LuaFragment newInstance() {
    method onPause (line 27) | @Override
    method setUserVisibleHint (line 35) | @Override
    method setCreator (line 41) | public void setCreator(FragmentCreator creator) {
    method onAttach (line 45) | @Override
    method onCreate (line 51) | @Override
    method onCreateView (line 57) | @Nullable
    method onActivityCreated (line 66) | @Override
    method onViewCreated (line 72) | @Override
    method onStart (line 79) | @Override
    method onResume (line 85) | @Override
    method onStop (line 91) | @Override
    method onDestroyView (line 97) | @Override
    method onDestroy (line 103) | @Override
    method onDetach (line 109) | @Override
    type FragmentCreator (line 115) | public interface FragmentCreator {
      method onCreate (line 116) | void onCreate(@Nullable Bundle savedInstanceState);
      method onAttach (line 118) | void onAttach(Context context);
      method onCreateView (line 120) | View onCreateView(LayoutInflater inflater, @Nullable ViewGroup conta...
      method onActivityCreated (line 122) | void onActivityCreated(Bundle savedInstanceState);
      method onViewCreated (line 124) | void onViewCreated(View view, @Nullable Bundle savedInstanceState);
      method onStart (line 126) | void onStart();
      method onResume (line 128) | void onResume();
      method onStop (line 130) | void onStop();
      method onPause (line 132) | void onPause();
      method onDestroyView (line 134) | void onDestroyView();
      method onDestroy (line 136) | void onDestroy();
      method onDetach (line 138) | void onDetach();
      method onUserVisible (line 140) | void onUserVisible(boolean isVisibleToUser);

FILE: hydrogen-library/src/main/java/androlua/LuaGcable.java
  type LuaGcable (line 4) | public interface LuaGcable {
    method gc (line 5) | void gc();

FILE: hydrogen-library/src/main/java/androlua/LuaHttp.java
  class LuaHttp (line 36) | public class LuaHttp {
    method LuaHttp (line 41) | private LuaHttp() {
    method getInstance (line 53) | public static LuaHttp getInstance() {
    method cancelAll (line 64) | public static void cancelAll() {
    method request (line 68) | public static void request(final LuaTable options, final LuaObject cal...
    method requestSync (line 104) | public static void requestSync(final LuaTable options, final LuaObject...
    method buildRequest (line 126) | @NonNull
    method getRequestBody (line 174) | private static RequestBody getRequestBody(LuaTable options) {
    method downloadFile (line 231) | public static boolean downloadFile(String url, String savePath) {
    method downloadFile (line 235) | public static boolean downloadFile(String url, String savePath, ArrayL...

FILE: hydrogen-library/src/main/java/androlua/LuaImageLoader.java
  class LuaImageLoader (line 26) | public class LuaImageLoader {
    method load (line 28) | public static void load(ImageView imageView, String uri) {
    method loadWithRadius (line 31) | public static void loadWithRadius(ImageView imageView, float radius, S...
    method load (line 40) | public static void load(Context context, ImageView imageView, String u...
    method load (line 47) | public static void load(Context context, ImageView imageView, String u...
    method load (line 94) | public static void load(ImageView imageView, String uri, String refere...

FILE: hydrogen-library/src/main/java/androlua/LuaManager.java
  class LuaManager (line 17) | public class LuaManager {
    method LuaManager (line 29) | private LuaManager() {
    method getInstance (line 33) | public static LuaManager getInstance() {
    method init (line 44) | public void init(Context context) {
    method isDebugable (line 60) | public boolean isDebugable() {
    method setDebugable (line 64) | public LuaManager setDebugable(boolean debugable) {
    method doFile (line 70) | public Object doFile(LuaState L, String filePath) throws LuaException {
    method doFile (line 74) | public Object doFile(LuaState L, String filePath, Object[] args) throw...
    method runFunc (line 98) | public Object runFunc(LuaState L, String funcName, Object... args) {
    method doString (line 124) | public Object doString(LuaState L, String funcSrc, Object... args) thr...
    method loadDex (line 145) | public DexClassLoader loadDex(ClassLoader parent, String path) throws ...
    method loadLib (line 158) | public Object loadLib(LuaState L, String soPath) throws LuaException {
    method errorReason (line 174) | private String errorReason(int error) {
    method appendSoDir (line 192) | public void appendSoDir(String dir) {
    method appendLuaDir (line 206) | public void appendLuaDir(LuaState L, String dir) {
    method getContext (line 221) | public Context getContext() {
    method getOdexDir (line 225) | public String getOdexDir() {
    method getLibDir (line 229) | public String getLibDir() {
    method getLuaDir (line 233) | public String getLuaDir() {
    method getLuaExtDir (line 237) | public String getLuaExtDir() {
    method getLuaCpath (line 241) | public String getLuaCpath() {
    method getLuaLpath (line 245) | public String getLuaLpath() {
    method initLua (line 250) | public LuaState initLua() {
    method initLuaPath (line 294) | private void initLuaPath(LuaState L) {

FILE: hydrogen-library/src/main/java/androlua/LuaPrint.java
  class LuaPrint (line 12) | public class LuaPrint extends JavaFunction {
    method LuaPrint (line 17) | public LuaPrint(LuaState L) {
    method execute (line 22) | @Override

FILE: hydrogen-library/src/main/java/androlua/LuaTimer.java
  class LuaTimer (line 4) | public class LuaTimer {

FILE: hydrogen-library/src/main/java/androlua/LuaUtil.java
  class LuaUtil (line 26) | public class LuaUtil {
    method captureScreen (line 35) | public static Bitmap captureScreen(Activity activity) {
    method readAsset (line 81) | public static byte[] readAsset(Context context, String name) throws IO...
    method readAll (line 92) | private static byte[] readAll(InputStream input) throws IOException {
    method assetsToSD (line 105) | public static void assetsToSD(Context context, String InFileName, Stri...
    method copyFile (line 121) | public static void copyFile(String oldPath, String newPath) {
    method rmDir (line 146) | public static void rmDir(File dir) {
    method rmDir (line 157) | public static void rmDir(File dir, String ext) {
    method getContext (line 168) | public static Context getContext() {
    method getDensity (line 172) | public static float getDensity() {
    method dp2px (line 176) | public static int dp2px(float dp) {
    method getScreenWidth (line 181) | public static int getScreenWidth() {
    method getStatusBarHeight (line 185) | protected int getStatusBarHeight() {
    class IntentHelper (line 193) | public static class IntentHelper {
      method getLuaPath (line 194) | public static String getLuaPath(Intent intent) {
      method getArgs (line 200) | public static Object[] getArgs(Intent intent) {
    method isWifi (line 208) | public static boolean isWifi(){

FILE: hydrogen-library/src/main/java/androlua/LuaView.java
  class LuaView (line 14) | public class LuaView extends View {
    method LuaView (line 18) | public LuaView(Context context) {
    method LuaView (line 22) | public LuaView(Context context, @Nullable AttributeSet attrs) {
    method LuaView (line 26) | public LuaView(Context context, @Nullable AttributeSet attrs, int defS...
    method setCreator (line 33) | public void setCreator(Creator creator) {
    method onMeasure (line 37) | @Override
    method onFinishInflate (line 45) | @Override
    method onDraw (line 53) | @Override
    type Creator (line 60) | public interface Creator {
      method init (line 61) | void init(Context context, @Nullable AttributeSet attrs, int defStyl...
      method onDraw (line 63) | void onDraw(Canvas canvas);
      method onFinishInflate (line 65) | void onFinishInflate();
      method onMeasure (line 67) | void onMeasure(int widthMeasureSpec, int heightMeasureSpec);

FILE: hydrogen-library/src/main/java/androlua/LuaWebView.java
  class LuaWebView (line 33) | public class LuaWebView extends WebView {
    method LuaWebView (line 37) | public LuaWebView(Context context) {
    method LuaWebView (line 41) | public LuaWebView(Context context, AttributeSet attrs) {
    method LuaWebView (line 45) | public LuaWebView(Context context, AttributeSet attrs, int defStyleAtt...
    method release (line 83) | public void release() {
    method injectObjectToJavascript (line 92) | public void injectObjectToJavascript(LuaObject luaObject, String objec...
    method setWebChromeClientListener (line 96) | public void setWebChromeClientListener(WebChromeClientListener webChro...
    method setWebViewClientListener (line 100) | public void setWebViewClientListener(WebViewClientListener webViewClie...
    type WebViewClientListener (line 104) | public interface WebViewClientListener {
      method shouldOverrideUrlLoading (line 105) | boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest re...
      method shouldOverrideKeyEvent (line 107) | boolean shouldOverrideKeyEvent(WebView view, KeyEvent event);
      method shouldInterceptRequest (line 109) | WebResourceResponse shouldInterceptRequest(WebView view, WebResource...
      method onPageFinished (line 111) | void onPageFinished(WebView view, String url);
      method onPageStarted (line 113) | void onPageStarted(WebView view, String url, Bitmap favicon);
      method onReceivedError (line 115) | void onReceivedError(WebView view, WebResourceRequest request, WebRe...
    type WebChromeClientListener (line 119) | public interface WebChromeClientListener {
      method onProgressChanged (line 121) | void onProgressChanged(WebView view, int newProgress);
      method onReceivedTitle (line 123) | void onReceivedTitle(WebView view, String title);
      method onReceivedIcon (line 125) | void onReceivedIcon(WebView view, Bitmap icon);
      method onReceivedTouchIconUrl (line 127) | void onReceivedTouchIconUrl(WebView view, String url, boolean precom...
    class JavascriptInterface (line 130) | public static class JavascriptInterface {
      method JavascriptInterface (line 133) | public JavascriptInterface(LuaObject luaObject) {
      method call (line 137) | @android.webkit.JavascriptInterface
    class LuaWebViewClient (line 147) | public class LuaWebViewClient extends WebViewClient {
      method shouldOverrideUrlLoading (line 148) | @Override
      method onReceivedSslError (line 164) | @Override
      method shouldOverrideUrlLoading (line 190) | @Override
      method shouldOverrideKeyEvent (line 199) | @Override
      method onReceivedHttpAuthRequest (line 204) | @Override
      method onReceivedHttpError (line 209) | @Override
      method shouldInterceptRequest (line 214) | @Override
      method onPageFinished (line 222) | @Override
      method onPageStarted (line 230) | @Override
      method onReceivedError (line 238) | @Override
    class LuaWebChromeClient (line 247) | public class LuaWebChromeClient extends WebChromeClient {
      method onProgressChanged (line 249) | @Override
      method onReceivedTitle (line 257) | @Override
      method onReceivedIcon (line 265) | @Override
      method onReceivedTouchIconUrl (line 273) | @Override

FILE: hydrogen-library/src/main/java/androlua/NineBitmapDrawable.java
  class NineBitmapDrawable (line 14) | public class NineBitmapDrawable extends Drawable {
    method NineBitmapDrawable (line 35) | public NineBitmapDrawable(String path) throws IOException {
    method NineBitmapDrawable (line 39) | public NineBitmapDrawable(Bitmap bitmap) {
    method NineBitmapDrawable (line 85) | public NineBitmapDrawable(Bitmap bitmap, int x1, int y1, int x2, int y...
    method init (line 89) | private void init(Bitmap bitmap, int x1, int y1, int x2, int y2) {
    method draw (line 114) | @Override
    method setAlpha (line 146) | @Override
    method setColorFilter (line 151) | @Override
    method getOpacity (line 156) | @Override

FILE: hydrogen-library/src/main/java/androlua/adapter/LuaFragmentPageAdapter.java
  class LuaFragmentPageAdapter (line 11) | public class LuaFragmentPageAdapter extends FragmentPagerAdapter {
    method LuaFragmentPageAdapter (line 15) | public LuaFragmentPageAdapter(FragmentManager fm, AdapterCreator creat...
    method getItem (line 20) | @Override
    method getCount (line 25) | @Override
    method getPageTitle (line 30) | @Override
    type AdapterCreator (line 35) | public interface AdapterCreator {
      method getCount (line 36) | long getCount();
      method getItem (line 38) | Fragment getItem(int position);
      method getPageTitle (line 40) | String getPageTitle(int position);

FILE: hydrogen-library/src/main/java/androlua/adapter/LuaPagerAdapter.java
  class LuaPagerAdapter (line 17) | public class LuaPagerAdapter extends PagerAdapter {
    method LuaPagerAdapter (line 21) | public LuaPagerAdapter(LuaTable luaTable) {
    method addViews (line 25) | public void addViews(LuaTable luaTable) {
    method getCount (line 38) | @Override
    method isViewFromObject (line 43) | @Override
    method instantiateItem (line 48) | @Override
    method destroyItem (line 55) | @Override

FILE: hydrogen-library/src/main/java/androlua/adapter/LuaRecyclerAdapter.java
  class LuaRecyclerAdapter (line 10) | public class LuaRecyclerAdapter extends RecyclerView.Adapter {
    method LuaRecyclerAdapter (line 14) | public LuaRecyclerAdapter(AdapterCreator adapterCreator) {
    method onCreateViewHolder (line 18) | @Override
    method onBindViewHolder (line 23) | @Override
    method getItemViewType (line 28) | @Override
    method getItemCount (line 33) | @Override
    type AdapterCreator (line 38) | public interface AdapterCreator {
      method onCreateViewHolder (line 39) | RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int vie...
      method onBindViewHolder (line 41) | void onBindViewHolder(RecyclerView.ViewHolder holder, int position);
      method getItemViewType (line 43) | long getItemViewType(int position);
      method getItemCount (line 45) | long getItemCount();

FILE: hydrogen-library/src/main/java/androlua/adapter/LuaRecyclerHolder.java
  class LuaRecyclerHolder (line 10) | public class LuaRecyclerHolder extends RecyclerView.ViewHolder {
    method LuaRecyclerHolder (line 11) | public LuaRecyclerHolder(View itemView) {

FILE: hydrogen-library/src/main/java/androlua/base/BaseActivity.java
  class BaseActivity (line 17) | public class BaseActivity extends SwipeBackActivity {
    method onCreate (line 19) | @Override
    method setStatusBarColor (line 32) | public void setStatusBarColor(int color) {
    method setLightStatusBar (line 43) | public void setLightStatusBar() {

FILE: hydrogen-library/src/main/java/androlua/base/BaseFragment.java
  class BaseFragment (line 9) | public class BaseFragment extends Fragment {

FILE: hydrogen-library/src/main/java/androlua/common/LuaConstants.java
  class LuaConstants (line 7) | public class LuaConstants {

FILE: hydrogen-library/src/main/java/androlua/common/LuaFileUtils.java
  class LuaFileUtils (line 50) | public class LuaFileUtils {
    method getContext (line 93) | private static Context getContext() {
    method getFileType (line 103) | public static String getFileType(String filePath) {
    method getFileHeader (line 117) | public static String getFileHeader(String filePath) {
    method bytesToHexString (line 147) | private static String bytesToHexString(byte[] src) {
    method downloadPlugin (line 165) | public static void downloadPlugin(final String url, final String plugi...
    method downloadLuaFile (line 184) | public static void downloadLuaFile(final String url, final LuaObject c...
    method deleteFileOrDir (line 203) | public static void deleteFileOrDir(File file) {
    method removePlugin (line 221) | public static void removePlugin(String pluginId) {
    method getPluginsDir (line 230) | public static String getPluginsDir() {
    method getPluginList (line 234) | public static List<Plugin> getPluginList() {
    method parsePluginInfo (line 259) | private static Plugin parsePluginInfo(File pluginDir) {
    method copyAssetsFlies (line 293) | public static void copyAssetsFlies(String assetDir, String outputDir) {
    method copyFile (line 308) | public static void copyFile(InputStream inStream, String newPath) thro...
    method file2String (line 319) | private static String file2String(File file) {
    method convertViewToImage (line 343) | public static File convertViewToImage(View view, @NonNull String fileP...
    method bitmapToFile (line 369) | public static File bitmapToFile(Bitmap bitmap, File file, Bitmap.Compr...
    method saveImage (line 392) | public static String saveImage(String imagePath) {
    method getImagePath (line 423) | public static String getImagePath(String name) {
    method getPublicPicturePath (line 427) | public static String getPublicPicturePath(String fileName) {
    method getBitmapFromFile (line 437) | public static Bitmap getBitmapFromFile(String name) {
    method makeDefaultCSSFile (line 442) | public static void makeDefaultCSSFile() {
    method makeDefaultCSSFile (line 450) | private static void makeDefaultCSSFile(String path) {
    method convertStreamToString (line 459) | public static String convertStreamToString(InputStream is) {
    method getProjectCSSPath (line 482) | public static String getProjectCSSPath() {
    method getBackupPath (line 486) | public static String getBackupPath() {
    method getBackupNotePath (line 490) | public static String getBackupNotePath() {
    method insureDirExists (line 494) | private static String insureDirExists(String dir) {
    method getProjectImagePath (line 502) | public static String getProjectImagePath() {
    method getProjectPath (line 516) | public static String getProjectPath() {
    method sdCardAvaible (line 526) | public static boolean sdCardAvaible() {
    method saveToFile (line 531) | public static String saveToFile(InputStream in, String filePath) {
    method saveToFile (line 549) | public static String saveToFile(String txt, String filePath) {
    method getFontPath (line 566) | public static String getFontPath(String fontAlias) {
    method unzip (line 583) | public static void unzip(String zipFilePath, String destDirectory) thr...
    method extractFile (line 614) | private static void extractFile(ZipInputStream zipIn, String filePath)...
    method rewriteFile (line 624) | public static void rewriteFile(File file, String content) {
    method getFileContent (line 646) | public static String getFileContent(File file) {
    method deleteFile (line 671) | public static void deleteFile(String path) {
    method deleteDir (line 678) | public static void deleteDir(String dirPath) {
    method writeZip (line 696) | public static void writeZip(File file, String parentPath, ZipOutputStr...
    method getAndroLuaDir (line 734) | public static String getAndroLuaDir() {
    method readAsset (line 746) | public static byte[] readAsset(String name) throws IOException {
    method readAll (line 755) | private static byte[] readAll(InputStream input) throws IOException {
    method assetsToSD (line 768) | public static void assetsToSD(String InFileName, String OutFileName) t...
    method unZipAssets (line 787) | public static void unZipAssets(String assetName, String outputDirector...

FILE: hydrogen-library/src/main/java/androlua/common/LuaLog.java
  class LuaLog (line 13) | public class LuaLog {
    method showLog (line 16) | public static boolean showLog() {
    method i (line 20) | public static void i(String s) {
    method w (line 26) | public static void w(String s) {
    method d (line 32) | public static void d(String s) {
    method e (line 38) | public static void e(String s) {
    method e (line 44) | public static void e(Throwable e) {

FILE: hydrogen-library/src/main/java/androlua/common/LuaSp.java
  class LuaSp (line 13) | public class LuaSp {
    method getInstance (line 18) | public static LuaSp getInstance(String fileName) {
    method LuaSp (line 29) | private LuaSp(String fileName) {
    method save (line 34) | public void save(String key, Object value) {
    method get (line 50) | public <T> T get(String key, T defaultValue) {
    method remove (line 69) | public void remove(String key) {
    method contains (line 78) | public boolean contains(String key) {
    method clear (line 86) | public void clear() {

FILE: hydrogen-library/src/main/java/androlua/common/LuaStringUtils.java
  class LuaStringUtils (line 11) | public class LuaStringUtils {
    method isEmpty (line 14) | public static boolean isEmpty(String s) {
    method trimEnd (line 19) | public static String trimEnd(String s) {
    method isEmptyTrim (line 27) | public static boolean isEmptyTrim(String s) {
    method md5 (line 31) | public static String md5(String source) {
    method isUrl (line 56) | public static boolean isUrl(String str) {

FILE: hydrogen-library/src/main/java/androlua/common/LuaToast.java
  class LuaToast (line 11) | public class LuaToast {
    method show (line 12) | public static void show(String s) {

FILE: hydrogen-library/src/main/java/androlua/fragment/MenuFragment.java
  class MenuFragment (line 40) | public class MenuFragment extends BaseFragment {
    method newInstance (line 41) | public static MenuFragment newInstance() {
    method onCreateView (line 48) | @Nullable
    method onViewCreated (line 55) | @Override
    method showAddShortcutDialog (line 101) | private void showAddShortcutDialog(final Intent intent, String name, S...

FILE: hydrogen-library/src/main/java/androlua/plugin/Plugin.java
  class Plugin (line 11) | public class Plugin {
    method Plugin (line 24) | public Plugin() {
    method isPlugin (line 28) | public boolean isPlugin() {
    method setPlugin (line 32) | public void setPlugin(boolean plugin) {
    method getPath (line 36) | public String getPath() {
    method setPath (line 40) | public void setPath(String path) {
    method getId (line 44) | public String getId() {
    method setId (line 48) | public void setId(String id) {
    method getName (line 52) | public String getName() {
    method setName (line 56) | public void setName(String name) {
    method setUpdateAt (line 60) | public void setUpdateAt(long updateAt) {
    method getUpdateAt (line 64) | public long getUpdateAt() {
    method getIconPath (line 68) | public String getIconPath() {
    method setIconPath (line 85) | public void setIconPath(String iconPath) {
    method getMainPath (line 89) | public String getMainPath() {
    method setMainPath (line 96) | public void setMainPath(String mainPath) {
    method getVersionName (line 100) | public String getVersionName() {
    method setVersionName (line 104) | public void setVersionName(String versionName) {
    method getVersionCode (line 108) | public int getVersionCode() {
    method setVersionCode (line 112) | public void setVersionCode(int versionCode) {

FILE: hydrogen-library/src/main/java/androlua/utils/ColorStateListFactory.java
  class ColorStateListFactory (line 18) | public class ColorStateListFactory {
    method newInstance (line 20) | public static ColorStateList newInstance(int normalColor) {
    method newInstance (line 24) | public static ColorStateList newInstance(int normalColor, int selected...
    method getRippleDrawable (line 42) | public static Drawable getRippleDrawable(
    method getRippleMask (line 52) | private static Drawable getRippleMask(int color) {
    method getStateListDrawable (line 64) | public static StateListDrawable getStateListDrawable(

FILE: hydrogen-library/src/main/java/androlua/utils/DialogUtils.java
  class DialogUtils (line 20) | public class DialogUtils {
    method showWithInput (line 21) | public static AlertDialog showWithInput(Context context, LuaTable conf...

FILE: hydrogen-library/src/main/java/androlua/utils/LauncherUtil.java
  class LauncherUtil (line 12) | public class LauncherUtil {
    method LauncherUtil (line 16) | private LauncherUtil() {
    method getDefaultLauncher (line 19) | public static String getDefaultLauncher(Context context) {
    method getAuthorityFromPermission (line 34) | public static String getAuthorityFromPermission(Context context, Strin...

FILE: hydrogen-library/src/main/java/androlua/utils/ShortcutUtils.java
  class ShortcutUtils (line 14) | public class ShortcutUtils {
    method ShortcutUtils (line 27) | private ShortcutUtils() {
    method installShortcut (line 30) | public static void installShortcut(Context context, String str, int i,...
    method installShortcut (line 34) | public static void installShortcut(final Context context, final String...
    method installShortcut (line 46) | public static void installShortcut(Context context, String str, Bitmap...
    method installShortcut (line 50) | public static void installShortcut(final Context context, final String...
    method uninstallShortcut (line 62) | public static void uninstallShortcut(Context context, String str, Inte...
    method uninstallShortcut (line 66) | public static void uninstallShortcut(final Context context, final Stri...
    method addShortcut (line 78) | private static boolean addShortcut(Context context, String str, int i,...
    method addShortcut (line 91) | private static boolean addShortcut(Context context, String str, Bitmap...
    method removeShortcut (line 103) | private static void removeShortcut(Context context, String str, Intent...
    method hasShortcut (line 111) | public static boolean hasShortcut(Context context, String str) {
    type ActionListener (line 180) | public interface ActionListener {
      method onFailure (line 181) | void onFailure(int i);
      method onSuccess (line 183) | void onSuccess();

FILE: hydrogen-library/src/main/java/androlua/widget/glide/LuaGlideModule.java
  class LuaGlideModule (line 16) | public class LuaGlideModule implements GlideModule {
    method applyOptions (line 17) | @Override
    method registerComponents (line 26) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/htmltext/URLImageParser.java
  class URLImageParser (line 23) | public class URLImageParser implements Html.ImageGetter {
    method URLImageParser (line 26) | public URLImageParser(TextView v) {
    method getDrawable (line 30) | @Override
    method debug (line 97) | private void debug(String msg) {

FILE: hydrogen-library/src/main/java/androlua/widget/htmltext/UrlDrawable.java
  class UrlDrawable (line 12) | public class UrlDrawable extends Drawable {
    method UrlDrawable (line 15) | public UrlDrawable() {
    method setAlpha (line 19) | @Override
    method setColorFilter (line 26) | @Override
    method getOpacity (line 33) | @Override
    method draw (line 41) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/marqueetext/MarqueeTextView.java
  class MarqueeTextView (line 14) | public class MarqueeTextView extends android.support.v7.widget.AppCompat...
    method MarqueeTextView (line 15) | public MarqueeTextView(Context context) {
    method MarqueeTextView (line 19) | public MarqueeTextView(Context context, @Nullable AttributeSet attrs) {
    method MarqueeTextView (line 23) | public MarqueeTextView(Context context, @Nullable AttributeSet attrs, ...
    method isFocused (line 30) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/ninegride/LuaNineGridView.java
  class LuaNineGridView (line 15) | public class LuaNineGridView extends NineGridImageView {
    method LuaNineGridView (line 17) | public LuaNineGridView(Context context) {
    method LuaNineGridView (line 21) | public LuaNineGridView(Context context, AttributeSet attrs) {
    method setImagesData (line 25) | public void setImagesData(LuaTable lists) {

FILE: hydrogen-library/src/main/java/androlua/widget/ninegride/LuaNineGridViewAdapter.java
  class LuaNineGridViewAdapter (line 12) | public class LuaNineGridViewAdapter extends NineGridImageViewAdapter {
    method LuaNineGridViewAdapter (line 15) | public LuaNineGridViewAdapter(AdapterCreator adapterCreator) {
    method onDisplayImage (line 19) | @Override
    method onItemImageClick (line 24) | @Override
    type AdapterCreator (line 30) | public interface AdapterCreator {
      method onDisplayImage (line 31) | void onDisplayImage(Context context, ImageView imageView, String url);
      method onItemImageClick (line 33) | void onItemImageClick(Context context, ImageView imageView, int inde...

FILE: hydrogen-library/src/main/java/androlua/widget/ninegride/NineGridImageView.java
  class NineGridImageView (line 21) | public class NineGridImageView<T> extends ViewGroup {
    method NineGridImageView (line 41) | public NineGridImageView(Context context) {
    method NineGridImageView (line 45) | public NineGridImageView(Context context, AttributeSet attrs) {
    method calculateGridParam (line 61) | protected static int[] calculateGridParam(int imagesSize, int showStyl...
    method setSingleImgSize (line 84) | public void setSingleImgSize(int width, int height) {
    method getAdapter (line 110) | public NineGridImageViewAdapter getAdapter() {
    method setAdapter (line 119) | public void setAdapter(NineGridImageViewAdapter adapter) {
    method onMeasure (line 123) | @Override
    method dp2px (line 157) | private int dp2px(float dp) {
    method getScreenWidth (line 162) | private int getScreenWidth() {
    method onLayout (line 166) | @Override
    method setImagesData (line 196) | public void setImagesData(List<String> lists) {
    method getNeedShowCount (line 239) | private int getNeedShowCount(int size) {
    method getImageView (line 251) | private ImageView getImageView() {
    method setGap (line 267) | public void setGap(int gap) {
    method setShowStyle (line 276) | public void setShowStyle(int showStyle) {
    method setMaxSize (line 286) | public void setMaxSize(int maxSize) {

FILE: hydrogen-library/src/main/java/androlua/widget/ninegride/NineGridImageViewAdapter.java
  class NineGridImageViewAdapter (line 14) | public abstract class NineGridImageViewAdapter {
    method onDisplayImage (line 15) | protected abstract void onDisplayImage(Context context, ImageView imag...
    method onItemImageClick (line 17) | protected void onItemImageClick(Context context, ImageView imageView, ...
    method generateImageView (line 20) | protected ImageView generateImageView(Context context) {

FILE: hydrogen-library/src/main/java/androlua/widget/picture/ElasticDragDismissFrameLayout.java
  class ElasticDragDismissFrameLayout (line 36) | public class ElasticDragDismissFrameLayout extends FrameLayout {
    method ElasticDragDismissFrameLayout (line 65) | public ElasticDragDismissFrameLayout(Context context) {
    method ElasticDragDismissFrameLayout (line 69) | public ElasticDragDismissFrameLayout(Context context, AttributeSet att...
    method ElasticDragDismissFrameLayout (line 73) | public ElasticDragDismissFrameLayout(Context context, AttributeSet attrs,
    method init (line 79) | private void init() {
    class ElasticDragDismissCallback (line 91) | public static abstract class ElasticDragDismissCallback {
      method onDrag (line 104) | public void onDrag(float elasticOffset, float elasticOffsetPixels,
      method onDragDismissed (line 111) | public void onDragDismissed() {
    method onStartNestedScroll (line 116) | @Override
    method onNestedPreScroll (line 121) | @Override
    method onNestedScroll (line 133) | @Override
    method onStopNestedScroll (line 141) | @Override
    method onSizeChanged (line 175) | @Override
    method addListener (line 183) | public void addListener(ElasticDragDismissCallback listener) {
    method setEnabled (line 190) | public void setEnabled(boolean enabled) {
    method isEnabled (line 194) | public boolean isEnabled() {
    method removeListener (line 198) | public void removeListener(ElasticDragDismissCallback listener) {
    method dragScale (line 204) | private void dragScale(int scroll) {
    method dispatchDragCallback (line 273) | private void dispatchDragCallback(float elasticOffset, float elasticOf...
    method dispatchDismissCallback (line 283) | private void dispatchDismissCallback() {
    method isDragging (line 291) | public boolean isDragging() {
    method setDragElasticity (line 296) | public void setDragElasticity(float elasticity) {
    method halfDistanceRequired (line 300) | public void halfDistanceRequired() {

FILE: hydrogen-library/src/main/java/androlua/widget/picture/PicturePreviewActivity.java
  class PicturePreviewActivity (line 60) | public class PicturePreviewActivity extends AppCompatActivity {
    method start (line 73) | public static void start(Context context, String json) {
    method setStatusBarColor (line 80) | public void setStatusBarColor(int color) {
    method onCreate (line 92) | @Override
    method getData (line 188) | private void getData() {
    method downloadPicture (line 234) | private void downloadPicture(Context context, final String uri, final ...
    method onRequestPermissionsResult (line 268) | @Override
    method requestPermission (line 282) | private void requestPermission() {
    class PicturePreviewFragment (line 289) | public static class PicturePreviewFragment extends BaseFragment {
      method newInstance (line 295) | public static PicturePreviewFragment newInstance(String uri, ArrayLi...
      method newInstance (line 304) | public static PicturePreviewFragment newInstance(String uri) {
      method setOnClickImageListener (line 312) | public void setOnClickImageListener(View.OnClickListener listener) {
      method onCreateView (line 317) | @Nullable
      method onViewCreated (line 324) | @Override
      method hideLoading (line 387) | private void hideLoading() {
      method getImageSize (line 393) | public void getImageSize(File file, int[] size) {
      method loadFile (line 401) | public void loadFile(File file) {
    method finish (line 432) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/statusbar/FixInsetsFrameLayout.java
  class FixInsetsFrameLayout (line 29) | public final class FixInsetsFrameLayout extends FrameLayout {
    method FixInsetsFrameLayout (line 32) | public FixInsetsFrameLayout(Context context) {
    method FixInsetsFrameLayout (line 36) | public FixInsetsFrameLayout(Context context, AttributeSet attrs) {
    method FixInsetsFrameLayout (line 40) | public FixInsetsFrameLayout(Context context, AttributeSet attrs, int d...
    method setInsetEnable (line 46) | public void setInsetEnable(boolean insetEnable) {
    method fitSystemWindows (line 50) | @Override
    method onApplyWindowInsets (line 68) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/statusbar/StatusBarView.java
  class StatusBarView (line 16) | public class StatusBarView extends View {
    method StatusBarView (line 20) | public StatusBarView(Context context) {
    method StatusBarView (line 24) | public StatusBarView(Context context, AttributeSet attrs) {
    method StatusBarView (line 28) | public StatusBarView(Context context, AttributeSet attrs, int defStyle) {
    method setStatusBarColor (line 34) | public void setStatusBarColor(int statusBarColor) {
    method setStatusBarHeight (line 39) | public void setStatusBarHeight(int statusBarHeight) {
    method onDraw (line 45) | @Override
    method onMeasure (line 50) | @Override
    method getStatusBarHeight (line 55) | private int getStatusBarHeight(Context context) {
    method getNavigationBarHeight (line 67) | private int getNavigationBarHeight(Context context) {

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/SwipeBackLayout.java
  class SwipeBackLayout (line 25) | public class SwipeBackLayout extends FrameLayout {
    method SwipeBackLayout (line 120) | public SwipeBackLayout(Context context) {
    method SwipeBackLayout (line 124) | public SwipeBackLayout(Context context, AttributeSet attrs) {
    method SwipeBackLayout (line 128) | public SwipeBackLayout(Context context, AttributeSet attrs, int defSty...
    method dp2px (line 146) | private int dp2px(float dp) {
    method setSensitivity (line 160) | public void setSensitivity(Context context, float sensitivity) {
    method setContentView (line 169) | private void setContentView(View view) {
    method setEnableGesture (line 173) | public void setEnableGesture(boolean enable) {
    method setEdgeTrackingEnabled (line 191) | public void setEdgeTrackingEnabled(int edgeFlags) {
    method setScrimColor (line 202) | public void setScrimColor(int color) {
    method setEdgeSize (line 214) | public void setEdgeSize(int size) {
    method setSwipeListener (line 225) | @Deprecated
    method addSwipeListener (line 235) | public void addSwipeListener(SwipeListener listener) {
    method removeSwipeListener (line 247) | public void removeSwipeListener(SwipeListener listener) {
    method setScrollThresHold (line 260) | public void setScrollThresHold(float threshold) {
    method setShadow (line 275) | public void setShadow(Drawable shadow, int edgeFlag) {
    method setShadow (line 294) | public void setShadow(int resId, int edgeFlag) {
    method scrollToFinishActivity (line 301) | public void scrollToFinishActivity() {
    method onInterceptTouchEvent (line 321) | @Override
    method onTouchEvent (line 335) | @Override
    method onLayout (line 344) | @Override
    method requestLayout (line 354) | @Override
    method drawChild (line 361) | @Override
    method drawScrim (line 374) | private void drawScrim(Canvas canvas, View child) {
    method drawShadow (line 389) | private void drawShadow(Canvas canvas, View child) {
    method attachToActivity (line 415) | public void attachToActivity(Activity activity) {
    method computeScroll (line 432) | @Override
    type SwipeListener (line 440) | public static interface SwipeListener {
      method onScrollStateChange (line 450) | public void onScrollStateChange(int state, float scrollPercent);
      method onEdgeTouch (line 460) | public void onEdgeTouch(int edgeFlag);
      method onScrollOverThreshold (line 465) | public void onScrollOverThreshold();
    class ViewDragCallback (line 468) | private class ViewDragCallback extends ViewDragHelper.Callback {
      method tryCaptureView (line 471) | @Override
      method getViewHorizontalDragRange (line 492) | @Override
      method getViewVerticalDragRange (line 497) | @Override
      method onViewPositionChanged (line 502) | @Override
      method onViewReleased (line 538) | @Override
      method clampViewPositionHorizontal (line 559) | @Override
      method clampViewPositionVertical (line 570) | @Override
      method onViewDragStateChanged (line 579) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/Utils.java
  class Utils (line 10) | public class Utils {
    method Utils (line 11) | private Utils() {
    method convertActivityFromTranslucent (line 26) | public static void convertActivityFromTranslucent(Activity activity) {
    method convertActivityToTranslucent (line 47) | public static void convertActivityToTranslucent(Activity activity) {

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/ViewDragHelper.java
  class ViewDragHelper (line 39) | public class ViewDragHelper {
    method getInterpolation (line 100) | public float getInterpolation(float t) {
    method run (line 129) | public void run() {
    method ViewDragHelper (line 143) | private ViewDragHelper(Context context, ViewGroup forParent, Callback ...
    method create (line 171) | public static ViewDragHelper create(ViewGroup forParent, Callback cb) {
    method create (line 185) | public static ViewDragHelper create(ViewGroup forParent, float sensiti...
    method setSensitivity (line 198) | public void setSensitivity(Context context, float sensitivity) {
    method setMaxVelocity (line 211) | public void setMaxVelocity(float maxVel) {
    method getMinVelocity (line 223) | public float getMinVelocity() {
    method setMinVelocity (line 234) | public void setMinVelocity(float minVel) {
    method getViewDragState (line 244) | public int getViewDragState() {
    method setEdgeTrackingEnabled (line 263) | public void setEdgeTrackingEnabled(int edgeFlags) {
    method getEdgeSize (line 275) | public int getEdgeSize() {
    method setEdgeSize (line 286) | public void setEdgeSize(int size) {
    method captureChildView (line 300) | public void captureChildView(View childView, int activePointerId) {
    method getCapturedView (line 316) | public View getCapturedView() {
    method getActivePointerId (line 324) | public int getActivePointerId() {
    method getTouchSlop (line 332) | public int getTouchSlop() {
    method cancel (line 341) | public void cancel() {
    method abort (line 355) | public void abort() {
    method smoothSlideViewTo (line 386) | public boolean smoothSlideViewTo(View child, int finalLeft, int finalT...
    method settleCapturedViewAt (line 406) | public boolean settleCapturedViewAt(int finalLeft, int finalTop) {
    method forceSettleCapturedViewAt (line 427) | private boolean forceSettleCapturedViewAt(int finalLeft, int finalTop,...
    method computeSettleDuration (line 447) | private int computeSettleDuration(View child, int dx, int dy, int xvel...
    method computeAxisDuration (line 468) | private int computeAxisDuration(int delta, int velocity, int motionRan...
    method clampMag (line 500) | private int clampMag(int value, int absMin, int absMax) {
    method clampMag (line 519) | private float clampMag(float value, float absMin, float absMax) {
    method distanceInfluenceForSnapDuration (line 528) | private float distanceInfluenceForSnapDuration(float f) {
    method flingCapturedView (line 544) | public void flingCapturedView(int minLeft, int minTop, int maxLeft, in...
    method continueSettling (line 569) | public boolean continueSettling(boolean deferCallbacks) {
    method dispatchViewReleased (line 614) | private void dispatchViewReleased(float xvel, float yvel) {
    method clearMotionHistory (line 626) | private void clearMotionHistory() {
    method clearMotionHistory (line 640) | private void clearMotionHistory(int pointerId) {
    method ensureMotionHistorySizeForId (line 654) | private void ensureMotionHistorySizeForId(int pointerId) {
    method saveInitialMotion (line 684) | private void saveInitialMotion(float x, float y, int pointerId) {
    method saveLastMotion (line 692) | private void saveLastMotion(MotionEvent ev) {
    method isPointerDown (line 718) | public boolean isPointerDown(int pointerId) {
    method setDragState (line 722) | void setDragState(int state) {
    method tryCaptureViewForDrag (line 742) | boolean tryCaptureViewForDrag(View toCapture, int pointerId) {
    method canScroll (line 767) | protected boolean canScroll(View v, boolean checkV, int dx, int dy, in...
    method shouldInterceptTouchEvent (line 804) | public boolean shouldInterceptTouchEvent(MotionEvent ev) {
    method processTouchEvent (line 913) | public void processTouchEvent(MotionEvent ev) {
    method reportNewEdgeDrags (line 1075) | private void reportNewEdgeDrags(float dx, float dy, int pointerId) {
    method checkNewEdgeDrag (line 1096) | private boolean checkNewEdgeDrag(float delta, float odelta, int pointe...
    method checkTouchSlop (line 1123) | private boolean checkTouchSlop(View child, float dx, float dy) {
    method checkTouchSlop (line 1156) | public boolean checkTouchSlop(int directions) {
    method checkTouchSlop (line 1184) | public boolean checkTouchSlop(int directions, int pointerId) {
    method isEdgeTouched (line 1216) | public boolean isEdgeTouched(int edges) {
    method isEdgeTouched (line 1238) | public boolean isEdgeTouched(int edges, int pointerId) {
    method releaseViewForPointerUp (line 1242) | private void releaseViewForPointerUp() {
    method dragTo (line 1253) | private void dragTo(int left, int top, int dx, int dy) {
    method isCapturedViewUnder (line 1285) | public boolean isCapturedViewUnder(int x, int y) {
    method isViewUnder (line 1299) | public boolean isViewUnder(View view, int x, int y) {
    method findTopChildUnder (line 1317) | public View findTopChildUnder(int x, int y) {
    method getEdgeTouched (line 1329) | private int getEdgeTouched(int x, int y) {
    class Callback (line 1352) | public static abstract class Callback {
      method onViewDragStateChanged (line 1362) | public void onViewDragStateChanged(int state) {
      method onViewPositionChanged (line 1375) | public void onViewPositionChanged(View changedView, int left, int to...
      method onViewCaptured (line 1387) | public void onViewCaptured(View capturedChild, int activePointerId) {
      method onViewReleased (line 1412) | public void onViewReleased(View releasedChild, float xvel, float yve...
      method onEdgeTouched (line 1427) | public void onEdgeTouched(int edgeFlags, int pointerId) {
      method onEdgeLock (line 1441) | public boolean onEdgeLock(int edgeFlags) {
      method onEdgeDragStarted (line 1458) | public void onEdgeDragStarted(int edgeFlags, int pointerId) {
      method getOrderedChildIndex (line 1468) | public int getOrderedChildIndex(int index) {
      method getViewHorizontalDragRange (line 1480) | public int getViewHorizontalDragRange(View child) {
      method getViewVerticalDragRange (line 1492) | public int getViewVerticalDragRange(View child) {
      method tryCaptureView (line 1516) | public abstract boolean tryCaptureView(View child, int pointerId);
      method clampViewPositionHorizontal (line 1529) | public int clampViewPositionHorizontal(View child, int left, int dx) {
      method clampViewPositionVertical (line 1544) | public int clampViewPositionVertical(View child, int top, int dy) {

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackActivity.java
  class SwipeBackActivity (line 11) | public class SwipeBackActivity extends AppCompatActivity implements Swip...
    method onCreate (line 15) | @Override
    method onResume (line 22) | @Override
    method onPostCreate (line 28) | @Override
    method findViewById (line 36) | @Override
    method getSwipeBackLayout (line 44) | @Override
    method setSwipeBackEnable (line 49) | @Override
    method scrollToFinishActivity (line 54) | @Override
    method needPostCreate (line 60) | protected boolean needPostCreate() {

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackActivityBase.java
  type SwipeBackActivityBase (line 9) | public interface SwipeBackActivityBase {
    method getSwipeBackLayout (line 13) | public abstract SwipeBackLayout getSwipeBackLayout();
    method setSwipeBackEnable (line 15) | public abstract void setSwipeBackEnable(boolean enable);
    method scrollToFinishActivity (line 20) | public abstract void scrollToFinishActivity();

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackActivityHelper.java
  class SwipeBackActivityHelper (line 16) | public class SwipeBackActivityHelper {
    method SwipeBackActivityHelper (line 21) | public SwipeBackActivityHelper(Activity activity) {
    method onActivityCreate (line 25) | @SuppressWarnings("deprecation")
    method onPostCreate (line 48) | public void onPostCreate() {
    method findViewById (line 52) | public View findViewById(int id) {
    method getSwipeBackLayout (line 59) | public SwipeBackLayout getSwipeBackLayout() {

FILE: hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackPreferenceActivity.java
  class SwipeBackPreferenceActivity (line 10) | public class SwipeBackPreferenceActivity extends PreferenceActivity impl...
    method onCreate (line 13) | @Override
    method onPostCreate (line 20) | @Override
    method findViewById (line 26) | @Override
    method getSwipeBackLayout (line 34) | @Override
    method setSwipeBackEnable (line 39) | @Override
    method scrollToFinishActivity (line 44) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/video/VideoPlayerActivity.java
  class VideoPlayerActivity (line 23) | public class VideoPlayerActivity extends BaseActivity {
    method start (line 25) | public static void start(Context context, String json) {
    method onCreate (line 31) | @Override
    method onBackPressed (line 54) | @Override
    method onPause (line 62) | @Override

FILE: hydrogen-library/src/main/java/androlua/widget/viewpager/NoScrollViewPager.java
  class NoScrollViewPager (line 14) | public class NoScrollViewPager extends ViewPager {
    method NoScrollViewPager (line 18) | public NoScrollViewPager(Context context) {
    method NoScrollViewPager (line 22) | public NoScrollViewPager(Context context, AttributeSet attrs) {
    method onTouchEvent (line 26) | @Override
    method onInterceptTouchEvent (line 31) | @Override
    method canScroll (line 37) | @Override
    method setPagingEnabled (line 48) | public void setPagingEnabled(boolean b) {

FILE: hydrogen-library/src/main/java/androlua/widget/webview/WebViewActivity.java
  class WebViewActivity (line 38) | public class WebViewActivity extends BaseActivity {
    method start (line 51) | public static void start(Context context, String url) {
    method start (line 55) | public static void start(Context context, String url, int color) {
    method onCreate (line 62) | @Override
    method canAsBgColor (line 217) | private boolean canAsBgColor(int i) {
    method fetchColor (line 221) | private void fetchColor() {
    method onBackPressed (line 238) | @Override
    method onDestroy (line 248) | @Override

FILE: hydrogen-library/src/main/java/com/luajava/Console.java
  class Console (line 6) | public class Console {
    method main (line 7) | public static void main(String[] args) {

FILE: hydrogen-library/src/main/java/com/luajava/JavaFunction.java
  class JavaFunction (line 3) | public abstract class JavaFunction {
    method JavaFunction (line 6) | public JavaFunction(LuaState L) {
    method execute (line 10) | public abstract int execute() throws LuaException;
    method getParam (line 12) | public LuaObject getParam(int idx) {
    method register (line 16) | public void register(String name) throws LuaException {

FILE: hydrogen-library/src/main/java/com/luajava/LuaException.java
  class LuaException (line 32) | public class LuaException extends Exception {
    method LuaException (line 38) | public LuaException(String str) {
    method LuaException (line 46) | public LuaException(Exception e) {

FILE: hydrogen-library/src/main/java/com/luajava/LuaFunction.java
  class LuaFunction (line 3) | public class LuaFunction<T extends Object> extends LuaObject implements ...
    method LuaFunction (line 5) | protected LuaFunction(LuaState L, String globalName) {
    method LuaFunction (line 9) | protected LuaFunction(LuaState L, int index) {
    method __call (line 13) | @Override
    method __index (line 19) | @Override
    method __newIndex (line 25) | @Override
    method call (line 30) | @Override

FILE: hydrogen-library/src/main/java/com/luajava/LuaInvocationHandler.java
  class LuaInvocationHandler (line 39) | public class LuaInvocationHandler implements InvocationHandler {
    method LuaInvocationHandler (line 47) | public LuaInvocationHandler(LuaObject obj) {
    method invoke (line 56) | public Object invoke(Object proxy, Method method, Object[] args) throw...

FILE: hydrogen-library/src/main/java/com/luajava/LuaJavaAPI.java
  class LuaJavaAPI (line 46) | public final class LuaJavaAPI {
    method LuaJavaAPI (line 72) | private LuaJavaAPI() {
    method objectIndex (line 84) | public static int objectIndex(long luaState, Object obj, String search...
    method callMethod (line 116) | public static int callMethod(long luaState, Object obj, String cacheName)
    method objectNewIndex (line 192) | public static int objectNewIndex(long luaState, Object obj, String sea...
    method setFieldValue (line 211) | public static int setFieldValue(LuaState L, Object obj, String fieldNa...
    method argError (line 261) | private static String argError(LuaState L, String name, int idx, Class...
    method typeName (line 267) | private static String typeName(LuaState L, int idx) throws LuaException {
    method setArrayValue (line 299) | public static int setArrayValue(long luaState, Object obj, int index) ...
    method getArrayValue (line 322) | public static int getArrayValue(long luaState, Object obj, int index) ...
    method asTable (line 341) | public static int asTable(long luaState, Object obj) throws LuaExcepti...
    method newArray (line 387) | public static int newArray(long luaState, Class<?> clazz, int size) th...
    method newArray (line 400) | public static int newArray(long luaState, Class<?> clazz) throws LuaEx...
    method javaBindClass (line 418) | public static Class javaBindClass(String className) throws LuaException {
    method javaNewInstance (line 454) | public static int javaNewInstance(long luaState, String className) thr...
    method javaNew (line 475) | public static int javaNew(long luaState, Class<?> clazz) throws LuaExc...
    method javaCreate (line 487) | public static int javaCreate(long luaState, Class<?> clazz) throws Lua...
    method objectCall (line 538) | public static int objectCall(long luaState, Object obj) throws LuaExce...
    method createProxy (line 565) | public static int createProxy(long luaState, String implem)
    method createArray (line 573) | public static int createArray(long luaState, String className)
    method javaLoadLib (line 592) | public static int javaLoadLib(long luaState, String className, String ...
    method javaToString (line 618) | public static int javaToString(long luaState, Object obj) throws LuaEx...
    method javaEquals (line 630) | public static int javaEquals(long luaState, Object obj, Object obj2) t...
    method javaObjectLength (line 640) | public static int javaObjectLength(long luaState, Object obj) throws L...
    method getObjInstance (line 665) | private static int getObjInstance(LuaState L, Class<?> clazz) throws L...
    method checkField (line 747) | public static int checkField(LuaState L, Object obj, String fieldName)
    method checkMethod (line 798) | public static int checkMethod(LuaState L, Object obj, String methodNam...
    method checkClass (line 855) | public static int checkClass(LuaState L, Object obj, String className)...
    method javaGetter (line 877) | public static int javaGetter(LuaState L, Object obj, String methodName...
    method javaSetter (line 918) | public static int javaSetter(LuaState L, Object obj, String methodName...
    method javaSetListener (line 949) | private static int javaSetListener(LuaState L, Object obj, String meth...
    method javaSetMethod (line 976) | private static int javaSetMethod(LuaState L, Object obj, String method...
    method createProxyObject (line 1013) | private static int createProxyObject(LuaState L, String implem)
    method createProxyObject (line 1028) | private static int createProxyObject(LuaState L, Class implem) throws ...
    method createProxyObject (line 1035) | private static Object createProxyObject(LuaState L, Class implem, int ...
    method createArray (line 1047) | private static int createArray(LuaState L, Class<?> type) throws LuaEx...
    method createArray (line 1054) | private static Object createArray(LuaState L, Class<?> type, int idx) ...
    method createList (line 1131) | private static int createList(LuaState L, Class<?> type) throws LuaExc...
    method createList (line 1138) | private static Object createList(LuaState L, Class<?> type, int idx) t...
    method createMap (line 1159) | private static int createMap(LuaState L, Class<?> clazz) throws LuaExc...
    method createMap (line 1167) | private static Object createMap(LuaState L, Class<?> clazz, int idx) t...
    method compareTypes (line 1187) | private static Object compareTypes(LuaState L, Class<?> parameter, int...
    method toPrimitive (line 1292) | private static int toPrimitive(LuaState L, Class type, int idx) throws...

FILE: hydrogen-library/src/main/java/com/luajava/LuaList.java
  class LuaList (line 8) | public class LuaList extends LuaObject implements List {
    method LuaList (line 10) | protected LuaList(LuaState L, String globalName) {
    method LuaList (line 14) | protected LuaList(LuaState L, int index) {
    method LuaList (line 18) | public LuaList(LuaState L) {
    method clear (line 24) | @Override
    method isEmpty (line 29) | @Override
    method remove (line 38) | @Override
    method size (line 44) | @Override
    method add (line 53) | @Override
    method add (line 58) | @Override
    method addAll (line 74) | @Override
    method addAll (line 80) | @Override
    method contains (line 86) | @Override
    method containsAll (line 92) | @Override
    method get (line 98) | @Override
    method indexOf (line 104) | @Override
    method iterator (line 110) | @Override
    method lastIndexOf (line 116) | @Override
    method listIterator (line 122) | @Override
    method listIterator (line 128) | @Override
    method remove (line 134) | @Override
    method removeAll (line 140) | @Override
    method retainAll (line 146) | @Override
    method set (line 152) | @Override
    method subList (line 158) | @Override
    method toArray (line 164) | @Override
    method toArray (line 170) | @Override

FILE: hydrogen-library/src/main/java/com/luajava/LuaMetaTable.java
  type LuaMetaTable (line 3) | public interface LuaMetaTable {
    method __call (line 4) | public Object __call(Object... arg) throws LuaException;
    method __index (line 6) | public Object __index(String key);
    method __newIndex (line 8) | public void __newIndex(String key, Object value);

FILE: hydrogen-library/src/main/java/com/luajava/LuaObject.java
  class LuaObject (line 57) | public class LuaObject {
    method LuaObject (line 63) | protected LuaObject(LuaState L) {
    method LuaObject (line 73) | protected LuaObject(LuaState L, String globalName) {
    method LuaObject (line 88) | protected LuaObject(LuaObject parent, String name) throws LuaException {
    method LuaObject (line 112) | protected LuaObject(LuaObject parent, Number name) throws LuaException {
    method LuaObject (line 134) | protected LuaObject(LuaObject parent, LuaObject name) throws LuaExcept...
    method LuaObject (line 158) | protected LuaObject(LuaState L, int index) {
    method getLuaState (line 169) | public LuaState getLuaState() {
    method registerValue (line 178) | protected void registerValue(int index) {
    method finalize (line 187) | protected void finalize() {
    method push (line 201) | public void push() {
    method pop (line 205) | public void pop() {
    method isNil (line 209) | public boolean isNil() {
    method isBoolean (line 218) | public boolean isBoolean() {
    method isNumber (line 227) | public boolean isNumber() {
    method isInteger (line 236) | public boolean isInteger() {
    method isString (line 245) | public boolean isString() {
    method isFunction (line 254) | public boolean isFunction() {
    method isJavaObject (line 263) | public boolean isJavaObject() {
    method isJavaFunction (line 272) | public boolean isJavaFunction() {
    method isTable (line 281) | public boolean isTable() {
    method isUserdata (line 290) | public boolean isUserdata() {
    method type (line 299) | public int type() {
    method getBoolean (line 308) | public boolean getBoolean() {
    method getNumber (line 317) | public double getNumber() {
    method getInteger (line 326) | public long getInteger() {
    method getString (line 335) | public String getString() {
    method getTable (line 344) | public LuaTable<?, ?> getTable() {
    method getFunction (line 353) | public LuaFunction<?> getFunction() {
    method getObject (line 363) | public Object getObject() throws LuaException {
    method getField (line 376) | public LuaObject getField(String field) throws LuaException {
    method setField (line 380) | public void setField(String field, Object obj) {
    method getI (line 391) | public LuaObject getI(long idx) throws LuaException {
    method setI (line 395) | public void setI(long idx, Object obj) {
    method callx (line 416) | public Object[] callx(Object[] args, int nres) throws LuaException {
    method call (line 480) | public Object call(Object... args) throws LuaException {
    method dump (line 484) | public byte[] dump() throws LuaException {
    method asArray (line 496) | public Object[] asArray() throws IllegalArgumentException, ArrayIndexO...
    method asMap (line 517) | public Map asMap(LuaState L, Class<?> clazz, int idx) throws LuaExcept...
    method toString (line 537) | public String toString() {
    method createProxy (line 571) | public Object createProxy(String implem) throws ClassNotFoundException...
    method createProxy (line 587) | public Object createProxy(Class implem) throws LuaException {

FILE: hydrogen-library/src/main/java/com/luajava/LuaStack.java
  class LuaStack (line 5) | public class LuaStack {
    method put (line 8) | public static void put(String name, LuaState L) {
    method get (line 12) | public static LuaState get(String name) {
    method call (line 16) | public static Object call(String name, String func, Object[] arg) thro...

FILE: hydrogen-library/src/main/java/com/luajava/LuaState.java
  class LuaState (line 5) | public class LuaState {
    method LuaState (line 55) | protected LuaState() {
    method LuaState (line 59) | protected LuaState(long luaState) {
    method convertLuaNumber (line 64) | public static Number convertLuaNumber(Double db, Class<?> retType) {
    method convertLuaNumber (line 107) | public static Number convertLuaNumber(Long lg, Class<?> retType) {
    method _LargError (line 150) | private native synchronized int _LargError(long j, int i, String str);
    method _LcallMeta (line 152) | private native synchronized int _LcallMeta(long j, int i, String str);
    method _LcheckAny (line 154) | private native synchronized void _LcheckAny(long j, int i);
    method _LcheckInteger (line 156) | private native synchronized int _LcheckInteger(long j, int i);
    method _LcheckNumber (line 158) | private native synchronized double _LcheckNumber(long j, int i);
    method _LcheckStack (line 160) | private native synchronized void _LcheckStack(long j, int i, String str);
    method _LcheckString (line 162) | private native synchronized String _LcheckString(long j, int i);
    method _LcheckType (line 164) | private native synchronized void _LcheckType(long j, int i, int i2);
    method _LdoFile (line 166) | private native synchronized int _LdoFile(long j, String str);
    method _LdoString (line 168) | private native synchronized int _LdoString(long j, String str);
    method _LgetMetaField (line 170) | private native synchronized int _LgetMetaField(long j, int i, String s...
    method _LgetMetatable (line 172) | private native synchronized void _LgetMetatable(long j, String str);
    method _Lgsub (line 174) | private native synchronized String _Lgsub(long j, String str, String s...
    method _LloadBuffer (line 176) | private native synchronized int _LloadBuffer(long j, byte[] bArr, long...
    method _LloadFile (line 178) | private native synchronized int _LloadFile(long j, String str);
    method _LloadString (line 180) | private native synchronized int _LloadString(long j, String str);
    method _LnewMetatable (line 182) | private native synchronized int _LnewMetatable(long j, String str);
    method _LoptInteger (line 184) | private native synchronized int _LoptInteger(long j, int i, int i2);
    method _LoptNumber (line 186) | private native synchronized double _LoptNumber(long j, int i, double d);
    method _LoptString (line 188) | private native synchronized String _LoptString(long j, int i, String s...
    method _Lref (line 190) | private native synchronized int _Lref(long j, int i);
    method _LunRef (line 192) | private native synchronized void _LunRef(long j, int i, int i2);
    method _Lwhere (line 194) | private native synchronized void _Lwhere(long j, int i);
    method _call (line 196) | private native synchronized void _call(long j, int i, int i2);
    method _checkStack (line 198) | private native synchronized int _checkStack(long j, int i);
    method _close (line 200) | private native synchronized void _close(long j);
    method _compare (line 202) | private native synchronized int _compare(long j, int i, int i2, int i3);
    method _concat (line 204) | private native synchronized void _concat(long j, int i);
    method _copy (line 206) | private native synchronized void _copy(long j, int i, int i2);
    method _createTable (line 208) | private native synchronized void _createTable(long j, int i, int i2);
    method _dump (line 210) | private native synchronized byte[] _dump(long j, int i);
    method _equal (line 212) | private native synchronized int _equal(long j, int i, int i2);
    method _error (line 214) | private native synchronized int _error(long j);
    method _gc (line 216) | private native synchronized int _gc(long j, int i, int i2);
    method _getField (line 218) | private native synchronized int _getField(long j, int i, String str);
    method _getGlobal (line 220) | private native synchronized int _getGlobal(long j, String str);
    method _getI (line 222) | private native synchronized int _getI(long j, int i, long j2);
    method _getMetaTable (line 224) | private native synchronized int _getMetaTable(long j, int i);
    method _getObjectFromUserdata (line 226) | private native synchronized Object _getObjectFromUserdata(long j, int ...
    method _getTable (line 228) | private native synchronized int _getTable(long j, int i);
    method _getTop (line 230) | private native synchronized int _getTop(long j);
    method _getUpValue (line 232) | private native synchronized String _getUpValue(long j, int i, int i2);
    method _getUserValue (line 234) | private native synchronized int _getUserValue(long j, int i);
    method _insert (line 236) | private native synchronized void _insert(long j, int i);
    method _isBoolean (line 238) | private native synchronized int _isBoolean(long j, int i);
    method _isCFunction (line 240) | private native synchronized int _isCFunction(long j, int i);
    method _isFunction (line 242) | private native synchronized int _isFunction(long j, int i);
    method _isInteger (line 244) | private native synchronized int _isInteger(long j, int i);
    method _isJavaFunction (line 246) | private native synchronized boolean _isJavaFunction(long j, int i);
    method _isNil (line 248) | private native synchronized int _isNil(long j, int i);
    method _isNone (line 250) | private native synchronized int _isNone(long j, int i);
    method _isNoneOrNil (line 252) | private native synchronized int _isNoneOrNil(long j, int i);
    method _isNumber (line 254) | private native synchronized int _isNumber(long j, int i);
    method _isObject (line 256) | private native synchronized boolean _isObject(long j, int i);
    method _isString (line 258) | private native synchronized int _isString(long j, int i);
    method _isTable (line 260) | private native synchronized int _isTable(long j, int i);
    method _isThread (line 262) | private native synchronized int _isThread(long j, int i);
    method _isUserdata (line 264) | private native synchronized int _isUserdata(long j, int i);
    method _isYieldable (line 266) | private native synchronized int _isYieldable(long j);
    method _lessThan (line 268) | private native synchronized int _lessThan(long j, int i, int i2);
    method _newTable (line 270) | private native synchronized void _newTable(long j);
    method _newstate (line 272) | private native synchronized long _newstate();
    method _newthread (line 274) | private native synchronized long _newthread(long j);
    method _next (line 276) | private native synchronized int _next(long j, int i);
    method _objlen (line 278) | private native synchronized int _objlen(long j, int i);
    method _openBase (line 280) | private native synchronized void _openBase(long j);
    method _openDebug (line 282) | private native synchronized void _openDebug(long j);
    method _openIo (line 284) | private native synchronized void _openIo(long j);
    method _openLibs (line 286) | private native synchronized void _openLibs(long j);
    method _openLuajava (line 288) | private native synchronized void _openLuajava(long j);
    method _openMath (line 290) | private native synchronized void _openMath(long j);
    method _openOs (line 292) | private native synchronized void _openOs(long j);
    method _openPackage (line 294) | private native synchronized void _openPackage(long j);
    method _openString (line 296) | private native synchronized void _openString(long j);
    method _openTable (line 298) | private native synchronized void _openTable(long j);
    method _pcall (line 300) | private native synchronized int _pcall(long j, int i, int i2, int i3);
    method _pop (line 302) | private native synchronized void _pop(long j, int i);
    method _pushBoolean (line 304) | private native synchronized void _pushBoolean(long j, int i);
    method _pushGlobalTable (line 306) | private native synchronized void _pushGlobalTable(long j);
    method _pushInteger (line 308) | private native synchronized void _pushInteger(long j, long j2);
    method _pushJavaFunction (line 310) | private native synchronized void _pushJavaFunction(long j, JavaFunctio...
    method _pushJavaObject (line 312) | private native synchronized void _pushJavaObject(long j, Object obj);
    method _pushNil (line 314) | private native synchronized void _pushNil(long j);
    method _pushNumber (line 316) | private native synchronized void _pushNumber(long j, double d);
    method _pushString (line 318) | private native synchronized void _pushString(long j, String str);
    method _pushString (line 320) | private native synchronized void _pushString(long j, byte[] bArr, int i);
    method _pushValue (line 322) | private native synchronized void _pushValue(long j, int i);
    method _rawGet (line 324) | private native synchronized int _rawGet(long j, int i);
    method _rawGetI (line 326) | private native synchronized int _rawGetI(long j, int i, long j2);
    method _rawSet (line 328) | private native synchronized void _rawSet(long j, int i);
    method _rawSetI (line 330) | private native synchronized void _rawSetI(long j, int i, long j2);
    method _rawequal (line 332) | private native synchronized int _rawequal(long j, int i, int i2);
    method _rawlen (line 334) | private native synchronized int _rawlen(long j, int i);
    method _remove (line 336) | private native synchronized void _remove(long j, int i);
    method _replace (line 338) | private native synchronized void _replace(long j, int i);
    method _resume (line 340) | private native synchronized int _resume(long j, long j2, int i);
    method _rotate (line 342) | private native synchronized void _rotate(long j, int i, int i2);
    method _setField (line 344) | private native synchronized void _setField(long j, int i, String str);
    method _setGlobal (line 346) | private native synchronized void _setGlobal(long j, String str);
    method _setI (line 348) | private native synchronized void _setI(long j, int i, long j2);
    method _setMetaTable (line 350) | private native synchronized int _setMetaTable(long j, int i);
    method _setTable (line 352) | private native synchronized void _setTable(long j, int i);
    method _setTop (line 354) | private native synchronized void _setTop(long j, int i);
    method _setUpValue (line 356) | private native synchronized String _setUpValue(long j, int i, int i2);
    method _setUserValue (line 358) | private native synchronized void _setUserValue(long j, int i);
    method _status (line 360) | private native synchronized int _status(long j);
    method _strlen (line 362) | private native synchronized int _strlen(long j, int i);
    method _toBoolean (line 364) | private native synchronized int _toBoolean(long j, int i);
    method _toInteger (line 366) | private native synchronized long _toInteger(long j, int i);
    method _toNumber (line 368) | private native synchronized double _toNumber(long j, int i);
    method _toString (line 370) | private native synchronized String _toString(long j, int i);
    method _toThread (line 372) | private native synchronized long _toThread(long j, int i);
    method _type (line 374) | private native synchronized int _type(long j, int i);
    method _typeName (line 376) | private native synchronized String _typeName(long j, int i);
    method _xmove (line 378) | private native synchronized void _xmove(long j, long j2, int i);
    method _yield (line 380) | private native synchronized int _yield(long j, int i);
    method close (line 382) | public synchronized void close() {
    method isClosed (line 388) | public synchronized boolean isClosed() {
    method getPointer (line 392) | public long getPointer() {
    method pushContext (line 396) | public void pushContext(LuaContext context) {
    method getContext (line 400) | public LuaContext getContext() {
    method newThread (line 404) | public LuaState newThread() {
    method getTop (line 410) | public int getTop() {
    method setTop (line 414) | public void setTop(int idx) {
    method pushValue (line 418) | public void pushValue(int idx) {
    method rotate (line 422) | public void rotate(int idx, int n) {
    method copy (line 426) | public void copy(int fromidx, int toidx) {
    method remove (line 430) | public void remove(int idx) {
    method insert (line 434) | public void insert(int idx) {
    method replace (line 438) | public void replace(int idx) {
    method checkStack (line 442) | public int checkStack(int sz) {
    method xmove (line 446) | public void xmove(LuaState to, int n) {
    method isNumber (line 450) | public boolean isNumber(int idx) {
    method isInteger (line 454) | public boolean isInteger(int idx) {
    method isString (line 458) | public boolean isString(int idx) {
    method isFunction (line 462) | public boolean isFunction(int idx) {
    method isCFunction (line 466) | public boolean isCFunction(int idx) {
    method isUserdata (line 470) | public boolean isUserdata(int idx) {
    method isTable (line 474) | public boolean isTable(int idx) {
    method isBoolean (line 478) | public boolean isBoolean(int idx) {
    method isNil (line 482) | public boolean isNil(int idx) {
    method isThread (line 486) | public boolean isThread(int idx) {
    method isNone (line 490) | public boolean isNone(int idx) {
    method isNoneOrNil (line 494) | public boolean isNoneOrNil(int idx) {
    method type (line 498) | public int type(int idx) {
    method typeName (line 502) | public String typeName(int tp) {
    method equal (line 506) | public int equal(int idx1, int idx2) {
    method compare (line 510) | public int compare(int idx1, int idx2, int op) {
    method rawequal (line 514) | public int rawequal(int idx1, int idx2) {
    method lessThan (line 518) | public int lessThan(int idx1, int idx2) {
    method toNumber (line 522) | public double toNumber(int idx) {
    method toInteger (line 526) | public long toInteger(int idx) {
    method toBoolean (line 530) | public boolean toBoolean(int idx) {
    method toString (line 534) | public String toString(int idx) {
    method strLen (line 538) | public int strLen(int idx) {
    method objLen (line 542) | public int objLen(int idx) {
    method rawLen (line 546) | public int rawLen(int idx) {
    method toThread (line 550) | public LuaState toThread(int idx) {
    method pushNil (line 554) | public void pushNil() {
    method pushNumber (line 558) | public void pushNumber(double db) {
    method pushInteger (line 562) | public void pushInteger(long integer) {
    method pushString (line 566) | public void pushString(String str) {
    method pushString (line 574) | public void pushString(byte[] bytes) {
    method pushBoolean (line 582) | public void pushBoolean(boolean bool) {
    method getTable (line 586) | public int getTable(int idx) {
    method getField (line 590) | public int getField(int idx, String k) {
    method getI (line 594) | public int getI(int idx, long n) {
    method rawGet (line 598) | public int rawGet(int idx) {
    method rawGetI (line 602) | public int rawGetI(int idx, long n) {
    method createTable (line 606) | public void createTable(int narr, int nrec) {
    method newTable (line 610) | public void newTable() {
    method getMetaTable (line 614) | public int getMetaTable(int idx) {
    method getUserValue (line 618) | public int getUserValue(int idx) {
    method setTable (line 622) | public void setTable(int idx) {
    method setField (line 626) | public void setField(int idx, String k) {
    method setI (line 630) | public void setI(int idx, long n) {
    method rawSet (line 634) | public void rawSet(int idx) {
    method rawSetI (line 638) | public void rawSetI(int idx, long n) {
    method setMetaTable (line 642) | public int setMetaTable(int idx) {
    method setUserValue (line 646) | public void setUserValue(int idx) {
    method call (line 650) | public void call(int nArgs, int nResults) {
    method pcall (line 654) | public int pcall(int nArgs, int nResults, int errFunc) {
    method yield (line 658) | public int yield(int nResults) {
    method resume (line 662) | public int resume(LuaState from, int nArgs) {
    method status (line 666) | public int status() {
    method isYieldable (line 670) | public int isYieldable() {
    method gc (line 674) | public int gc(int what, int data) {
    method next (line 678) | public int next(int idx) {
    method error (line 682) | public int error() {
    method concat (line 686) | public void concat(int n) {
    method LdoFile (line 690) | public int LdoFile(String fileName) {
    method LdoString (line 694) | public int LdoString(String str) {
    method LgetMetaField (line 698) | public int LgetMetaField(int obj, String e) {
    method LcallMeta (line 702) | public int LcallMeta(int obj, String e) {
    method LargError (line 706) | public int LargError(int numArg, String extraMsg) {
    method LcheckString (line 710) | public String LcheckString(int numArg) {
    method LoptString (line 714) | public String LoptString(int numArg, String def) {
    method LcheckNumber (line 718) | public double LcheckNumber(int numArg) {
    method LoptNumber (line 722) | public double LoptNumber(int numArg, double def) {
    method LcheckInteger (line 726) | public int LcheckInteger(int numArg) {
    method LoptInteger (line 730) | public int LoptInteger(int numArg, int def) {
    method LcheckStack (line 734) | public void LcheckStack(int sz, String msg) {
    method LcheckType (line 738) | public void LcheckType(int nArg, int t) {
    method LcheckAny (line 742) | public void LcheckAny(int nArg) {
    method LnewMetatable (line 746) | public int LnewMetatable(String tName) {
    method LgetMetatable (line 750) | public void LgetMetatable(String tName) {
    method Lwhere (line 754) | public void Lwhere(int lvl) {
    method Lref (line 758) | public int Lref(int t) {
    method LunRef (line 762) | public void LunRef(int t, int ref) {
    method LloadFile (line 766) | public int LloadFile(String fileName) {
    method LloadString (line 770) | public int LloadString(String s) {
    method LloadBuffer (line 774) | public int LloadBuffer(byte[] buff, String name) {
    method Lgsub (line 778) | public String Lgsub(String s, String p, String r) {
    method getUpValue (line 782) | public String getUpValue(int funcindex, int n) {
    method setUpValue (line 786) | public String setUpValue(int funcindex, int n) {
    method dump (line 790) | public byte[] dump(int funcindex) {
    method pop (line 794) | public void pop(int n) {
    method pushGlobalTable (line 798) | public synchronized void pushGlobalTable() {
    method getGlobal (line 802) | public synchronized int getGlobal(String global) {
    method setGlobal (line 806) | public synchronized void setGlobal(String name) {
    method openBase (line 810) | public void openBase() {
    method openTable (line 814) | public void openTable() {
    method openIo (line 818) | public void openIo() {
    method openOs (line 822) | public void openOs() {
    method openString (line 826) | public void openString() {
    method openMath (line 830) | public void openMath() {
    method openDebug (line 834) | public void openDebug() {
    method openPackage (line 838) | public void openPackage() {
    method openLibs (line 842) | public void openLibs() {
    method openLuajava (line 848) | public void openLuajava() {
    method getObjectFromUserdata (line 853) | public Object getObjectFromUserdata(int idx) throws LuaException {
    method isObject (line 857) | public boolean isObject(int idx) {
    method pushJavaObject (line 861) | public void pushJavaObject(Object obj) {
    method pushJavaFunction (line 865) | public void pushJavaFunction(JavaFunction func) throws LuaException {
    method isJavaFunction (line 869) | public boolean isJavaFunction(int idx) {
    method pushObjectValue (line 873) | public void pushObjectValue(Object obj) throws LuaException {
    method toJavaObject (line 908) | public synchronized Object toJavaObject(int idx) throws LuaException {
    method getLuaObject (line 937) | public LuaObject getLuaObject(String globalName) {
    method getLuaObject (line 946) | public LuaObject getLuaObject(LuaObject parent, String name) throws Lu...
    method getLuaObject (line 950) | public LuaObject getLuaObject(LuaObject parent, Number name) throws Lu...
    method getLuaObject (line 954) | public LuaObject getLuaObject(LuaObject parent, LuaObject name) throws...
    method getLuaObject (line 961) | public LuaObject getLuaObject(int index) {
    method pushPrimitive (line 971) | public void pushPrimitive() {

FILE: hydrogen-library/src/main/java/com/luajava/LuaStateFactory.java
  class LuaStateFactory (line 39) | public final class LuaStateFactory {
    method LuaStateFactory (line 48) | private LuaStateFactory() {
    method newLuaState (line 56) | public synchronized static LuaState newLuaState() {
    method getExistingState (line 70) | public synchronized static LuaState getExistingState(long index) {
    method insertLuaState (line 86) | public synchronized static long insertLuaState(LuaState L) {
    method removeLuaState (line 97) | public synchronized static void removeLuaState(long idx) {

FILE: hydrogen-library/src/main/java/com/luajava/LuaTable.java
  class LuaTable (line 8) | public class LuaTable<K, V> extends LuaObject implements Map<K, V> {
    method LuaTable (line 10) | protected LuaTable(LuaState L, String globalName) {
    method LuaTable (line 14) | protected LuaTable(LuaState L, int index) {
    method LuaTable (line 18) | public LuaTable(LuaState L) {
    method clear (line 24) | @Override
    method containsKey (line 37) | @Override
    method containsValue (line 52) | @Override
    method entrySet (line 57) | @Override
    method get (line 73) | @Override
    method isEmpty (line 88) | @Override
    method keySet (line 100) | @Override
    method put (line 116) | @Override
    method putAll (line 129) | @Override
    method remove (line 133) | @Override
    method isList (line 145) | public boolean isList() {
    method length (line 161) | public int length() {
    method size (line 168) | @Override
    method values (line 181) | @Override
    class LuaEntry (line 186) | public static class LuaEntry<K, V> implements Entry<K, V> {
      method LuaEntry (line 192) | public LuaEntry(K k, V v) {
      method getKey (line 197) | @Override
      method getValue (line 202) | @Override
      method setValue (line 207) | public V setValue(V value) {

FILE: hydrogen-library/src/test/java/pub/hanks/luajandroid/ExampleUnitTest.java
  class ExampleUnitTest (line 24) | public class ExampleUnitTest {
    method testAdler32 (line 25) | @Test
    method testStartWith (line 76) | @Test

FILE: sample/src/androidTest/java/pub/hanks/sample/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 19) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 21) | @Test

FILE: sample/src/main/java/pub/hanks/sample/App.java
  class App (line 14) | public class App extends Application {
    method onCreate (line 15) | @Override
    method initBugly (line 22) | public void initBugly() {

FILE: sample/src/main/java/pub/hanks/sample/ITHomeUtils.java
  class ITHomeUtils (line 12) | public class ITHomeUtils {
    method byteToString (line 14) | public static String byteToString(byte[] bArr) {
    method desEncode (line 28) | public static String desEncode(String id) throws Exception {

FILE: sample/src/main/java/pub/hanks/sample/SplashActivity.java
  class SplashActivity (line 39) | public class SplashActivity extends BaseActivity {
    method getOpenView (line 46) | public static void getOpenView(Context context, int type, Object iAdSu...
    method getOpenNativeView (line 50) | public static void getOpenNativeView(Context context, int type, Object...
    method onCreate (line 54) | @Override
    method onRequestPermissionsResult (line 90) | @Override
    method launch (line 109) | private void launch() {
    method initContent (line 118) | private void initContent() {
    method getImagePath (line 160) | private String getImagePath(Uri uri, String selection) {
    method handleImageOnKitKat (line 172) | private String handleImageOnKitKat(Uri uri) {
    method getWeekStr (line 196) | private String getWeekStr(int week_index) {
    method initFiles (line 204) | private void initFiles() {
    method launchMain (line 215) | public void launchMain() {

FILE: sample/src/main/java/pub/hanks/sample/adapter/DragTouchHelper.java
  class DragTouchHelper (line 10) | public class DragTouchHelper extends ItemTouchHelper.Callback {
    method DragTouchHelper (line 14) | public DragTouchHelper(Creator creator) {
    method getMovementFlags (line 18) | @Override
    method onMove (line 29) | @Override
    method onSwiped (line 38) | @Override
    method isLongPressDragEnabled (line 46) | @Override
    method onSelectedChanged (line 54) | @Override
    method clearView (line 62) | @Override
    type Creator (line 70) | public interface Creator {
      method onMove (line 71) | boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder vi...
      method onSwiped (line 73) | void onSwiped(RecyclerView.ViewHolder viewHolder, int direction);
      method onSelectedChanged (line 75) | void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actio...
      method clearView (line 77) | void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder vi...
      method getDragFlags (line 79) | long getDragFlags();
      method getSwipeFlags (line 81) | long getSwipeFlags();
      method isLongPressDragEnabled (line 83) | boolean isLongPressDragEnabled();

FILE: sample/src/test/java/pub/hanks/sample/ExampleUnitTest.java
  class ExampleUnitTest (line 23) | public class ExampleUnitTest {
    class A (line 25) | class A{
    class Aa (line 29) | class Aa extends A{
    method testRun (line 32) | @Test
    method execCMD (line 38) | public static void execCMD(String command) {
    method zip (line 61) | public static void zip(ZipOutputStream zOut, File file, String base) {
    method writeFile (line 95) | public static void writeFile(ZipOutputStream zOut, File file) throws I...
    method addition_isCorrect (line 103) | @Test
    method unZipPlugin (line 108) | @Test
    method testCommand (line 114) | @Test
    method zipPlugin (line 121) | @Test

FILE: script/node/watch/build_lua_main_dir.js
  function build (line 15) | function build(file){
  function buildDir (line 37) | function buildDir(sourceDir,pluginRoot){

FILE: script/node/watch/exec_luac.js
  function build (line 15) | function build(file){
  function buildDir (line 37) | function buildDir(sourceDir,pluginRoot){

FILE: script/node/watch/watch.js
  function pushFiles (line 15) | function pushFiles(changedFile) {
Condensed preview — 308 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,331K chars).
[
  {
    "path": ".gitignore",
    "chars": 299,
    "preview": "*.jks\n*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBu"
  },
  {
    "path": "LICENSE",
    "chars": 11366,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "PluginDev.md",
    "chars": 5664,
    "preview": "# 氢应用插件开发\n\n## 插件介绍\n插件用 lua 语言开发,所以需要能看懂 lua,插件基于 androlua 框架下,\n氢应用插件结构很简单,每个插件放在手机的 sdcard/Android/data/pub.hydrogen.and"
  },
  {
    "path": "README.md",
    "chars": 2457,
    "preview": "# hydrogenApp\n\nhydrogen is a **pluggable** android app, use `Lua` develop android, minSdkVersion=\"15\", lua 5.3\nplugin wr"
  },
  {
    "path": "build.gradle",
    "chars": 541,
    "preview": "// Top-level build file where you can add configuration options androlua.common to all sub-projects/modules.\n\nbuildscrip"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Fri Nov 16 10:45:13 CST 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 730,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "hydrogen-library/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "hydrogen-library/build.gradle",
    "chars": 2071,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 28\n    defaultConfig {\n        minSdkVersion 16\n   "
  },
  {
    "path": "hydrogen-library/proguard-rules.pro",
    "chars": 1364,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:"
  },
  {
    "path": "hydrogen-library/src/androidTest/java/pub/hanks/luajandroid/ExampleInstrumentedTest.java",
    "chars": 7739,
    "preview": "package pub.hanks.luajandroid;\n\nimport android.animation.LayoutTransition;\nimport android.content.Context;\nimport androi"
  },
  {
    "path": "hydrogen-library/src/main/AndroidManifest.xml",
    "chars": 1916,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaActivity.java",
    "chars": 13174,
    "preview": "package androlua;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport an"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaAdapter.java",
    "chars": 1072,
    "preview": "package androlua;\n\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\n\n/**\n * L"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaBitmap.java",
    "chars": 7884,
    "preview": "package androlua;\n\n\nimport android.content.Context;\nimport android.content.res.AssetManager;\nimport android.graphics.Bit"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaBroadcastReceiver.java",
    "chars": 594,
    "preview": "package androlua;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Inte"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaContext.java",
    "chars": 53,
    "preview": "package androlua;\n\npublic interface LuaContext {\n\n\n}\n"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaDexClassLoader.java",
    "chars": 826,
    "preview": "package androlua;\n\nimport java.util.HashMap;\n\nimport dalvik.system.DexClassLoader;\n\npublic class LuaDexClassLoader exten"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaDexLoader.java",
    "chars": 4526,
    "preview": "package androlua;\n\n\nimport android.content.res.AssetManager;\nimport android.content.res.Resources;\nimport android.conten"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaDrawable.java",
    "chars": 1819,
    "preview": "package androlua;\n\n\nimport android.graphics.BitmapFactory;\nimport android.graphics.Canvas;\nimport android.graphics.Color"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaFragment.java",
    "chars": 3613,
    "preview": "package androlua;\n\n\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.support.annotation.Nullable"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaGcable.java",
    "chars": 65,
    "preview": "package androlua;\n\n\npublic interface LuaGcable {\n    void gc();\n}"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaHttp.java",
    "chars": 10355,
    "preview": "package androlua;\n\nimport android.support.annotation.NonNull;\n\nimport com.luajava.LuaException;\nimport com.luajava.LuaOb"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaImageLoader.java",
    "chars": 4135,
    "preview": "package androlua;\n\nimport android.content.Context;\nimport android.graphics.BitmapFactory;\nimport android.graphics.drawab"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaManager.java",
    "chars": 8686,
    "preview": "package androlua;\n\nimport android.content.Context;\n\nimport com.luajava.JavaFunction;\nimport com.luajava.LuaException;\nim"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaPrint.java",
    "chars": 1349,
    "preview": "package androlua;\n\n\nimport android.util.Log;\n\nimport com.luajava.JavaFunction;\nimport com.luajava.LuaException;\nimport c"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaTimer.java",
    "chars": 1454,
    "preview": "package androlua;\n\n\npublic class LuaTimer {\n//    private LuaTimerTask task;\n//\n//    public LuaTimer(LuaContext main, S"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaUtil.java",
    "chars": 6992,
    "preview": "package androlua;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport an"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaView.java",
    "chars": 1659,
    "preview": "package androlua;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.support.annotation.Nul"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/LuaWebView.java",
    "chars": 10144,
    "preview": "package androlua;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.DialogInterface;\n"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/NineBitmapDrawable.java",
    "chars": 4435,
    "preview": "package androlua;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/adapter/LuaFragmentPageAdapter.java",
    "chars": 952,
    "preview": "package androlua.adapter;\n\nimport android.support.v4.app.Fragment;\nimport android.support.v4.app.FragmentManager;\nimport"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/adapter/LuaPagerAdapter.java",
    "chars": 1393,
    "preview": "package androlua.adapter;\n\nimport android.support.v4.view.PagerAdapter;\nimport android.view.View;\nimport android.view.Vi"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/adapter/LuaRecyclerAdapter.java",
    "chars": 1247,
    "preview": "package androlua.adapter;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.view.ViewGroup;\n\n/**\n * Created"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/adapter/LuaRecyclerHolder.java",
    "chars": 313,
    "preview": "package androlua.adapter;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.view.View;\n\n/**\n * Created by h"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/base/BaseActivity.java",
    "chars": 1905,
    "preview": "package androlua.base;\n\nimport android.graphics.Color;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/base/BaseFragment.java",
    "chars": 179,
    "preview": "package androlua.base;\n\nimport android.support.v4.app.Fragment;\n\n/**\n * Created by hanks on 2017/6/2. Copyright (C) 2017"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/common/LuaConstants.java",
    "chars": 159,
    "preview": "package androlua.common;\n\n/**\n * Created by hanks on 2017/6/19.\n */\n\npublic class LuaConstants {\n    public static final"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/common/LuaFileUtils.java",
    "chars": 26885,
    "preview": "package androlua.common;\n\nimport android.content.Context;\nimport android.content.res.AssetManager;\nimport android.graphi"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/common/LuaLog.java",
    "chars": 943,
    "preview": "package androlua.common;\n\nimport android.util.Log;\n\nimport androlua.LuaManager;\n\n\n/**\n * LuaLog\n * Created by hanks on 2"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/common/LuaSp.java",
    "chars": 2539,
    "preview": "package androlua.common;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\n\nimport androlua.Lua"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/common/LuaStringUtils.java",
    "chars": 1629,
    "preview": "package androlua.common;\n\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\n\n/**\n * 字符串"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/common/LuaToast.java",
    "chars": 293,
    "preview": "package androlua.common;\n\nimport android.widget.Toast;\n\nimport androlua.LuaManager;\n\n/**\n * Created by hanks on 2017/6/1"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/fragment/MenuFragment.java",
    "chars": 5968,
    "preview": "package androlua.fragment;\n\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.graphi"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/plugin/Plugin.java",
    "chars": 2438,
    "preview": "package androlua.plugin;\n\nimport com.luajava.LuaState;\n\nimport androlua.LuaManager;\n\n/**\n * Created by hanks on 2017/5/5"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/utils/ColorStateListFactory.java",
    "chars": 2787,
    "preview": "package androlua.utils;\n\nimport android.content.res.ColorStateList;\nimport android.graphics.drawable.ColorDrawable;\nimpo"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/utils/DialogUtils.java",
    "chars": 2309,
    "preview": "package androlua.utils;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.content.Context;\nim"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/utils/LauncherUtil.java",
    "chars": 2394,
    "preview": "package androlua.utils;\n\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.pm.Packa"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/utils/ShortcutUtils.java",
    "chars": 6815,
    "preview": "package androlua.utils;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.database.Cursor;\n"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/glide/LuaGlideModule.java",
    "chars": 857,
    "preview": "package androlua.widget.glide;\n\nimport android.content.Context;\n\nimport com.bumptech.glide.Glide;\nimport com.bumptech.gl"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/htmltext/URLImageParser.java",
    "chars": 4094,
    "preview": "package androlua.widget.htmltext;\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphic"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/htmltext/UrlDrawable.java",
    "chars": 1316,
    "preview": "package androlua.widget.htmltext;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/marqueetext/MarqueeTextView.java",
    "chars": 869,
    "preview": "package androlua.widget.marqueetext;\n\nimport android.content.Context;\nimport android.support.annotation.Nullable;\nimport"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/ninegride/LuaNineGridView.java",
    "chars": 754,
    "preview": "package androlua.widget.ninegride;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\n\nimport com.luajav"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/ninegride/LuaNineGridViewAdapter.java",
    "chars": 1083,
    "preview": "package androlua.widget.ninegride;\n\nimport android.content.Context;\nimport android.widget.ImageView;\n\nimport java.util.L"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/ninegride/NineGridImageView.java",
    "chars": 8664,
    "preview": "package androlua.widget.ninegride;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.uti"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/ninegride/NineGridImageViewAdapter.java",
    "chars": 712,
    "preview": "package androlua.widget.ninegride;\n\nimport android.content.Context;\nimport android.widget.ImageView;\n\nimport java.util.L"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/picture/ElasticDragDismissFrameLayout.java",
    "chars": 10768,
    "preview": "/*\n * Copyright 2015 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not us"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/picture/PicturePreviewActivity.java",
    "chars": 16780,
    "preview": "package androlua.widget.picture;\n\nimport android.Manifest;\nimport android.app.DownloadManager;\nimport android.content.Co"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/statusbar/FixInsetsFrameLayout.java",
    "chars": 2811,
    "preview": "package androlua.widget.statusbar;\n\nimport android.content.Context;\nimport android.graphics.Rect;\nimport android.os.Buil"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/statusbar/StatusBarView.java",
    "chars": 2121,
    "preview": "package androlua.widget.statusbar;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graph"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/SwipeBackLayout.java",
    "chars": 19886,
    "preview": "package androlua.widget.swipebacklayout;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.co"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/Utils.java",
    "chars": 2315,
    "preview": "package androlua.widget.swipebacklayout;\n\nimport android.app.Activity;\n\nimport java.lang.reflect.Method;\n\n/**\n * Created"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/ViewDragHelper.java",
    "chars": 62104,
    "preview": "/*\n * Copyright (C) 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackActivity.java",
    "chars": 1581,
    "preview": "package androlua.widget.swipebacklayout.app;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackActivityBase.java",
    "chars": 496,
    "preview": "package androlua.widget.swipebacklayout.app;\n\n\nimport androlua.widget.swipebacklayout.SwipeBackLayout;\n\n/**\n * @author Y"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackActivityHelper.java",
    "chars": 1803,
    "preview": "package androlua.widget.swipebacklayout.app;\n\nimport android.app.Activity;\nimport android.graphics.Color;\nimport android"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/swipebacklayout/app/SwipeBackPreferenceActivity.java",
    "chars": 1296,
    "preview": "package androlua.widget.swipebacklayout.app;\n\nimport android.os.Bundle;\nimport android.preference.PreferenceActivity;\nim"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/video/VideoPlayerActivity.java",
    "chars": 2161,
    "preview": "package androlua.widget.video;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.C"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/viewpager/NoScrollViewPager.java",
    "chars": 1374,
    "preview": "package androlua.widget.viewpager;\n\nimport android.content.Context;\nimport android.support.v4.view.ViewPager;\nimport and"
  },
  {
    "path": "hydrogen-library/src/main/java/androlua/widget/webview/WebViewActivity.java",
    "chars": 10060,
    "preview": "package androlua.widget.webview;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/Console.java",
    "chars": 1621,
    "preview": "package com.luajava;\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Console {\n    publi"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/JavaFunction.java",
    "chars": 484,
    "preview": "package com.luajava;\n\npublic abstract class JavaFunction {\n    protected LuaState L;\n\n    public JavaFunction(LuaState L"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaException.java",
    "chars": 1742,
    "preview": "/*\n * $Id: LuaException.java,v 1.6 2006/12/22 14:06:40 thiago Exp $\n * Copyright (C) 2003-2007 Kepler Project.\n *\n * Per"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaFunction.java",
    "chars": 831,
    "preview": "package com.luajava;\n\npublic class LuaFunction<T extends Object> extends LuaObject implements LuaMetaTable {\n\n    protec"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaInvocationHandler.java",
    "chars": 3485,
    "preview": "/*\n * $Id: LuaInvocationHandler.java,v 1.4 2006/12/22 14:06:40 thiago Exp $\n * Copyright (C) 2003-2007 Kepler Project.\n "
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaJavaAPI.java",
    "chars": 45312,
    "preview": "/*\n * $Id: LuaJavaAPI.java,v 1.4 2006/12/22 14:06:40 thiago Exp $\n * Copyright (C) 2003-2007 Kepler Project.\n *\n * Permi"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaList.java",
    "chars": 3567,
    "preview": "package com.luajava;\n\nimport java.util.Collection;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Li"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaMetaTable.java",
    "chars": 212,
    "preview": "package com.luajava;\n\npublic interface LuaMetaTable {\n    public Object __call(Object... arg) throws LuaException;\n\n    "
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaObject.java",
    "chars": 17572,
    "preview": "/*\n * $Id: LuaObject.java,v 1.6 2006/12/22 14:06:40 thiago Exp $\n * Copyright (C) 2003-2007 Kepler Project.\n *\n * Permis"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaStack.java",
    "chars": 509,
    "preview": "package com.luajava;\n\nimport java.util.HashMap;\n\npublic class LuaStack {\n    private final static HashMap<String, LuaSta"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaState.java",
    "chars": 28863,
    "preview": "package com.luajava;\n\nimport androlua.LuaContext;\n\npublic class LuaState {\n    public static final int LUAI_MAXSTACK = 1"
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaStateFactory.java",
    "chars": 2973,
    "preview": "/*\n * $Id: LuaStateFactory.java,v 1.4 2006/12/22 14:06:40 thiago Exp $\n * Copyright (C) 2003-2007 Kepler Project.\n *\n * "
  },
  {
    "path": "hydrogen-library/src/main/java/com/luajava/LuaTable.java",
    "chars": 4271,
    "preview": "package com.luajava;\n\nimport java.util.Collection;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Set;"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/bg_circle.xml",
    "chars": 274,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/bg_rect_radius.xml",
    "chars": 324,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/ic_loading.xml",
    "chars": 185,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n       android:"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/layout_selector_tran.xml",
    "chars": 353,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/loading_shap.xml",
    "chars": 364,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rotate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        androi"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/shadow_line_bottom.xml",
    "chars": 336,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <gradient\n"
  },
  {
    "path": "hydrogen-library/src/main/res/drawable/shadow_line_top.xml",
    "chars": 337,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <gradient\n"
  },
  {
    "path": "hydrogen-library/src/main/res/layout/activity_lua.xml",
    "chars": 687,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v4.widget.DrawerLayout\n    xmlns:android=\"http://schemas.android"
  },
  {
    "path": "hydrogen-library/src/main/res/layout/activity_picture.xml",
    "chars": 2361,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<androlua.widget.picture.ElasticDragDismissFrameLayout\n    xmlns:android=\"http:/"
  },
  {
    "path": "hydrogen-library/src/main/res/layout/activity_video.xml",
    "chars": 477,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andro"
  },
  {
    "path": "hydrogen-library/src/main/res/layout/activity_webview.xml",
    "chars": 3621,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        "
  },
  {
    "path": "hydrogen-library/src/main/res/layout/dialog_add_shortcut.xml",
    "chars": 694,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        "
  },
  {
    "path": "hydrogen-library/src/main/res/layout/dialog_input.xml",
    "chars": 376,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "hydrogen-library/src/main/res/layout/fragment_menu.xml",
    "chars": 979,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        "
  },
  {
    "path": "hydrogen-library/src/main/res/layout/item_pager_image.xml",
    "chars": 885,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n         "
  },
  {
    "path": "hydrogen-library/src/main/res/raw/keep.xml",
    "chars": 170,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:keep=\"@dr"
  },
  {
    "path": "hydrogen-library/src/main/res/values/attrs_elastic_drag_dismiss_frame_layout.xml",
    "chars": 965,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 Google Inc.\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "hydrogen-library/src/main/res/values/colors.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "hydrogen-library/src/main/res/values/strings.xml",
    "chars": 74,
    "preview": "<resources>\n    <string name=\"app_name\">LuaJAndroid</string>\n</resources>\n"
  },
  {
    "path": "hydrogen-library/src/main/res/values/styles.xml",
    "chars": 381,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">"
  },
  {
    "path": "hydrogen-library/src/test/java/pub/hanks/luajandroid/ExampleUnitTest.java",
    "chars": 2299,
    "preview": "package pub.hanks.luajandroid;\n\nimport org.junit.Test;\n\nimport java.io.BufferedInputStream;\nimport java.io.BufferedOutpu"
  },
  {
    "path": "hydrogen-library/src/test/lua/a/aa.lua",
    "chars": 153,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/12\n-- Time: 15:07\n-- \nlocal me "
  },
  {
    "path": "hydrogen-library/src/test/lua/a.lua",
    "chars": 197,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/12\n-- Time: 15:06\n--\nlocal me ="
  },
  {
    "path": "hydrogen-library/src/test/lua/b/ba.lua",
    "chars": 143,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/12\n-- Time: 15:07\n--\n\nreturn {\n"
  },
  {
    "path": "hydrogen-library/src/test/lua/c/json.lua",
    "chars": 72,
    "preview": "module('json')\n\nfunction decode(text)\n    return { name = 'hhhhha' }\nend"
  },
  {
    "path": "lua/163news/activity_news_detail.lua",
    "chars": 5785,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/163news/fragment_news.lua",
    "chars": 8636,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/163news/info.json",
    "chars": 235,
    "preview": "{\n  \"id\": \"pub.hanks.163news\",\n  \"name\": \"网易新闻\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b08438866d950f?w=1"
  },
  {
    "path": "lua/163news/main.lua",
    "chars": 4359,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/500px/fragment_news.lua",
    "chars": 6011,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/500px/info.json",
    "chars": 234,
    "preview": "{\n  \"id\": \"pub.hanks.500px\",\n  \"name\": \"500px\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b0842c3273e0c5?w=15"
  },
  {
    "path": "lua/500px/main.lua",
    "chars": 6206,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/91pic/info.json",
    "chars": 231,
    "preview": "{\n  \"id\": \"pub.hanks.91pic\",\n  \"name\": \"91 美女\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b084ebc4a73a6f?w=15"
  },
  {
    "path": "lua/91pic/main.lua",
    "chars": 5719,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/appinn/activity_news_detail.lua",
    "chars": 5952,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/appinn/fragment_news.lua",
    "chars": 6840,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/appinn/info.json",
    "chars": 230,
    "preview": "{\n  \"id\": \"pub.hanks.appinn\",\n  \"name\": \"小众软件\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b0841951ea3770?w=15"
  },
  {
    "path": "lua/appinn/main.lua",
    "chars": 2161,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/bilibili/fragment_news.lua",
    "chars": 5230,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/bilibili/info.json",
    "chars": 236,
    "preview": "{\n  \"id\": \"pub.hanks.bilibili\",\n  \"name\": \"B站排行\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b08515d3498769?w="
  },
  {
    "path": "lua/bilibili/main.lua",
    "chars": 3404,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/btmayi/info.json",
    "chars": 233,
    "preview": "{\n  \"id\": \"pub.hanks.btmayi\",\n  \"name\": \"磁力搜索\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b0851da6780af1?w=15"
  },
  {
    "path": "lua/btmayi/main.lua",
    "chars": 8959,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- douban - hot movie\n--\nreq"
  },
  {
    "path": "lua/buka/detail.lua",
    "chars": 8486,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 布卡漫画\n--\nrequire \"import\"\n"
  },
  {
    "path": "lua/buka/fragment_category.lua",
    "chars": 6698,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/buka/info.json",
    "chars": 228,
    "preview": "{\n  \"id\": \"pub.hanks.buka\",\n  \"name\": \"布卡漫画\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b0852649adc474?w=150&"
  },
  {
    "path": "lua/buka/main.lua",
    "chars": 2781,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/buka/search.lua",
    "chars": 6074,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 漫本联盟 dm5.com\n--\nrequire \""
  },
  {
    "path": "lua/buka/viewer.lua",
    "chars": 2949,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/digit/activity_news_detail.lua",
    "chars": 5657,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/digit/fragment_news.lua",
    "chars": 7035,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/digit/info.json",
    "chars": 229,
    "preview": "{\n  \"id\": \"pub.hanks.digit\",\n  \"name\": \"数字尾巴\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b0852c2ccda17c?w=150"
  },
  {
    "path": "lua/digit/main.lua",
    "chars": 4111,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/dm5/detail.lua",
    "chars": 8939,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 漫本联盟 dm5.com\n--\nrequire \""
  },
  {
    "path": "lua/dm5/info.json",
    "chars": 241,
    "preview": "{\n  \"id\": \"pub.hanks.dm5\",\n  \"name\": \"动漫屋\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1fh10o351k7j20460460sh.jpg\""
  },
  {
    "path": "lua/dm5/main.lua",
    "chars": 10676,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 漫本联盟 dm5.com\n--\nrequire \""
  },
  {
    "path": "lua/dm5/search.lua",
    "chars": 6074,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 漫本联盟 dm5.com\n--\nrequire \""
  },
  {
    "path": "lua/dm5/viewer.lua",
    "chars": 3692,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/douban-daily/activity_news_detail.lua",
    "chars": 5594,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/douban-daily/fragment_news.lua",
    "chars": 7506,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/douban-daily/info.json",
    "chars": 236,
    "preview": "{\n  \"id\": \"pub.hanks.douban-daily\",\n  \"name\": \"豆瓣一刻\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1fhlllrrhr0j20460"
  },
  {
    "path": "lua/douban-daily/main.lua",
    "chars": 4069,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/doubanmovie/detail.lua",
    "chars": 10006,
    "preview": "require \"import\"\nimport \"android.widget.*\"\nimport \"android.content.*\"\nimport \"android.view.View\"\nimport \"androlua.LuaHtt"
  },
  {
    "path": "lua/doubanmovie/info.json",
    "chars": 228,
    "preview": "{\n  \"id\": \"pub.hanks.doubanmovie\",\n  \"name\": \"热映电影\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1fh34zfgjcvj204604"
  },
  {
    "path": "lua/doubanmovie/main.lua",
    "chars": 5233,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- douban - hot movie\n--\nreq"
  },
  {
    "path": "lua/douyu/detail.lua",
    "chars": 896,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/douyu/info.json",
    "chars": 212,
    "preview": "{\n  \"id\": \"pub.hanks.douyu\",\n  \"name\": \"斗鱼直播\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1fj45bhugy4j2046046q2s.j"
  },
  {
    "path": "lua/douyu/main.lua",
    "chars": 9472,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 漫本联盟 dm5.com\n--\nrequire \""
  },
  {
    "path": "lua/eyepetizer/info.json",
    "chars": 236,
    "preview": "{\n  \"id\": \"pub.hanks.eyepetizer\",\n  \"name\": \"开眼\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088bc73fd882a?w="
  },
  {
    "path": "lua/eyepetizer/main.lua",
    "chars": 4260,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/gacha/info.json",
    "chars": 233,
    "preview": "{\n  \"id\": \"pub.hanks.gacha\",\n  \"name\": \"网易插画\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1fhaaa8qcofj2046046we9.j"
  },
  {
    "path": "lua/gacha/main.lua",
    "chars": 4735,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/gamesky/info.json",
    "chars": 236,
    "preview": "{\n  \"id\": \"pub.hanks.gamesky\",\n  \"name\": \"游民星空\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088ce8e81426a?w=1"
  },
  {
    "path": "lua/gamesky/main.lua",
    "chars": 4994,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/graphmovies/detail.lua",
    "chars": 6122,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- 图解电影\n--\nrequire \"import\"\n"
  },
  {
    "path": "lua/graphmovies/info.json",
    "chars": 254,
    "preview": "{\n  \"id\": \"pub.hanks.graphmovies\",\n  \"name\": \"图解电影\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088d46dc93a57"
  },
  {
    "path": "lua/graphmovies/main.lua",
    "chars": 6230,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/huaban-popular/info.json",
    "chars": 243,
    "preview": "{\n  \"id\": \"pub.hanks.huaban-popular\",\n  \"name\": \"花瓣热门\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088d9ccb65"
  },
  {
    "path": "lua/huaban-popular/main.lua",
    "chars": 4783,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/iciba/info.json",
    "chars": 235,
    "preview": "{\n  \"id\": \"pub.hanks.iciba\",\n  \"name\": \"金山词霸\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088df179ab4d7?w=150"
  },
  {
    "path": "lua/iciba/main.lua",
    "chars": 6049,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/it168/activity_news_detail.lua",
    "chars": 5966,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/it168/fragment_news.lua",
    "chars": 7268,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/it168/info.json",
    "chars": 239,
    "preview": "{\n  \"id\": \"pub.hanks.it168\",\n  \"name\": \"手机评测\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088e4cf781c7a?w=150"
  },
  {
    "path": "lua/it168/main.lua",
    "chars": 2477,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/ithome/activity_news_detail.lua",
    "chars": 6108,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/ithome/fragment_news.lua",
    "chars": 6400,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/ithome/info.json",
    "chars": 234,
    "preview": "{\n  \"id\": \"pub.hanks.ithome\",\n  \"name\": \"IT之家\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088ea4e40a077?w=15"
  },
  {
    "path": "lua/ithome/main.lua",
    "chars": 5927,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/jdly/info.json",
    "chars": 249,
    "preview": "{\n  \"id\": \"pub.hanks.jdly\",\n  \"name\": \"绝对领域\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088f6c984a623?w=150&"
  },
  {
    "path": "lua/jdly/main.lua",
    "chars": 5385,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/jike/fragment_feed.lua",
    "chars": 8934,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/jike/fragment_hot.lua",
    "chars": 7840,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/jike/fragment_recomend.lua",
    "chars": 9396,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/jike/info.json",
    "chars": 230,
    "preview": "{\n  \"id\": \"pub.hanks.jike\",\n  \"name\": \"即刻\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088fd40e849d7?w=150&h="
  },
  {
    "path": "lua/jike/item_msg.lua",
    "chars": 3775,
    "preview": "return {\n    LinearLayout,\n    layout_width = \"fill\",\n    paddingTop = \"16dp\",\n    orientation = \"vertical\",\n    backgro"
  },
  {
    "path": "lua/jike/main.lua",
    "chars": 2666,
    "preview": "require \"import\"\nimport \"android.widget.*\"\nimport \"android.content.*\"\nimport \"android.support.design.widget.BottomNaviga"
  },
  {
    "path": "lua/magmoe-cos/info.json",
    "chars": 252,
    "preview": "{\n  \"id\": \"pub.hanks.magmoe-cos\",\n  \"name\": \"moe cos\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088b4ae47d0"
  },
  {
    "path": "lua/magmoe-cos/main.lua",
    "chars": 5715,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/magmoe-image/info.json",
    "chars": 252,
    "preview": "{\n  \"id\": \"pub.hanks.magmoe-image\",\n  \"name\": \"MOE二次元\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088b4ae47d"
  },
  {
    "path": "lua/magmoe-image/main.lua",
    "chars": 5858,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/notead/info.json",
    "chars": 242,
    "preview": "{\n  \"id\": \"pub.hanks.note_pro\",\n  \"name\": \"便签Pro\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1ftf62owi8wj2040040w"
  },
  {
    "path": "lua/notead/main.lua",
    "chars": 2502,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/packwap/info.json",
    "chars": 236,
    "preview": "{\n  \"id\": \"pub.hanks.packwap\",\n  \"name\": \"网页转插件\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088aa62abd550?w="
  },
  {
    "path": "lua/packwap/main.lua",
    "chars": 8223,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- qiqu\n--\nrequire \"import\"\n"
  },
  {
    "path": "lua/packwap/testwap.lua",
    "chars": 1144,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- qiqu\n--\nrequire \"import\"\n"
  },
  {
    "path": "lua/papapatimer/info.json",
    "chars": 245,
    "preview": "{\n  \"id\": \"pub.hanks.papapatimer\",\n  \"name\": \"啪啪倒计时\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b088a4ee4ca73"
  },
  {
    "path": "lua/papapatimer/main.lua",
    "chars": 8060,
    "preview": "require \"import\"\nimport \"android.widget.*\"\nimport \"android.content.*\"\nimport \"android.view.View\"\nimport \"android.support"
  },
  {
    "path": "lua/pengpai/activity_news_detail.lua",
    "chars": 5856,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/pengpai/fragment_news.lua",
    "chars": 6915,
    "preview": "--\n-- Created by IntelliJ IDEA.\n-- User: hanks\n-- Date: 2017/5/13\n-- Time: 00:01\n-- To change this template use File | S"
  },
  {
    "path": "lua/pengpai/info.json",
    "chars": 238,
    "preview": "{\n  \"id\": \"pub.hanks.pengpainews\",\n  \"name\": \"澎湃新闻\",\n  \"icon\": \"https://user-gold-cdn.xitu.io/2019/5/30/16b0889e8328d952"
  },
  {
    "path": "lua/pengpai/main.lua",
    "chars": 2680,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  },
  {
    "path": "lua/pixiv/info.json",
    "chars": 235,
    "preview": "{\n  \"id\": \"pub.hanks.pixiv\",\n  \"name\": \"P站排行\",\n  \"icon\": \"http://ww1.sinaimg.cn/large/8c9b876fly1fh803sp03xj2046046a9x.j"
  },
  {
    "path": "lua/pixiv/main.lua",
    "chars": 5310,
    "preview": "--\n-- Created by IntelliJ IDEA.  Copyright (C) 2017 Hanks\n-- User: hanks\n-- Date: 2017/5/26\n-- A news app\n--\nrequire \"im"
  }
]

// ... and 108 more files (download for full content)

About this extraction

This page contains the full source code of the hanks-zyh/hydrogenApp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 308 files (1.2 MB), approximately 315.5k tokens, and a symbol index with 1145 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!