HellerCommaA / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

NPE in SL4A when launched from Locale situation #583

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What device(s) are you experiencing the problem on?

Nexus S

What firmware version are you running on the device?

Android version : 2.3.6
Release Codename : REL
GRK39F

What steps will reproduce the problem?

  Configure a Locale situation with a setting to launch an SL4A script

What is the expected output?

  The script runs 

What do you see instead?

 10-31 14:09:19.652 I/ActivityManager(106)Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.CAR_DOCK] flg=0x10200000 cmp=com.google.android.carhome/.CarHome } from pid 106
10-31 14:09:19.667 I/ActivityManager(106)Config changed: { scale=1.0 
imsi=310/410 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=19 
seq=8}
10-31 14:09:20.156 I/ActivityManager(106)Start proc 
com.googlecode.android_scripting for broadcast 
com.googlecode.android_scripting/.locale.LocaleReceiver: pid=26490 uid=10072 
gids={3003, 1015, 1007, 3002, 3001, 1006}
10-31 14:09:20.777 I/ActivityManager(106)Starting: Intent { flg=0x10000000 
cmp=com.twofortyfouram.locale/.components.settings.BrightnessSettingFactory$Imme
diateBrightnessHackActivity (has extras) } from pid 24295
10-31 14:09:20.835 W/InputManagerService(106)Window already focused, ignoring 
focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40b47850
10-31 14:09:21.394 E/AndroidRuntime(26490)FATAL EXCEPTION: main
10-31 14:09:21.394 E/AndroidRuntime(26490)java.lang.RuntimeException: Unable to 
start receiver com.googlecode.android_scripting.locale.LocaleReceiver: 
java.lang.NullPointerException
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.app.ActivityThread.handleReceiver(ActivityThread.java:1805)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.app.ActivityThread.access$2400(ActivityThread.java:117)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:981)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.os.Handler.dispatchMessage(Handler.java:99)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.os.Looper.loop(Looper.java:130)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.app.ActivityThread.main(ActivityThread.java:3683)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
java.lang.reflect.Method.invokeNative(Native Method)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
java.lang.reflect.Method.invoke(Method.java:507)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
dalvik.system.NativeStart.main(Native Method)
10-31 14:09:21.394 E/AndroidRuntime(26490)Caused by: 
java.lang.NullPointerException
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
java.io.File.fixSlashes(File.java:205)
10-31 14:09:21.394 E/AndroidRuntime(26490)at java.io.File.init(File.java:189)
10-31 14:09:21.394 E/AndroidRuntime(26490)at java.io.File.<init>(File.java:139)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
com.googlecode.android_scripting.locale.LocaleReceiver.onReceive(LocaleReceiver.
java:33)
10-31 14:09:21.394 E/AndroidRuntime(26490)at 
android.app.ActivityThread.handleReceiver(ActivityThread.java:1794)
10-31 14:09:21.394 E/AndroidRuntime(26490)... 10 more
10-31 14:09:21.402 I/ActivityManager(106)Process 
com.googlecode.android_scripting (pid 26490) has died.

What version of the product are you using? 

SL4Ar4 

On what operating system?

Android version : 2.3.6
Release Codename : REL
API LEVEL : 10
CPU ABI : armeabi-v7a
Manufacturer : samsung
Bootloader : I9020XXKA3
CPU ABI2 : armeabi
Hardware : herring
Radio : unknown
Board : herring
Brand : google
Device : crespo
Display : GRK39F
Fingerprint : google/soju/crespo:2.3.6/GRK39F/189904:user/release-keys

Please provide any additional information below.

This worked fine on earlier releases of SL4A.

Date: Thu, 03 Nov 2011 23:21:36 -0400
From: "two forty four a.m." <up@244.am>
To: "Maggie Leber (sl: Maggie Darwin)" <maggie@matrisync.com>
Subject: Re: (Case 7460) NPE in java.io.File.fixSlashes(File.java:205) when 
launching SL4A script from Locale

Hi Maggie,

Locale is not crashing- this is something that would need to be taken up with 
SL4A.  I recommend that you contact that developer directly.

Thanks for your interest in Locale,

Case

Original issue reported on code.google.com by margaret...@gmail.com on 4 Nov 2011 at 11:16

GoogleCodeExporter commented 9 years ago
Getting the same issue on Gingerbread, 2.3.4, 2.3.5 and 2.3.7 with Locale 2.0 
and higher. SL4A Release 4. Python 2.6.

Device: Atrix 4g
OS: Stock 2.3.4 ATT, and on CM7.1 ATRIX 4G B~N release (GB 2.3.5,2.3.7)
Plugin used with: Tasker, Locale.

Basically running any Script called outside of SL4A main screen crashes the 
SL4A process.

My assumption is that SL4A and Google's are not referring to the same path when 
calling the script.

Similar issues: Please refer to issue: 315 in the issue List.

http://code.google.com/p/android-scripting/issues/detail?id=315&can=1&q=ASE%20fo
rce%20close&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%
20Stars

Logcat attached.

Original comment by jamil.masarweh on 4 Nov 2011 at 2:15

Attachments:

GoogleCodeExporter commented 9 years ago
This is a bug in SL4A, as it isn't properly implementing the Locale 1.0/2.0 
API.  (SL4A is implementing the Locale 0.5 beta API which was deprecated 2 
years ago).

Locale has an advanced configuration control mechanism, which has allowed us to 
remotely push out a configuration file to temporarily fix this issue for Locale 
users.  Within 24 hours, it will no longer be possible
 to reproduce this error.  But this is only a temporary solution and SL4A ultimately needs a code change to resolve this issue.

The change needs to be made in LocaleReceiver.java.  Specifically, this line: 
String scriptName = intent.getStringExtra(Constants.EXTRA_SCRIPT_NAME);

needs to be changed to:
String scriptName = 
intent.getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE).getString(C
onstants.EXTRA_SCRIPT_NAME));

The difference is that the plug-in extras are sub-bundled inside EXTRA_BUNDLE.  
This change will be compatible with Locale 1.0, Locale 2.0, as well as other 
hosts of the Locale Developer Platform.

While this change is being made, I would recommend bringing this 
BroadcastReceiver up to date with the latest Locale plug-in examples at 
<http://www.twofortyfouram.com/developer.html>.  There are a number of security 
flaws in SL4A's LocaleReceiver.java, and looking at our examples would be the 
easiest way to fix them.  For example, the SL4A receiver is susceptible to this 
<http://code.google.com/p/android/issues/detail?id=16006>.

Original comment by supp...@twofortyfouram.com on 9 Nov 2011 at 6:17

GoogleCodeExporter commented 9 years ago
Great work by the Locale folks, but we still have a bug, and apparently a 
security issue here as well.

Original comment by margaret...@gmail.com on 9 Nov 2011 at 6:42

GoogleCodeExporter commented 9 years ago
Locale folks,
Thank you so much for your assistance on this. I confirm the temporary fix 
works! Awesome.

Original comment by jamil.masarweh on 10 Nov 2011 at 3:37

GoogleCodeExporter commented 9 years ago
It would be really great if we could get somebody with committer access to pick 
up this one-line change...low hanging fruit here. 

Original comment by margaret...@gmail.com on 10 Nov 2011 at 4:02

GoogleCodeExporter commented 9 years ago
Updated Locale committed in sl4aR5x02

Original comment by rjmatthews62 on 19 Nov 2011 at 3:50