LuaJava is a scripting tool for Java. The goal of this tool is to allow scripts written in Lua to manipulate components developed in Java.
32 |
33 |
34 | LuaJava allows Java components to be accessed from Lua using the same syntax
35 | that is used for accessing Lua`s native objects, without any need for
36 | declarations or any kind of preprocessing.
37 | For this check LuaJava's Lua Reference.
38 |
39 |
40 |
41 | LuaJava also allows Java to implement an interface using Lua.
42 | This way any interface can be implemented in Lua and passed as parameter to
43 | any method, and when called, the equivalent function will be called in Lua,
44 | and it's result passed back to Java.
45 |
46 |
47 |
Related Documentation
48 |
49 | For overviews, tutorials, examples, guides, and tool documentation, please see:
50 |
LuaJava is a scripting tool for Java. The goal of this tool is to allow scripts written in Lua to manipulate components developed in Java.
32 |
33 |
34 | LuaJava allows Java components to be accessed from Lua using the same syntax
35 | that is used for accessing Lua`s native objects, without any need for
36 | declarations or any kind of preprocessing.
37 | For this check LuaJava's Lua Reference.
38 |
39 |
40 |
41 | LuaJava also allows Java to implement an interface using Lua.
42 | This way any interface can be implemented in Lua and passed as parameter to
43 | any method, and when called, the equivalent function will be called in Lua,
44 | and it's result passed back to Java.
45 |
46 |
47 |
Related Documentation
48 |
49 | For overviews, tutorials, examples, guides, and tool documentation, please see:
50 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/build/intermediates/transforms/mergeJniLibs/debug/folders/2000/1f/main/lib/armeabi/libluajava.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/build/intermediates/transforms/mergeJniLibs/debug/folders/2000/1f/main/lib/armeabi/libluajava.so
--------------------------------------------------------------------------------
/app/build/outputs/apk/app-debug-unaligned.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/build/outputs/apk/app-debug-unaligned.apk
--------------------------------------------------------------------------------
/app/build/outputs/apk/app-debug.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/build/outputs/apk/app-debug.apk
--------------------------------------------------------------------------------
/app/build/outputs/logs/manifest-merger-debug-report.txt:
--------------------------------------------------------------------------------
1 | -- Merging decision tree log ---
2 | manifest
3 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:2:1-18:12
4 | xmlns:android
5 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:2:91-149
6 | package
7 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:2:61-90
8 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
9 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
10 | android:versionName
11 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:2:35-60
12 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
13 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
14 | android:versionCode
15 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:2:11-34
16 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
17 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
18 | uses-sdk
19 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:3:3-41
20 | android:targetSdkVersion
21 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
22 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
23 | android:minSdkVersion
24 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:3:13-38
25 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
26 | INJECTED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml
27 | uses-permission#android.permission.INTERNET
28 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:4:3-64
29 | android:name
30 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:4:20-62
31 | uses-permission#android.permission.ACCESS_WIFI_STATE
32 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:5:3-73
33 | android:name
34 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:5:20-71
35 | uses-permission#android.permission.BLUETOOTH
36 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:6:3-65
37 | android:name
38 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:6:20-63
39 | uses-permission#android.permission.CAMERA
40 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:7:3-62
41 | android:name
42 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:7:20-60
43 | uses-permission#android.permission.VIBRATE
44 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:8:3-63
45 | android:name
46 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:8:20-61
47 | uses-permission#android.permission.READ_SMS
48 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:9:3-64
49 | android:name
50 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:9:20-62
51 | application
52 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:10:3-17:17
53 | android:label
54 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:10:46-78
55 | android:icon
56 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:10:16-45
57 | activity#sk.kottman.androlua.Main
58 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:11:5-16:16
59 | android:label
60 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:11:15-47
61 | android:name
62 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:11:48-68
63 | intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
64 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:12:7-15:23
65 | action#android.intent.action.MAIN
66 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:13:9-60
67 | android:name
68 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:13:17-58
69 | category#android.intent.category.LAUNCHER
70 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:14:9-68
71 | android:name
72 | ADDED from D:\AndroidProject\AndroLua\app\src\main\AndroidManifest.xml:14:19-66
73 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/assets/greet.lua:
--------------------------------------------------------------------------------
1 | greet = {}
2 | function greet.hello(name)
3 | print('Hello '..name..'!')
4 | end
5 |
--------------------------------------------------------------------------------
/app/src/main/assets/import.lua:
--------------------------------------------------------------------------------
1 | local packages = {}
2 | local append = table.insert
3 | local new = luajava.new
4 |
5 | -- SciTE requires this, if you want to see stdout immediately...
6 |
7 | io.stdout:setvbuf 'no'
8 | io.stderr:setvbuf 'no'
9 |
10 | local function new_tostring (o)
11 | return o:toString()
12 | end
13 |
14 | local function call (t,...)
15 | local obj,stat
16 | if select('#',...) == 1 and type(select(1,...))=='table' then
17 | obj = make_array(t,select(1,...))
18 | else
19 | stat,obj = pcall(new,t,...)
20 | if not stat then
21 | print(debug.traceback())
22 | os.exit(1)
23 | end
24 | end
25 | getmetatable(obj).__tostring = new_tostring
26 | return obj
27 | end
28 |
29 | local function import_class (classname,packagename)
30 | local res,class = pcall(luajava.bindClass,packagename)
31 | if res then
32 | _G[classname] = class
33 | local mt = getmetatable(class)
34 | mt.__call = call
35 | return class
36 | end
37 | end
38 |
39 | local function massage_classname (classname)
40 | if classname:find('_') then
41 | classname = classname:gsub('_','$')
42 | end
43 | return classname
44 | end
45 |
46 | local globalMT = {
47 | __index = function(T,classname)
48 | classname = massage_classname(classname)
49 | for i,p in ipairs(packages) do
50 | local class = import_class(classname,p..classname)
51 | if class then return class end
52 | end
53 | error("import cannot find "..classname)
54 | end
55 | }
56 | setmetatable(_G, globalMT)
57 |
58 | function import (package)
59 | local i = package:find('%.%*$')
60 | if i then -- a wildcard; put into the package list, including the final '.'
61 | append(packages,package:sub(1,i))
62 | else
63 | local classname = package:match('([%w_]+)$')
64 | if not import_class(classname,package) then
65 | error("cannot find "..package)
66 | end
67 | end
68 | end
69 |
70 | append(packages,'')
71 |
72 | function proxy (classname,obj)
73 | classname = massage_classname(classname)
74 | -- if the classname contains dots it's assumed to be fully qualified
75 | if classname:find('.',1,true) then
76 | return luajava.createProxy(classname,obj)
77 | end
78 | -- otherwise, it must lie on the package path!
79 | for i,p in ipairs(packages) do
80 | local ok,res = pcall(luajava.createProxy,p..classname, obj)
81 | if ok then return res end
82 | end
83 | error ("cannot find "..classname)
84 | end
85 |
86 |
87 | function enum(e)
88 | --local e = o:GetEnumerator()
89 | return function()
90 | if e:hasMoreElements() then
91 | return e:nextElement()
92 | end
93 | end
94 | end
95 |
96 | function dump (t)
97 | for k,v in pairs(t) do
98 | print(k,v)
99 | end
100 | end
101 |
102 | function p (o)
103 | if type(o) == 'userdata' then
104 | local mt = getmetatable(o)
105 | if not mt.__tostring then
106 | return print('java:'..o:toString())
107 | end
108 | end
109 | print(type(o)..':'..tostring(o))
110 | end
111 |
112 | import 'java.lang.reflect.Array'
113 |
114 | function make_array (Type,list)
115 | local len
116 | local init = type(list)=='table'
117 | if init then
118 | len = #list
119 | else
120 | len = list
121 | end
122 | local arr = Array:newInstance(Type,len)
123 | if init then
124 | for i,v in ipairs(list) do
125 | Array:set(arr,i-1,v)
126 | end
127 | end
128 | return arr
129 | end
130 |
131 |
132 | import 'java.lang.*'
133 | import 'java.util.*'
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/app/src/main/assets/luatouch.lua:
--------------------------------------------------------------------------------
1 | --
2 | -- Created by IntelliJ IDEA.
3 | -- User: rzx
4 | -- Date: 2016/7/20
5 | -- Time: 15:22
6 | -- To change this template use File | Settings | File Templates.
7 | --
8 |
9 | require 'import'
10 | import 'com.android.uiautomator.core.UiDevice'
11 |
12 | local uiDevice = UiDevice:getInstance()
13 |
14 | -- Retrieves the product name of the device.
15 | --
16 | -- This method provides information on what type of device the test is running on. This value is
17 | -- the same as returned by invoking #adb shell getprop ro.product.name.
18 | --
19 | -- @return product name of the device
20 | function getProductName()
21 | return uiDevice:getProductName()
22 | end
23 |
24 | --Simulates a short press on the MENU button.
25 | function pressMenu()
26 | uiDevice:pressMenu()
27 | end
28 |
29 | --Simulates a short press on the BACK button.
30 | function pressBack()
31 | uiDevice:pressBack()
32 | end
33 |
34 | --Simulates a short press on the HOME button.
35 | function pressHome()
36 | uiDevice:pressHome()
37 | end
38 |
39 | --Simulates a short press on the DELETE key.
40 | function pressDelete()
41 | uiDevice:pressDelete()
42 | end
43 |
44 | --Simulates a short press on the ENTER key.
45 | function pressEnter()
46 | uiDevice:pressEnter()
47 | end
48 |
49 | --Opens the notification shade.
50 | function openNotification()
51 | uiDevice:openNotification()
52 | end
53 |
54 | --Opens the Quick Settings shade.
55 | function openQuickSettings()
56 | uiDevice:openQuickSettings()
57 | end
58 |
59 | --Simulates a short press using a key code.
60 | --@param keyCode key code
61 | function pressKeyCode(keyCode)
62 | uiDevice:pressKeyCode(keyCode)
63 | end
64 |
65 | --Perform a click at arbitrary coordinates specified by the user
66 | --@param x coordinate
67 | --@param y coordinate
68 | function click(x, y)
69 | uiDevice:click(x, y)
70 | end
71 |
72 |
73 | -- Performs a swipe from one coordinate to another using the number of steps
74 | -- to determine smoothness and speed. Each step execution is throttled to 5ms
75 | -- per step. So for a 100 steps, the swipe will take about 1/2 second to complete.
76 | --
77 | -- @param startX
78 | -- @param startY
79 | -- @param endX
80 | -- @param endY
81 | -- @param steps is the number of move steps sent to the system
82 | function swipe(startX, startY, endX, endY, steps)
83 | uiDevice:swipe(startX, startY, endX, endY, steps)
84 | end
85 |
86 | -- the same to swipe
87 | function move(startX, startY, endX, endY, steps)
88 | swipe(startX, startY, endX, endY, steps)
89 | end
90 |
91 | --[[
92 | * Performs a swipe from one coordinate to another coordinate. You can control
93 | * the smoothness and speed of the swipe by specifying the number of steps.
94 | * Each step execution is throttled to 5 milliseconds per step, so for a 100
95 | * steps, the swipe will take around 0.5 seconds to complete.
96 | *
97 | * @param startX X-axis value for the starting coordinate
98 | * @param startY Y-axis value for the starting coordinate
99 | * @param endX X-axis value for the ending coordinate
100 | * @param endY Y-axis value for the ending coordinate
101 | * @param steps is the number of steps for the swipe action
102 | ]]
103 | function drag(startX, startY, endX, endY, steps)
104 | uiDevice:drag(startX, startY, endX, endY, steps)
105 | end
106 |
107 | --[[
108 | * Waits for the current application to idle.
109 | * @param timeout in milliseconds
110 | ]]
111 | function waitForIdle(timeout)
112 | uiDevice:waitForIdle(timeout)
113 | end
114 |
115 | -- Retrieves the name of the last package to report accessibility events.
116 | -- @return String name of package
117 | function getCurrentPackageName()
118 | return uiDevice:getCurrentPackageName()
119 | end
120 |
121 | --[[
122 | * This method simulates pressing the power button if the screen is OFF else
123 | * it does nothing if the screen is already ON.
124 | *
125 | * If the screen was OFF and it just got turned ON, this method will insert a 500ms delay
126 | * to allow the device time to wake up and accept input.
127 | ]]
128 | function screenOn()
129 | uiDevice:wakeUp()
130 | end
131 |
132 | --[[
133 | * Checks the power manager if the screen is ON.
134 | *
135 | * @return true if the screen is ON else false
136 | ]]
137 | function isScreenOn()
138 | return uiDevice:isScreenOn()
139 | end
140 |
141 | --[[
142 | * This method simply presses the power button if the screen is ON else
143 | * it does nothing if the screen is already OFF.
144 | ]]
145 | function screenOff()
146 | uiDevice:sleep()
147 | end
148 |
149 | --[[
150 | * Take a screenshot of current window and store it as PNG
151 | *
152 | * The screenshot is adjusted per screen rotation
153 | *
154 | * Default scale of 1.0f (original size) and 90% quality is used
155 | * The screenshot is adjusted per screen rotation
156 | *
157 | * @param storePath where the PNG should be written to
158 | * @param scale scale the screenshot down if needed; 1.0f for original size
159 | * @param quality quality of the PNG compression; range: 0-100
160 | * @return true if screen shot is created successfully, false otherwise
161 | ]]
162 | function takeScreenshot(storePath, scale, quality)
163 | scale = scale or 1.0
164 | quality = quality or 90
165 |
166 | uiDevice:takeScreenshot(storePath, scale, quality)
167 | end
168 |
169 | import 'android.widget.Toast'
170 | function toast(str)
171 | local t = Toast:makeText(activity:getApplicationContext(), str, Toast.LENGTH_SHORT)
172 | t:show()
173 | end
--------------------------------------------------------------------------------
/app/src/main/java/com/android/uiautomator/core/AccessibilityNodeInfoHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.uiautomator.core;
17 |
18 | import android.graphics.Rect;
19 | import android.view.accessibility.AccessibilityNodeInfo;
20 |
21 | /**
22 | * This class contains static helper methods to work with
23 | * {@link AccessibilityNodeInfo}
24 | */
25 | class AccessibilityNodeInfoHelper {
26 |
27 | /**
28 | * Returns the node's bounds clipped to the size of the display
29 | *
30 | * @param node
31 | * @param width pixel width of the display
32 | * @param height pixel height of the display
33 | * @return null if node is null, else a Rect containing visible bounds
34 | */
35 | static Rect getVisibleBoundsInScreen(AccessibilityNodeInfo node, int width, int height) {
36 | if (node == null) {
37 | return null;
38 | }
39 | // targeted node's bounds
40 | Rect nodeRect = new Rect();
41 | node.getBoundsInScreen(nodeRect);
42 |
43 | Rect displayRect = new Rect();
44 | displayRect.top = 0;
45 | displayRect.left = 0;
46 | displayRect.right = width;
47 | displayRect.bottom = height;
48 |
49 | boolean intersect = nodeRect.intersect(displayRect);
50 | return nodeRect;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/android/uiautomator/core/InstrumentationUiAutomatorBridge.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.uiautomator.core;
18 |
19 | import android.app.Service;
20 | import android.app.UiAutomation;
21 | import android.content.Context;
22 | import android.os.PowerManager;
23 | import android.view.Display;
24 | import android.view.ViewConfiguration;
25 | import android.view.WindowManager;
26 |
27 | /**
28 | * @hide
29 | */
30 | public class InstrumentationUiAutomatorBridge extends UiAutomatorBridge {
31 |
32 | private final Context mContext;
33 |
34 | public InstrumentationUiAutomatorBridge(Context context, UiAutomation uiAutomation) {
35 | super(uiAutomation);
36 | mContext = context;
37 | }
38 |
39 | public Display getDefaultDisplay() {
40 | WindowManager windowManager = (WindowManager)
41 | mContext.getSystemService(Service.WINDOW_SERVICE);
42 | return windowManager.getDefaultDisplay();
43 | }
44 |
45 | @Override
46 | public int getRotation() {
47 | return getDefaultDisplay().getRotation();
48 | }
49 |
50 | @Override
51 | public boolean isScreenOn() {
52 | PowerManager pm = (PowerManager)
53 | mContext.getSystemService(Service.POWER_SERVICE);
54 | return pm.isScreenOn();
55 | }
56 |
57 | public long getSystemLongPressTime() {
58 | return ViewConfiguration.getLongPressTimeout();
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/android/uiautomator/core/UiAutomatorBridge.java:
--------------------------------------------------------------------------------
1 | package com.android.uiautomator.core;
2 |
3 | import android.accessibilityservice.AccessibilityServiceInfo;
4 | import android.app.UiAutomation;
5 | import android.app.UiAutomation.AccessibilityEventFilter;
6 | import android.app.UiAutomation.OnAccessibilityEventListener;
7 | import android.graphics.Bitmap;
8 | import android.util.Log;
9 | import android.view.Display;
10 | import android.view.InputEvent;
11 | import android.view.accessibility.AccessibilityEvent;
12 | import android.view.accessibility.AccessibilityNodeInfo;
13 |
14 | import java.io.BufferedOutputStream;
15 | import java.io.File;
16 | import java.io.FileOutputStream;
17 | import java.io.IOException;
18 | import java.util.concurrent.TimeoutException;
19 |
20 | /**
21 | * @hide
22 | */
23 | public abstract class UiAutomatorBridge {
24 |
25 | private static final String LOG_TAG = UiAutomatorBridge.class.getSimpleName();
26 |
27 | /**
28 | * This value has the greatest bearing on the appearance of test execution speeds.
29 | * This value is used as the minimum time to wait before considering the UI idle after
30 | * each action.
31 | */
32 | private static final long QUIET_TIME_TO_BE_CONSIDERD_IDLE_STATE = 500;//ms
33 |
34 | /**
35 | * This is the maximum time the automation will wait for the UI to go idle. Execution
36 | * will resume normally anyway. This is to prevent waiting forever on display updates
37 | * that may be related to spinning wheels or progress updates of sorts etc...
38 | */
39 | private static final long TOTAL_TIME_TO_WAIT_FOR_IDLE_STATE = 1000 * 10;//ms
40 |
41 | private final UiAutomation mUiAutomation;
42 |
43 | private final InteractionController mInteractionController;
44 |
45 | private final QueryController mQueryController;
46 |
47 | UiAutomatorBridge(UiAutomation uiAutomation) {
48 | mUiAutomation = uiAutomation;
49 | mInteractionController = new InteractionController(this);
50 | mQueryController = new QueryController(this);
51 | }
52 |
53 | InteractionController getInteractionController() {
54 | return mInteractionController;
55 | }
56 |
57 | QueryController getQueryController() {
58 | return mQueryController;
59 | }
60 |
61 | public void setOnAccessibilityEventListener(OnAccessibilityEventListener listener) {
62 | mUiAutomation.setOnAccessibilityEventListener(listener);
63 | }
64 |
65 | public AccessibilityNodeInfo getRootInActiveWindow() {
66 | return mUiAutomation.getRootInActiveWindow();
67 | }
68 |
69 | public boolean injectInputEvent(InputEvent event, boolean sync) {
70 | return mUiAutomation.injectInputEvent(event, sync);
71 | }
72 |
73 | public boolean setRotation(int rotation) {
74 | return mUiAutomation.setRotation(rotation);
75 | }
76 |
77 | public void setCompressedLayoutHierarchy(boolean compressed) {
78 | AccessibilityServiceInfo info = mUiAutomation.getServiceInfo();
79 | if (compressed)
80 | info.flags &= ~AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
81 | else
82 | info.flags |= AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
83 | mUiAutomation.setServiceInfo(info);
84 | }
85 |
86 | public abstract int getRotation();
87 |
88 | public abstract boolean isScreenOn();
89 |
90 | public void waitForIdle() {
91 | waitForIdle(TOTAL_TIME_TO_WAIT_FOR_IDLE_STATE);
92 | }
93 |
94 | public void waitForIdle(long timeout) {
95 | try {
96 | mUiAutomation.waitForIdle(QUIET_TIME_TO_BE_CONSIDERD_IDLE_STATE, timeout);
97 | } catch (TimeoutException te) {
98 | Log.w(LOG_TAG, "Could not detect idle state.", te);
99 | }
100 | }
101 |
102 | public AccessibilityEvent executeCommandAndWaitForAccessibilityEvent(Runnable command,
103 | AccessibilityEventFilter filter, long timeoutMillis) throws TimeoutException {
104 | return mUiAutomation.executeAndWaitForEvent(command,
105 | filter, timeoutMillis);
106 | }
107 |
108 | public boolean takeScreenshot(File storePath, int quality) {
109 | Bitmap screenshot = mUiAutomation.takeScreenshot();
110 | if (screenshot == null) {
111 | return false;
112 | }
113 | BufferedOutputStream bos = null;
114 | try {
115 | bos = new BufferedOutputStream(new FileOutputStream(storePath));
116 | if (bos != null) {
117 | screenshot.compress(Bitmap.CompressFormat.PNG, quality, bos);
118 | bos.flush();
119 | }
120 | } catch (IOException ioe) {
121 | Log.e(LOG_TAG, "failed to save screen shot to file", ioe);
122 | return false;
123 | } finally {
124 | if (bos != null) {
125 | try {
126 | bos.close();
127 | } catch (IOException ioe) {
128 | /* ignore */
129 | }
130 | }
131 | screenshot.recycle();
132 | }
133 | return true;
134 | }
135 |
136 | public boolean performGlobalAction(int action) {
137 | return mUiAutomation.performGlobalAction(action);
138 | }
139 |
140 | public abstract Display getDefaultDisplay();
141 |
142 | public abstract long getSystemLongPressTime();
143 | }
144 |
--------------------------------------------------------------------------------
/app/src/main/java/com/android/uiautomator/core/UiCollection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.uiautomator.core;
17 |
18 | /**
19 | * Used to enumerate a container's UI elements for the purpose of counting,
20 | * or targeting a sub elements by a child's text or description.
21 | * @since API Level 16
22 | */
23 | public class UiCollection extends UiObject {
24 |
25 | /**
26 | * Constructs an instance as described by the selector
27 | *
28 | * @param selector
29 | * @since API Level 16
30 | */
31 | public UiCollection(UiSelector selector) {
32 | super(selector);
33 | }
34 |
35 | /**
36 | * Searches for child UI element within the constraints of this UiCollection {@link UiSelector}
37 | * selector.
38 | *
39 | * It looks for any child matching the childPattern argument that has
40 | * a child UI element anywhere within its sub hierarchy that has content-description text.
41 | * The returned UiObject will point at the childPattern instance that matched the
42 | * search and not at the identifying child element that matched the content description.
43 | *
44 | * @param childPattern {@link UiSelector} selector of the child pattern to match and return
45 | * @param text String of the identifying child contents of of the childPattern
46 | * @return {@link UiObject} pointing at and instance of childPattern
47 | * @throws UiObjectNotFoundException
48 | * @since API Level 16
49 | */
50 | public UiObject getChildByDescription(UiSelector childPattern, String text)
51 | throws UiObjectNotFoundException {
52 | Tracer.trace(childPattern, text);
53 | if (text != null) {
54 | int count = getChildCount(childPattern);
55 | for (int x = 0; x < count; x++) {
56 | UiObject row = getChildByInstance(childPattern, x);
57 | String nodeDesc = row.getContentDescription();
58 | if(nodeDesc != null && nodeDesc.contains(text)) {
59 | return row;
60 | }
61 | UiObject item = row.getChild(new UiSelector().descriptionContains(text));
62 | if (item.exists()) {
63 | return row;
64 | }
65 | }
66 | }
67 | throw new UiObjectNotFoundException("for description= \"" + text + "\"");
68 | }
69 |
70 | /**
71 | * Searches for child UI element within the constraints of this UiCollection {@link UiSelector}
72 | * selector.
73 | *
74 | * It looks for any child matching the childPattern argument that has
75 | * a child UI element anywhere within its sub hierarchy that is at the instance
76 | * specified. The operation is performed only on the visible items and no scrolling is performed
77 | * in this case.
78 | *
79 | * @param childPattern {@link UiSelector} selector of the child pattern to match and return
80 | * @param instance int the desired matched instance of this childPattern
81 | * @return {@link UiObject} pointing at and instance of childPattern
82 | * @since API Level 16
83 | */
84 | public UiObject getChildByInstance(UiSelector childPattern, int instance)
85 | throws UiObjectNotFoundException {
86 | Tracer.trace(childPattern, instance);
87 | UiSelector patternSelector = UiSelector.patternBuilder(getSelector(),
88 | UiSelector.patternBuilder(childPattern).instance(instance));
89 | return new UiObject(patternSelector);
90 | }
91 |
92 | /**
93 | * Searches for child UI element within the constraints of this UiCollection {@link UiSelector}
94 | * selector.
95 | *
96 | * It looks for any child matching the childPattern argument that has
97 | * a child UI element anywhere within its sub hierarchy that has text attribute =
98 | * text. The returned UiObject will point at the childPattern
99 | * instance that matched the search and not at the identifying child element that matched the
100 | * text attribute.
101 | *
102 | * @param childPattern {@link UiSelector} selector of the child pattern to match and return
103 | * @param text String of the identifying child contents of of the childPattern
104 | * @return {@link UiObject} pointing at and instance of childPattern
105 | * @throws UiObjectNotFoundException
106 | * @since API Level 16
107 | */
108 | public UiObject getChildByText(UiSelector childPattern, String text)
109 | throws UiObjectNotFoundException {
110 | Tracer.trace(childPattern, text);
111 | if (text != null) {
112 | int count = getChildCount(childPattern);
113 | for (int x = 0; x < count; x++) {
114 | UiObject row = getChildByInstance(childPattern, x);
115 | String nodeText = row.getText();
116 | if(text.equals(nodeText)) {
117 | return row;
118 | }
119 | UiObject item = row.getChild(new UiSelector().text(text));
120 | if (item.exists()) {
121 | return row;
122 | }
123 | }
124 | }
125 | throw new UiObjectNotFoundException("for text= \"" + text + "\"");
126 | }
127 |
128 | /**
129 | * Counts child UI element instances matching the childPattern
130 | * argument. The method returns the number of matching UI elements that are
131 | * currently visible. The count does not include items of a scrollable list
132 | * that are off-screen.
133 | *
134 | * @param childPattern a {@link UiSelector} that represents the matching child UI
135 | * elements to count
136 | * @return the number of matched childPattern under the current {@link UiCollection}
137 | * @since API Level 16
138 | */
139 | public int getChildCount(UiSelector childPattern) {
140 | Tracer.trace(childPattern);
141 | UiSelector patternSelector =
142 | UiSelector.patternBuilder(getSelector(), UiSelector.patternBuilder(childPattern));
143 | return getQueryController().getPatternCount(patternSelector);
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/app/src/main/java/com/android/uiautomator/core/UiObjectNotFoundException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.uiautomator.core;
18 |
19 | /**
20 | * Generated in test runs when a {@link UiSelector} selector could not be matched
21 | * to any UI element displayed.
22 | * @since API Level 16
23 | */
24 | public class UiObjectNotFoundException extends Exception {
25 |
26 | private static final long serialVersionUID = 1L;
27 |
28 | /**
29 | * @since API Level 16
30 | **/
31 | public UiObjectNotFoundException(String msg) {
32 | super(msg);
33 | }
34 |
35 | /**
36 | * @since API Level 16
37 | **/
38 | public UiObjectNotFoundException(String detailMessage, Throwable throwable) {
39 | super(detailMessage, throwable);
40 | }
41 |
42 | /**
43 | * @since API Level 16
44 | **/
45 | public UiObjectNotFoundException(Throwable throwable) {
46 | super(throwable);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/android/uiautomator/core/UiWatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.uiautomator.core;
17 |
18 | /**
19 | * See {@link UiDevice#registerWatcher(String, UiWatcher)} on how to register a
20 | * a condition watcher to be called by the automation library. The automation library will
21 | * invoke checkForCondition() only when a regular API call is in retry mode because it is unable
22 | * to locate its selector yet. Only during this time, the watchers are invoked to check if there is
23 | * something else unexpected on the screen.
24 | * @since API Level 16
25 | */
26 | public interface UiWatcher {
27 |
28 | /**
29 | * Custom handler that is automatically called when the testing framework is unable to
30 | * find a match using the {@link UiSelector}
31 | *
32 | * When the framework is in the process of matching a {@link UiSelector} and it
33 | * is unable to match any widget based on the specified criteria in the selector,
34 | * the framework will perform retries for a predetermined time, waiting for the display
35 | * to update and show the desired widget. While the framework is in this state, it will call
36 | * registered watchers' checkForCondition(). This gives the registered watchers a chance
37 | * to take a look at the display and see if there is a recognized condition that can be
38 | * handled and in doing so allowing the current test to continue.
39 | *
40 | * An example usage would be to look for dialogs popped due to other background
41 | * processes requesting user attention and have nothing to do with the application
42 | * currently under test.
43 | *
44 | * @return true to indicate a matched condition or false for nothing was matched
45 | * @since API Level 16
46 | */
47 | public boolean checkForCondition();
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/org/keplerproject/luajava/CPtr.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: CPtr.java,v 1.4 2006/12/22 14:06:40 thiago Exp $
3 | * Copyright (C) 2003-2007 Kepler Project.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | package org.keplerproject.luajava;
26 |
27 | /**
28 | * An abstraction for a C pointer data type. A CPtr instance represents, on
29 | * the Java side, a C pointer. The C pointer could be any type of C
30 | * pointer.
31 | */
32 | public class CPtr
33 | {
34 |
35 | /**
36 | * Compares this CPtr to the specified object.
37 | *
38 | * @param other a CPtr
39 | * @return true if the class of this CPtr object and the
40 | * class of other are exactly equal, and the C
41 | * pointers being pointed to by these objects are also
42 | * equal. Returns false otherwise.
43 | */
44 | public boolean equals(Object other)
45 | {
46 | if (other == null)
47 | return false;
48 | if (other == this)
49 | return true;
50 | if (CPtr.class != other.getClass())
51 | return false;
52 | return peer == ((CPtr)other).peer;
53 | }
54 |
55 |
56 | /* Pointer value of the real C pointer. Use long to be 64-bit safe. */
57 | private long peer;
58 |
59 | /**
60 | * Gets the value of the C pointer abstraction
61 | * @return long
62 | */
63 | protected long getPeer()
64 | {
65 | return peer;
66 | }
67 |
68 | /* No-args constructor. */
69 | CPtr() {}
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/java/org/keplerproject/luajava/Console.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: Console.java,v 1.7 2006/12/22 14:06:40 thiago Exp $
3 | * Copyright (C) 2003-2007 Kepler Project.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | package org.keplerproject.luajava;
26 |
27 | import java.io.BufferedReader;
28 | import java.io.InputStreamReader;
29 |
30 | /**
31 | * Simple LuaJava console.
32 | * This is also an example on how to use the Java side of LuaJava and how to startup
33 | * a LuaJava application.
34 | *
35 | * @author Thiago Ponte
36 | */
37 | public class Console
38 | {
39 |
40 | /**
41 | * Creates a console for user interaction.
42 | *
43 | * @param args names of the lua files to be executed
44 | */
45 | public static void main(String[] args)
46 | {
47 | try
48 | {
49 | LuaState L = LuaStateFactory.newLuaState();
50 | L.openLibs();
51 |
52 | if (args.length > 0)
53 | {
54 | for (int i = 0; i < args.length; i++)
55 | {
56 | int res = L.LloadFile(args[i]);
57 | if (res == 0)
58 | {
59 | res = L.pcall(0, 0, 0);
60 | }
61 | if (res != 0)
62 | {
63 | throw new LuaException("Error on file: " + args[i] + ". " + L.toString(-1));
64 | }
65 | }
66 |
67 | return;
68 | }
69 |
70 | System.out.println("API Lua Java - console mode.");
71 |
72 | BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
73 |
74 | String line;
75 |
76 | System.out.print("> ");
77 | while ((line = inp.readLine()) != null && !line.equals("exit"))
78 | {
79 | int ret = L.LloadBuffer(line.getBytes(), "from console");
80 | if (ret == 0)
81 | {
82 | ret = L.pcall(0, 0, 0);
83 | }
84 | if (ret != 0)
85 | {
86 | System.err.println("Error on line: " + line);
87 | System.err.println(L.toString(-1));
88 | }
89 | System.out.print("> ");
90 | }
91 |
92 | L.close();
93 | }
94 | catch (Exception e)
95 | {
96 | e.printStackTrace();
97 | }
98 |
99 | }
100 | }
--------------------------------------------------------------------------------
/app/src/main/java/org/keplerproject/luajava/JavaFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: JavaFunction.java,v 1.6 2006/12/22 14:06:40 thiago Exp $
3 | * Copyright (C) 2003-2007 Kepler Project.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | package org.keplerproject.luajava;
26 |
27 | /**
28 | * JavaFunction is a class that can be used to implement a Lua function in Java.
29 | * JavaFunction is an abstract class, so in order to use it you must extend this
30 | * class and implement the execute method. This execute
31 | * method is the method that will be called when you call the function from Lua.
32 | * To register the JavaFunction in Lua use the method register(String name).
33 | */
34 | public abstract class JavaFunction
35 | {
36 |
37 | /**
38 | * This is the state in which this function will exist.
39 | */
40 | protected LuaState L;
41 |
42 | /**
43 | * This method is called from Lua. Any parameters can be taken with
44 | * getParam. A reference to the JavaFunctionWrapper itself is
45 | * always the first parameter received. Values passed back as results
46 | * of the function must be pushed onto the stack.
47 | * @return The number of values pushed onto the stack.
48 | */
49 | public abstract int execute() throws LuaException;
50 |
51 | /**
52 | * Constructor that receives a LuaState.
53 | * @param L LuaState object associated with this JavaFunction object
54 | */
55 | public JavaFunction(LuaState L)
56 | {
57 | this.L = L;
58 | }
59 |
60 | /**
61 | * Returns a parameter received from Lua. Parameters are numbered from 1.
62 | * A reference to the JavaFunction itself is always the first parameter
63 | * received (the same as this).
64 | * @param idx Index of the parameter.
65 | * @return Reference to parameter.
66 | * @see LuaObject
67 | */
68 | public LuaObject getParam(int idx)
69 | {
70 | return L.getLuaObject(idx);
71 | }
72 |
73 | /**
74 | * Register a JavaFunction with a given name. This method registers in a
75 | * global variable the JavaFunction specified.
76 | * @param name name of the function.
77 | */
78 | public void register(String name) throws LuaException
79 | {
80 | synchronized (L)
81 | {
82 | L.pushJavaFunction(this);
83 | L.setGlobal(name);
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/app/src/main/java/org/keplerproject/luajava/LuaException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: LuaException.java,v 1.6 2006/12/22 14:06:40 thiago Exp $
3 | * Copyright (C) 2003-2007 Kepler Project.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | package org.keplerproject.luajava;
26 |
27 | /**
28 | * LuaJava exception
29 | *
30 | * @author Thiago Ponte
31 | *
32 | */
33 | public class LuaException extends Exception
34 | {
35 | /**
36 | *
37 | */
38 | private static final long serialVersionUID = 1L;
39 |
40 | public LuaException(String str)
41 | {
42 | super(str);
43 | }
44 |
45 | /**
46 | * Will work only on Java 1.4 or later.
47 | * To work with Java 1.3, comment the first line and uncomment the second one.
48 | */
49 | public LuaException(Exception e)
50 | {
51 | super((e.getCause() != null) ? e.getCause() : e);
52 | //super(e.getMessage());
53 | }
54 | }
--------------------------------------------------------------------------------
/app/src/main/java/org/keplerproject/luajava/LuaInvocationHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: LuaInvocationHandler.java,v 1.4 2006/12/22 14:06:40 thiago Exp $
3 | * Copyright (C) 2003-2007 Kepler Project.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | package org.keplerproject.luajava;
26 |
27 | import java.lang.reflect.InvocationHandler;
28 | import java.lang.reflect.Method;
29 |
30 | /**
31 | * Class that implements the InvocationHandler interface.
32 | * This class is used in the LuaJava's proxy system.
33 | * When a proxy object is accessed, the method invoked is
34 | * called from Lua
35 | * @author Rizzato
36 | * @author Thiago Ponte
37 | */
38 | public class LuaInvocationHandler implements InvocationHandler
39 | {
40 | private LuaObject obj;
41 |
42 |
43 | public LuaInvocationHandler(LuaObject obj)
44 | {
45 | this.obj = obj;
46 | }
47 |
48 | /**
49 | * Function called when a proxy object function is invoked.
50 | */
51 | public Object invoke(Object proxy, Method method, Object[] args) throws LuaException
52 | {
53 | synchronized(obj.L)
54 | {
55 | String methodName = method.getName();
56 | LuaObject func = obj.getField(methodName);
57 |
58 | if ( func.isNil() )
59 | {
60 | return null;
61 | }
62 |
63 | Class retType = method.getReturnType();
64 | Object ret;
65 |
66 | // Checks if returned type is void. if it is returns null.
67 | if ( retType.equals( Void.class ) || retType.equals( void.class ) )
68 | {
69 | func.call( args , 0 );
70 | ret = null;
71 | }
72 | else
73 | {
74 | ret = func.call(args, 1)[0];
75 | if( ret != null && ret instanceof Double )
76 | {
77 | ret = LuaState.convertLuaNumber((Double) ret, retType);
78 | }
79 | }
80 |
81 | return ret;
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/app/src/main/java/org/keplerproject/luajava/LuaStateFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: LuaStateFactory.java,v 1.4 2006/12/22 14:06:40 thiago Exp $
3 | * Copyright (C) 2003-2007 Kepler Project.
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining
6 | * a copy of this software and associated documentation files (the
7 | * "Software"), to deal in the Software without restriction, including
8 | * without limitation the rights to use, copy, modify, merge, publish,
9 | * distribute, sublicense, and/or sell copies of the Software, and to
10 | * permit persons to whom the Software is furnished to do so, subject to
11 | * the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be
14 | * included in all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | package org.keplerproject.luajava;
26 |
27 | import java.util.ArrayList;
28 | import java.util.List;
29 |
30 | /**
31 | * This class is responsible for instantiating new LuaStates.
32 | * When a new LuaState is instantiated it is put into a List
33 | * and an index is returned. This index is registred in Lua
34 | * and it is used to find the right LuaState when lua calls
35 | * a Java Function.
36 | *
37 | * @author Thiago Ponte
38 | */
39 | public final class LuaStateFactory
40 | {
41 | /**
42 | * Array with all luaState's instances
43 | */
44 | private static final List states = new ArrayList();
45 |
46 | /**
47 | * Non-public constructor.
48 | */
49 | private LuaStateFactory()
50 | {}
51 |
52 | /**
53 | * Method that creates a new instance of LuaState
54 | * @return LuaState
55 | */
56 | public synchronized static LuaState newLuaState()
57 | {
58 | int i = getNextStateIndex();
59 | LuaState L = new LuaState(i);
60 |
61 | states.add(i, L);
62 |
63 | return L;
64 | }
65 |
66 | /**
67 | * Returns a existing instance of LuaState
68 | * @param index
69 | * @return LuaState
70 | */
71 | public synchronized static LuaState getExistingState(int index)
72 | {
73 | return (LuaState) states.get(index);
74 | }
75 |
76 | /**
77 | * Receives a existing LuaState and checks if it exists in the states list.
78 | * If it doesn't exist adds it to the list.
79 | * @param L
80 | * @return int
81 | */
82 | public synchronized static int insertLuaState(LuaState L)
83 | {
84 | int i;
85 | for (i = 0 ; i < states.size() ; i++)
86 | {
87 | LuaState state = (LuaState) states.get(i);
88 |
89 | if (state != null)
90 | {
91 | if (state.getCPtrPeer() == L.getCPtrPeer())
92 | return i;
93 | }
94 | }
95 |
96 | i = getNextStateIndex();
97 |
98 | states.set(i, L);
99 |
100 | return i;
101 | }
102 |
103 | /**
104 | * removes the luaState from the states list
105 | * @param idx
106 | */
107 | public synchronized static void removeLuaState(int idx)
108 | {
109 | states.add(idx, null);
110 | }
111 |
112 | /**
113 | * Get next available index
114 | * @return int
115 | */
116 | private synchronized static int getNextStateIndex()
117 | {
118 | int i;
119 | for ( i=0 ; i < states.size() && states.get(i) != null ; i++ );
120 |
121 | return i;
122 | }
123 | }
--------------------------------------------------------------------------------
/app/src/main/java/sk/kottman/androlua/MyTest.java:
--------------------------------------------------------------------------------
1 | package sk.kottman.androlua;
2 |
3 | /**
4 | * Created by rzx on 2016/7/20.
5 | */
6 | public class MyTest {
7 | static final String getStr(){
8 | return "aaaa";
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libluajava.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/src/main/jniLibs/armeabi/libluajava.so
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/app/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
19 |
20 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Main!
4 | AndroLua
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/resources/org/keplerproject/luajava/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
28 |
29 |
30 |
31 |
LuaJava is a scripting tool for Java. The goal of this tool is to allow scripts written in Lua to manipulate components developed in Java.
32 |
33 |
34 | LuaJava allows Java components to be accessed from Lua using the same syntax
35 | that is used for accessing Lua`s native objects, without any need for
36 | declarations or any kind of preprocessing.
37 | For this check LuaJava's Lua Reference.
38 |
39 |
40 |
41 | LuaJava also allows Java to implement an interface using Lua.
42 | This way any interface can be implemented in Lua and passed as parameter to
43 | any method, and when called, the equivalent function will be called in Lua,
44 | and it's result passed back to Java.
45 |
46 |
47 |
Related Documentation
48 |
49 | For overviews, tutorials, examples, guides, and tool documentation, please see:
50 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | jcenter()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.5.0'
8 | }
9 | }
10 |
11 | allprojects {
12 | repositories {
13 | jcenter()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hu19891110/GodHand/e8222d248ccba6e07821364f12b2511332d5609f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Oct 21 11:34:03 PDT 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/import-summary.txt:
--------------------------------------------------------------------------------
1 | ECLIPSE ANDROID PROJECT IMPORT SUMMARY
2 | ======================================
3 |
4 | Ignored Files:
5 | --------------
6 | The following files were *not* copied into the new Gradle project; you
7 | should evaluate whether these are still needed in your project and if
8 | so manually move them:
9 |
10 | * LICENSE.txt
11 | * README.md
12 | * init.lua
13 | * interp.lua
14 | * lua-license.txt
15 | * luajava-license.txt
16 | * proguard.cfg
17 |
18 | Moved Files:
19 | ------------
20 | Android Gradle projects use a different directory structure than ADT
21 | Eclipse projects. Here's how the projects were restructured:
22 |
23 | * AndroidManifest.xml => app\src\main\AndroidManifest.xml
24 | * assets\ => app\src\main\assets\
25 | * jni\ => app\src\main\jni\
26 | * libs\armeabi\libluajava.so => app\src\main\jniLibs\armeabi\libluajava.so
27 | * res\ => app\src\main\res\
28 | * src\ => app\src\main\java\
29 | * src\org\keplerproject\luajava\package.html => app\src\main\resources\org\keplerproject\luajava\package.html
30 |
31 | Next Steps:
32 | -----------
33 | You can now build the project. The Gradle project needs network
34 | connectivity to download dependencies.
35 |
36 | Bugs:
37 | -----
38 | If for some reason your project does not build, and you determine that
39 | it is due to a bug or limitation of the Eclipse to Gradle importer,
40 | please file a bug at http://b.android.com with category
41 | Component-Tools.
42 |
43 | (This import summary is for your information only, and can be deleted
44 | after import once you are satisfied with the results.)
45 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Tue Jul 19 09:34:53 CST 2016
11 | ndk.dir=C\:\\Users\\rzx\\AppData\\Local\\Android\\sdk\\ndk-bundle
12 | sdk.dir=C\:\\Users\\rzx\\AppData\\Local\\Android\\sdk
13 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------