Proguard, Minify, and stacktrace - Android Studio

I am getting an "Unfortunately Has Stopped" message in my release version that does not occur in the debug version. This happens both on my S4 mini and on the Samsung RTL devices. The debug version works on all of these devices plus on the Genymotion emulators. The error occurs using Jsoup when i tap my menu choice which activates Jsoup.connect.
So far i have determined that the problem is most likely caused by ProGuard, in the minify process. The release program does run if i set minifyEnabled to false but i would prefer to un-apply it just where necessary. So i need to know a few things ...
1. what is the syntax for the proguard statement to eliminate org.jsoup.* from being minified
2. which file is this statement to be added to, proguard-android.txt or proguard-rules.pro
3. how do i initiate a stack trace? It must be simple but my searches have not turned up a step by step procedure for this. I believe that with a stack trace i could identify which specific Jsoup modules need to be eliminated from minify rather than minifying the complete lib
It seems that these are very basic questions. Virtually every post that i have read on these subjects assumes that you know these things. Hope you can help.
Mick

OK, making a little progress.
Found this example -keep class org.joda.time. { ; }** so I substituted jsoup in place of joda, put it into the proguard-rules.pro file and my release build now runs
I found the -s or --stacktrace option and where to set it in the IDE. However I am lost about where to find the actual stacktrace when I run the program. I would appreciate any help i can get on how to get a stack trace, especially while running a release version of the program

Related

[Q] CM7 + openvpn errors, what's wrong?

Greetings, I'm running a fresh flash of CM7 (final) and I'm using the built-in VPN menus (not the openvpn build off of the market or it's settings apk).
Using either tap or tun (I've flipped the server to either), I get the following error from logcat:
Code:
read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
I had this working in 6.1 and copied my same settings over, recreated the p12 file from the existing crts and keys (which I saved) and no dice. I even reverted to my nandroid backup of 6.1 to try it and make sure it wasn't blocked on the network or the server was bad and it would work so it's something in my 7.0 setup.
I saw that there was a bug for 7.0 submitted and it looks like support does exist in the stock CM kernel (I don't recall pushing tun.ko for 6.1, but it's very possible, I could revert one more time and check), so I don't think i need to recompile it (as noted here) specifically to acquire the module. Last, looking at the openvpn/CM wiki entry, I see an entry pertaining to this very error that seems to allude to a problem with the tun module (and I see an entry in the CM bug tracker about it as well), but when confronted with evidence that it's working in the file version, I'm again at a loss.
Any ideas (or any other information I should provide)?

Open Source CM10.1 for Dell Streak 7 continuation

First you need to have giveen's original port installed: http://goo.im/devs/giveen/jellystreak (via the old thread: http://forum.xda-developers.com/showthread.php?t=2130081). The most important thing this does is installing the TWRP "recovery" bootmenu thingy. You can use it when powering on/restarting the dell streak 7 and then keeping power+volup pressed and then choosing "install update from sdcard" or so.
With AOKP there is one install image that wipes /system and an ota update. I have not tested the ota update.
Download for the AOKP 4.2 build for the Dell Streak 7: http://w3studi.informatik.uni-stuttgart.de/~haagch/aokp/
The non-ota update wipes /system. So you have to reinstall gapps every time too, preferably before rebooting (android deletes settings for apps that are not installed I think).
The "official" gapps package uses neon instructions that don't work on tegra2. You'll see the keyboard, tts, etc. crashing all the time. "tonyp" has created a gapps package that uses "old" libraries that work without neon instructions. So you should use this instead of the official gapps:
Download for non-neon gapps: http://goo.im/devs/tonyp/non-neon-gapps
Gesture typing on the keyboard doesn't seem to work for me, but tts works and it doesn't seem to be crashing.
Known issues for me:
[*]sensors don't work: rotation, accelerometer, gps (I think), magnet field (Sensor driver is sensors.p3.so for now, maybe later giveen gets open source drivers to work)
headphone jack doesn't mute/transfer for some headsets like ones with built in microphones
bluetooth keyboard
Performance problems. Especially when the ram gets full. You can use a ram manager like https://play.google.com/store/apps/details?id=com.jrummy.apps.memory.manager with the Aggressive or Extreme preset to make that problem go away with the cost of background apps being killed very quickly.
Here is the repository: https://github.com/ChristophHaag/android_device_dell_streak7
And here is how to build it on Archlinux:
AOKP: https://gist.github.com/ChristophHaag/6334554
Cyanogenmod: https://gist.github.com/ChristophHaag/6078249
I'm new to android but maybe some other people know something, so I post whatever I come about. Maybe someone else wants to get started too and finds this helpful.
If you want to engage in bug finding and fixing yourself:
Remote debugging c works like this:
On the android device you do
Code:
gdbserver --remote-debug :5039 --attach 1
Which will attach gdbserver to the process with pid 1 and listen on port 5039 on all interfaces.
For a gui debugger I tried nemiver:
For $ANDROID I use the path where the cyanogenmod was checked out.
Code:
nemiver --remote=<STREAK7-IP>:5039 --gdb-binary=$ANDROID/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gdb --solib-prefix=$ANDROID/android/system/out/target/product/streak7/symbols/ $ANDROID/android/system/out/target/product/streak7/symbols/init
And in edit-preferences for sources I added some paths like symbols/, symbols/system/lib and the android/system directory.
There's also a statically compiled gdb that you can use over ssh or so: http://dan.drown.org/android/howto/gdb.html
Obsolete first look into the CyanogenMod adb bug:
I think the problem is in line 1068 in init.c
Code:
if (!action_queue_empty() || cur_action)
timeout = 0;
each time I looked when it comes there the cur_action->name was "property:sys.usb.config=none".
Maybe it is connected with the adb issue. When I googled for the
Code:
E/UsbDebuggingManager( 367): Communication error:
E/UsbDebuggingManager( 367): java.io.IOException: No such file or directory
E/UsbDebuggingManager( 367): at android.net.LocalSocketImpl.connectLocal(Native Method)
E/UsbDebuggingManager( 367): at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:238)
E/UsbDebuggingManager( 367): at android.net.LocalSocket.connect(LocalSocket.java:108)
E/UsbDebuggingManager( 367): at com.android.server.usb.UsbDebuggingManager.listenToSocket(UsbDebuggingManager.java:79)
E/UsbDebuggingManager( 367): at com.android.server.usb.UsbDebuggingManager.run(UsbDebuggingManager.java:115)
E/UsbDebuggingManager( 367): at java.lang.Thread.run(Thread.java:856)
issue I found surprisingly many people having issues with this, but few answers.
But I also found e.g. this: https://gist.github.com/steven676/5...c-remove-obsolete-ro.debuggable-1-trigg.patch
so the problem may be in https://github.com/ChristophHaag/an...lob/master/prebuilts/root/init.streak7.usb.rc
but I didn't have time to really read documentation to that.
I think this file complements $ANDROID/system/core/rootdir/init.usb.rc
I'll either play around with that or I'll add debug output in android.net.LocalSocketImpl.connect(LocalSocketImpl.java:238)
Code:
connectLocal(fd, address.getName(), address.getNamespace().getId());
Then I would at least know what it's trying to do and it would get easier.
Many of the results I saw from googling mentioned that it might have to do with netd.
On the streak 7 I get this:
Code:
cat /dev/socket/netd
cat: can't open '/dev/socket/netd': No such device or address
I'm not sure if this is how it should behave...
An observation is that adbd run from a command line seems to start without an issue and listens on a port specified with
Code:
setprop service.adb.tcp.port 5555
but the access over adb connect <STREAK7-IP> does only say "unauthorized". And "start adbd" does nothing. None of the programs seem to have --help or -h, so I have to look closer into whether they can be started directly.
I'll change "[ro.adb.secure]: [1]" in /default.prop to 0 and see whether that does anything.
In the other thread from giveen I said that I don't see the log spam. This was with debugging in the developer settings disabled. When I enable it, the logspam starts. But whether it is enabled or not, init still eats 100% cpu. The trouble with the debugging is that each time it is enabled and I want to disable it, the streak 7 immediately reboots.
Now that I had logcat via ssh running I caught this when the reboot happened:
Code:
W/dalvikvm( 367): threadid=50: thread exiting with uncaught exception (group=0x40b0e930)
E/AndroidRuntime( 367): *** FATAL EXCEPTION IN SYSTEM PROCESS: UsbDebuggingHandler
E/AndroidRuntime( 367): java.lang.NullPointerException
E/AndroidRuntime( 367): at com.android.server.usb.UsbDebuggingManager.closeSocket(UsbDebuggingManager.java:125)
E/AndroidRuntime( 367): at com.android.server.usb.UsbDebuggingManager.access$200(UsbDebuggingManager.java:46)
E/AndroidRuntime( 367): at com.android.server.usb.UsbDebuggingManager$UsbDebuggingHandler.handleMessage(UsbDebuggingManager.java:177)
E/AndroidRuntime( 367): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 367): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 367): at android.os.HandlerThread.run(HandlerThread.java:60)
Looks bad.
For looking at the android code I just use grep and ls with globbing for the c and config files and for the java part I imported it in eclipse via this method: http://source.android.com/source/using-eclipse.html
This is a build I haven't tested yet: http://w3studi.informatik.uni-stuttgart.de/~haagch/cm-10.1-20130820-UNOFFICIAL-streak7.zip
This is giveen's original nvflash that I am not sure I am allowed to put there as giveen has not put any license information in there: http://w3studi.informatik.uni-stuttgart.de/~haagch/JB_Beta2.1.zip But then it's all apache code and there are no notices in reagards to the apache license or changed files anyway. If not, you can just tell me and I'll remove it.
------------------------------------------------
So the call to connectLocal() that throws the exception has as parameters
fd: FileDescriptor[263]
address namespace: RESERVED with address name space id: 1 and address name: adbd
That doesn't help me much yet, but there are frequent calls with FileDescriptor[263] and namespace RESERVED, id 1, name rild (radio service) that don't throw an exception.
So it's a "valid" file descriptor... But I think the problem is still that adbd is not started by init...
The whole UsbDebuggingManager.run method is
Code:
public void run() {
while (mAdbEnabled) {
try {
listenToSocket();
} catch (Exception e) {
/* Don't loop too fast if adbd dies, before init restarts it */
SystemClock.sleep(1000);
}
}
}
where listeToSocket() is ultimately throwing the exception.
I have also read a bit about how adbd is supposed to work. Apparently in android 4.2.2 they introduced rsa encryption. It looks very similar to ssh. You have your authorized public keys on the device in /data/misc/adb/adb_keys (like ~/ssh/authorized_keys) and on your computer you have your public key in ~/.android/adbkey.pub
So I put my ~/.android/adbkey.pub in /data/misc/adb/adb_keys on the streak 7 and started adbd from the command line on the device. And indeed, when I connect with "adb connect <STREAK7-IP>" I get "<STREAK7-IP>:5555 device product:cm_streak7 model:Streak_7 device:streak7" with "adb devices -l" and adb shell works. It's a bit unrelated, but this applies: https://code.google.com/p/android/issues/detail?id=48126
But the actually important part, the "start adbd" still doesn't do anything.
It really must be somethin with /init.streak7.usb.rc. The stuff in /sys/class/android_usb/android0/ seem to be set all wrong...
------------------------------------------------
I'll just keep posting random things I discover that I find strange or interesting and if anyone knows anything about any of those, they can just chime in.
In /init.streak7.usb.rc there is the line
Code:
write /sys/class/android_usb/android0/iProduct $ro.product.model
"getprop ro.product.model" says "Streak 7" but /sys/class/android_usb/android0/iProduct apparently doesn't seem to be able to take a string with a space because "cat /sys/class/android_usb/android0/iProduct" returns "Streak". You can write directly to it with "cat "Streak 7" > /sys/class/android_usb/android0/iProduct" but it only saves up to the space. I don't think that's really a problem but strange anyway.
I have googled for another tegra 2 device and looked at its usb init rc: https://raw.github.com/CyanogenMod/android_device_samsung_p4-common/ics/init.p3.usb.rc
Adding a section with on property:sys.usb.config=adb did nothing and it seems I haven't been able to google what should be in /sys/class/android_usb/android0/idProduct for the streak 7.
I think I'll just look into how init on android works and how the triggers work. Then it shouldn't be too hard to figure out what exactly it is trying to do and why it is failing.
------------------------------------------------
I was trying to get my head around why "getprop sys.usb.config" would always return "none" and the system wouldn't respond to "setprop sys.usb.config adb,mtp" in any way. So I got to suspect that /init.streak7.usb.rc was not used at all. Then I compared the imports and found that /init.streak7.rc did use a relative path for /init.streak7.usb.rc while all the other init*.rc were using absolute paths.
So I'm not sure if it this is really the thing that fixed it, but it's the latest thing I tested and now init's 100% cpu and adb are fixed: https://github.com/ChristophHaag/an...mmit/eee0625e11cfafd510c3bada6ae67a133766c0f4
Edit: Wait, it happened again. Maybe not. :/
Hm, no, definitely not it. Can't even reproduce it. It worked after adb sideload and wiping the cache and the dalvik cache.
At least it's clear now that init's 100% cpu usage and adb not working and the dalvik crash when disabling debugging are all the same issue.
Good luck. I'll give you a hint as a parting gift. The USB issue is not kernel related.
I really dont care to licenses anything so you are free to do with as you will. Personally, I will continue to develop in private and if there are kernel changes, as per the GPL, I will make those updates available.
[moved to hidden section in first post]
[moved to hidden section in first post]
[moved to hidden section in first post]
If you really want to help, let me know. I'll let you in on my secret.
giveen said:
If you really want to help, let me know. I'll let you in on my secret.
Click to expand...
Click to collapse
Do I want to help? Does this thread look like I don't?
As I've said I'm new to the android code so I'm not really sure what I'm doing yet.
After rebooting with debugging enabled and adb sideloading an image it works for some reason (until you disable debugging in the developer settings, then it loops on sys.usb.config=none again) but it's all clearly not like intended by /init.streak7.usb.rc. /sys/class/android_usb/android0/idVendor is 18d1 and android_usb/android0/idProduct is d002 which is set in init.usb.rc for on property:sys.usb.config=adb...? I just don't get it yet. The init readme says declaring an action or service twice is an error but this is from upstream, so adb is supposed to always be 18d1:d002?
So if you know something I don't I would obviously greatly appreciate it if you told us. In fact you can directly push to the repository now if you wish to do so.
ccxxx said:
Do I want to help? Does this thread look like I don't?
As I've said I'm new to the android code so I'm not really sure what I'm doing yet.
After rebooting with debugging enabled and adb sideloading an image it works for some reason (until you disable debugging in the developer settings, then it loops on sys.usb.config=none again) but it's all clearly not like intended by /init.streak7.usb.rc. /sys/class/android_usb/android0/idVendor is 18d1 and android_usb/android0/idProduct is d002 which is set in init.usb.rc for on property:sys.usb.config=adb...? I just don't get it yet. The init readme says declaring an action or service twice is an error but this is from upstream, so adb is supposed to always be 18d1:d002?
So if you know something I don't I would obviously greatly appreciate it if you told us. In fact you can directly push to the repository now if you wish to do so.
Click to expand...
Click to collapse
The problem is CM.
I switched to AOKP which is close to Google's AOSP, and the problem solved itself. Something in the way USBManager is programmed in CM screwed things.
I got around to download aokp today.
The build system is slightly different, but easy enough to set up. I first just did an "update" to it, but the adb/init problem persisted, acore kept crashing (but deleting data for the contacts app "solved" that).
So I decided to finally make a factory reset. Not really sure what happens there, but that didn't delete the apps in /system/apps I think so I just wiped everything except sdcard etc. with twrp and installed the image again. This time it works better it seems. adb seems ok for now, cpu usage is okay.
The 4.2.2. google apps for that are these: http://goo.im/gapps/gapps-jb-20130812-signed.zip
Now I'm not sure: Would a factory reset/complete reinstall have helped with cyanogenmod too?
aokp is missing a few features cyanogenmod has, most notably the performance settings where you can overclock and set up zram with the gui.
Keyboard still crashes. Not really surprising that illegal instruction hasn't changed.
There doesn't seem to be recent apps when long pressing the home button. Strange.
Not sure how much I like it yet and whether I'd rather use cyanogenmod.
Here it is: http://w3studi.informatik.uni-stuttgart.de/~haagch/aokp_streak7_unofficial_2013-08-23.zip
Thanks, giveen.
No problem. AOSP keyboard burns RAM like nothing else. If you switch to an 3rd party keyboard , you will no longer crash. This problem is common on a lot of low memory devices. ZRAM doesn't really work. I have a script that I want to test out that DJ_Steve had originally wrote. Also, I will send you the sensor files you need to modify to get them to work.
google has this keyboard in the play store https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin and I got it from http://dl.androidnext.de/com.google.android.inputmethod.latin.apk. Works ok, but has issues like you can't disable the "ducking" blocking of "offensive" words...
The sensors changes you commited work well. Rotation/acceleration/magnet/light seem to react normally.
It's almost usable now.
For people building it from source: If you get a weird error like "ERROR: couldn't find <type 'property'> in build.prop" and can't find anything useful with google... I deleted out/* and did a complete rebuild and then it worked.
Plugging in a headset still doesn't turn off speakers but it seems only like a minor issue since it seems to be detected just fine:
Code:
V/WiredAccessoryManager( 374): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=1, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=2006, ACTION=change, SWITCH_NAME=h2w}
V/WiredAccessoryManager( 374): newName=h2w newState=1 headsetState=1 prev headsetState=0
W/AudioPolicyManagerBase( 103): checkOutputsForDevice(): No output available for device 0004
V/WiredAccessoryManager( 374): device h2w connected
Google tts is crashing like the keyboard (
Code:
F/libc ( 6525): Fatal signal 4 (SIGILL) at 0x5dc80738 (code=1), thread 6525 (gle.android.tts)
) but pico tts seems to work, at least with english.
A Google search gave me this:
http://stackoverflow.com/questions/7102606/sigill-in-android-ndk-code/7104177#7104177
And further this might be worth looking into: http://forum.xda-developers.com/showthread.php?t=2186251
Not sure whether it's simply neon instructions or register usage of 16+ since I haven't looked that close into the build system yet. But probably ILL_ILLOPC means it's a neon instruction.
So sensors work now? I've been at that for months and I wasn't sure if I got it right. If I got it right, that was months of work there that I wasn't even sure was going to work.
Headphones and microphones need to be adjusted in mixer_paths.xml
Months of untested work that just works? Impossible! :good:
I haven't done a really thorough test, but they all seem to be doing something. https://play.google.com/store/apps/details?id=imoblife.androidsensorbox seems to have a little problem with the directions with the rotated screen though. But in general it all does something that seems related to what I do to the device.
The AKM8973. is a chip that is normally found on qualcomm devices. So I had to track down the right HAL and then modify to work with Tegra sword ices. It's a terrible hack/slash, modify and pray it works job. I had Just finished. Does the screen rotate?
giveen said:
The AKM8973. is a chip that is normally found on qualcomm devices. So I had to track down the right HAL and then modify to work with Tegra sword ices. It's a terrible hack/slash, modify and pray it works job. I had Just finished. Does the screen rotate?
Click to expand...
Click to collapse
Yes, the screen rotates. And even more impressively, it rotates correctly!
Good. Now i can focus my energy on the camera.
Hm, having difficulty with my compiles booting. Chris, if you compile and upload the zip, I can give you my goo.im information and you can push it as an auto-update. Don't forget to include your name in there somewhere for credit as well as you are now part of the team.
giveen said:
Hm, having difficulty with my compiles booting. Chris, if you compile and upload the zip, I can give you my goo.im information and you can push it as an auto-update.
Click to expand...
Click to collapse
I have edited my first post.
http://w3studi.informatik.uni-stuttgart.de/~haagch/aokp_streak7_unofficial_2013-08-25.zip
http://w3studi.informatik.uni-stuttgart.de/~haagch/aokp_streak7-ota-eng.c-builder.zip
giveen said:
Don't forget to include your name in there somewhere for credit as well as you are now part of the team.
Click to expand...
Click to collapse
Yea, maybe if I contribute something substantial instead of cosmetic changes.
OH yeah, bluetooth keyboard, I see that as one of your issues. I'll upload a bunch of idc files that should at least address that issue, not sure though.
Are you missing any commits? I noticed your update has sensor working but my build does not.

Xposed FAQ / Known issues

Where can I find general information on Xposed, e.g. how to install it?
In this thread.
Does this require root access?
Yes, because it replaces a file in /system/bin. Once the framework is installed, it should work without root access.
For which devices/ROMs does it work?
I develop the Xposed framework based on the AOSP sources. I'm personally using CM10.2 on an I9100 (Samsung Galaxy S2, bought in Germany). Basically, it should work on any phone which with a ROM based on Android 4.0 or later and an ARM or x86 processor (this is the processor architecture, almost all smart phones and tablets have either of those). Exceptions might be ROMs which are different from the original Android code in some very internal, central code parts (which don't need to be touched for most theming and enhancement modifications). But this is related to the ROM, not the phone itself.
The modules target higher-level code, so they are more likely to be incompatible with your ROM. Basically, the question is whether the methods and resources which the module modifies are similar on your ROM and on the developer's ROM. Let's say a module needs to modify the result of a certain method call. For this, it needs to specify the exact name and parameters that identify that method. If the in your ROM, an additional parameter has been added, the module can't find the method anymore and won't work. If the method can still be found, it will probably work (unless the rest of the app/ROM has changed too much).
There is not definite answer whether it will work. Just try it (of course, making a nandroid backup before is never a bad idea). If it doesn't work, just disable the module. You might want to inform the module developer (not me!) about this fact and provide details (e.g. a logcat and/or the content of /data/data/de.robv.android.xposed.installer/log/debug.log).
What about Gingerbread? Or any other Android version before 4.0.3?
An experimental version for Gingerbread made by liudongmiao can be found here: http://forum.xda-developers.com/xposed/-t2739034.
Note that I cannot give any support for it, please direct your feedback to @liudongmiao.
Are there known incompatibilities?
There seem to be issues with AOKP nightlies. For more details, please read this post.
There seem to be issues (bootloops) with the Oppo Framework, I don't have a fix yet.
On some HTC One phones with CM11, the System UI force crashes. This seems to be caused by SELinux restrictions. Executing "restorecon /system/bin/app_process" (as root, e.g. with adb shell) should help against the FCs, but Xposed might not work due to other SELinux restrictions. If you have the possibility to disable SELinux enforcing mode, you can try that.
If you are an SELinux expert and would like to help, please contact me.
Apart from that, obviously it won't work if the conditions mention above aren't met, e.g. if your phone isn't rooted or it is running on a pre-ICS ROM.
How can I install it?
See the first post. The framework installation needs to be done only once (and on updates), then it can be used for any modules.
Does Xposed get disabled if I flash a new ROM?
Yes, because the file it modifies, /system/bin/app_process, is part of every ROM and will be overwritten when you flash a ROM. However, as long as you don't wipe data, the Xposed Installer app will still be installed, so you can just click on "install/update" again in the Framework section and reboot.
For CyanogenMod-based ROMs, there is an easy solution: [1] and [2]. This will reactivate Xposed automatically after you flash a new ROM/nightly.
For other ROMs, you can try this one. Be careful, it will disable Xposed again if you flash it twice!
Isn't this insecure?
In a way, yes. With great power comes great risk. On the other hand, other ways of modifying your phone are also open to malicious coding. For more details see this post.
Why do I have to enable a module after installing it? Couldn't you skip this additional step?
This is for security reasons (see the question above). By making you confirm that you want to use a module, apps cannot contain hidden Xposed modules. The same could be done with an additional permission, but I'm not sure if everyone would recognize that and it is harder to implement. As a bonus, this toggle allows you to temporarily disable a modification or to ship an app that contains an optional Xposed module.
How do I develop my own modification using the Xposed framework?
First make sure that Xposed is working fine for you. Then read this extensive tutorial.
Why isn't the Xposed Installer available via Play Store?
I have several reasons for that. I wrote about it in this post. And as I learned, Google does indeed sometimes remove apps which interfere with other apps.
From my point of view, you are free to publish the modules you develop on Play Store (at your own risk - Google might remove them). However, be careful if you plan to get money from them. Paid apps are stored in encrypted containers, which means Xposed can't load them at boot time.
Where can I donate some money to support you?
http://repo.xposed.info/donate
Am I allowed to fork Xposed and publish my own version? What should I consider?
I have written this down in a separate post: http://forum.xda-developers.com/showpost.php?p=46325320&postcount=4372
Can I include Xposed in my ROM?
First of all: One reason why I developed Xposed was to avoid the need to flash anything just for a few small changes. So Xposed is designed to work on top of ROMs, not as a part of them.
That said, I don't forbid you to include it. Here are the conditions:
I won't support you in the process of including it. You'll have to figure out the best way to do it yourself. The easiest way (which will also cause the least problems) is probably to simply put the installer and the modules into /system/app, then your users just need to click the "install/update" button, activate the modules they want and reboot.
There might be ways to really pre-install Xposed so that it's working out of the box, but I don't recommend that. You have to be very careful about file permissions, so there is a good chance it won't work. Again, absolutely no support for this.
I won't support your users with problems which might have been caused by using the included version instead of installing it normally.
When your users report problems which are probably not related to including Xposed in the ROM, please try to give them some support yourself. If you can't find a solution, send them to the correct help thread. For example, this thread is only for the framework. Not for any modules, not even my own.
I expect you to include the latest versions, which are usually the ones working best. I won't support older versions.
Your users must be able to update to the latest version, preferably without installing a new version of your ROM. Again, I won't support older versions.
From the previous point, it follows that you need to include the original APKs, otherwise updating is not possible due to a certificate mismatch. This is even more important since updates are possible from within the app. It also avoids confusion, like users wanting support for any modifications you might have made.
You probably want to include some modules. There are many modules that are not written by myself. Therefore, you need to get permission from the module authors as well. For modules written by myself, the same conditions which you are just reading apply.
Please give proper credit (which includes a link to this thread for the framework). Don't sell it as your own work.
You might have the impression now that I'm not a big fan of including Xposed in a ROM. This impression is correct. It's not too hard to install Xposed and any attempts to pre-install Xposed will just cause additonal support requests.
Why don't you just recommend Xposed in your ROM thread, along with the place where they can download it (this thread) and some instructions how to get the most out of it for your ROM? Give your users some choice!
The following posts list known, confirmed issues of the Xposed framework/installer. The intention is to give more information about the symptoms, the background and possible solutions/workarounds.
I won't add every reported issue here, but only when it's clear (e.g. through analyzed logs) that the problem is indeed an incompatibility with Xposed. It doesn't include module issues and the inability to read and follow instructions.
In case you have found a solution/workaround for one of the issues, please let me know.
ART / Android L / Android Lollipop / Android 5.0
Symptom:
You want to use Xposed and ART. However, as soon as you install Xposed, the runtime is reverted back to Dalvik.
Or you want to install Xposed on Android L, but it displays a message that it's not compatible.
Background:
There is no Xposed support for ART (yet), therefore Xposed automatically reverts the runtime to Dalvik. You can be glad that I implemented this, otherwise you would end up in a bootloop. It's a completely different architecture with pretty much no documentation. Rewriting Xposed for the ART runtime requires understanding the concept, the code structure and many details to know how it works. I have already spent dozens of hours on that and some things are working. But still it's a long way ahead. Don't expect even a test version in the near future. So please don't ask when it will be available - you will surely know when it is ready. I have nothing else to say about that.
Update: ART might be become the default runtime environment in the next Android version. You can read my thoughts about this here.
Update 2: The Android L developer preview is out. Don't try to install Xposed on this ROM! Check here for some explanations and status: http://forum.xda-developers.com/xposed/android-l-support-t2797923
Update 3: An alpha version for Lollipop is available now: http://forum.xda-developers.com/xposed/official-xposed-lollipop-t3030118
Square Enix games (e.g. Final Fantasy) / Puzzles & Dragons
Symptom:
If you have activated Xposed and any module, some Square Enix games (e.g. Final Fantasy) and Puzzles & Dragons don't start anymore.
Background:
I have spent several hours analyzing this issue. Here are my findings: http://forum.xda-developers.com/showpost.php?p=42331031&postcount=1701
Solution:
I don't think I will be able to fix this. Some users reported that it's working after converting Xposed and modules to system apps (but I didn't test it and you have to do this after every update).
Otherwise, you could press the "uninstall" button in the Xposed Installer, reboot, play the game, afterwards press the "install/update" button and reboot again.
Aliyun OS
Symptom:
You experience bootloops after installing Xposed and you find files like /system/framework/core.jex. Typical devices where this happens are THL T100S (with a MediaTek MT6592 processor), THL W200S, CUBOT X6, several ones from Zopo, ...
Background:
These devices ship with ROMs that are based on an incompatible Android fork called "Aliyun OS". These ROMs have a proprietary ahead-of-time compiler called "jazz, which is incompatible with Xposed.
Solution:
No chance of fixing this within Xposed. It was reported that deodexing the ROM and then deleting the /system/framework/*.jex files helps, however you won't get any support for this in the Xposed subforum.
Another possibility might be to disable the JIT compiler by adding "dalvik.vm.execution-mode=int:fast" to /system/build.prop or /data/local.prop (might have an impact on performance). See https://github.com/rovo89/Xposed/issues/14 for details.
MIUI/Dexspy
Symptom:
You experience bootloops after installing Xposed on MIUI. There are references to "Dexspy" in /system/bin/app_process and /system/framework/*.
Background:
There are modified versions of Xposed that have been integrated into some MIUI ROMs. I don't know the details, I don't know if that's still the case for current ROMs, and I don't have the time to follow up on this.
Solution:
Sorry, but I can't support you with this. MIUI is closed-source and in some parts heavily modified from AOSP. I don't have the time to keep track of their changes, and due to some bad handling from their side in the past (forking Xposed without any credit, removing all references to the original project and myself), I'm not very motivated to do so. If you're lucky, Xposed might work on your MIUI ROM. If it doesn't, you'll have to find someone else to look into it. If someone creates a clean patch that doesn't break Xposed on other ROMs, we can talk about including it, but otherwise you'll have to decide between MIUI and Xposed.
Segmentation fault
Symptom:
During the framework installation, you get messages that contain "Segmentation fault". This usually happens on ICS ROMs.
Background:
For some reason, the BusyBox binary that comes with Xposed doesn't work with your ROM.
Solution:
Install the attached app, it contains BusyBox binaries which are compiled with different settings, with all dependencies included in the file. Due to this, the incompatibilities should be gone. These files aren't included by default because they are much larger and not needed by most users.
Resources subclass
Symptom:
You can install Xposed 2.6+ and your phone is still booting afterwards. The version numbers are shown in green in the framework section. However, no modules are working. In the Xposed error log, you find a message like:
Code:
java.lang.ClassCastException: class android.content.res.XResources doesn't extend class x.y.z
You might have a ROM from Huawei, Nubia, ...
Background:
These ROMs use a similar approach as Xposed to theme resources. They create a subclass of Resources which takes care of special handling and return an instances of it from getTopLevelResources(). If Xposed replaced this class with its own XResources implementation, then it would a) break the ROM's additional functionality and b) probably cause crashes if the ROM tries to use this functionality.
Solution:
As a workaround, you can simply disable the resources API in the Xposed Installer settings. Some modules won't work anymore, but most should still work.
Mid-term, I hope that I can build a solution that works with such ROMs as well, however it will take some time.
Huge log file
Symptom:
Your disk space is getting low and you find out that much of it is taken up by Xposed Installer (sometimes several 100 MB). You think that this is a bug in Xposed.
Background:
It's most likely not a bug in the Xposed framework, but a bug or incompatibility of a module. One reason might be the removal of a hack in Xposed 2.6. That hack had a side-effect that some modules relied upon. The might also be other issues, for example the module might simple not be made for your ROM.
In any case, such modules might run into errors frequently and log each of them, causing the huge log files.
Solution:
First, find out which module is causing this. You can check the log file in the Xposed Installer. Somewhere near the top of the exception call stacks (beginning with "at ..."), you can usually find the package name of the module that caused it.
Next, make sure that the module is updated. To be on the safe side, you should update all modules. Then you can clear the log file and reboot.
If there are still issues, please go to the support thread of the module. Check if your ROM is supported and whether somebody else has already reported the issues. If not, post your error.log there and ask the developer to have a look at it.

[ROM][LINK] Sailfish OS Droid 4 maserati

I DID NOT MAKE THIS ROM!!!!!! - A developer by the name of TheKit made this rom, so do not give me any credit for this rom, give it all to them.
I am simply linking it because I love this phone, I love Sailfish OS on it, and I think a lot of people would enjoy Sailfish OS on it as well and just don't know it is available.
Q: "What is Sailfish OS and why should I use it?"
A: Sailfish OS is a great OS for many reasons. Having used multiple android roms I can attest to the fact that:
1. It has MUCH better battery life (however it has a weird battery read bug, see issues below)
2. It is MUCH faster and generally more stable when it comes to the things that work (your calls won't drop, your system won't lock up due to lack of ram, etc.)
3. It has a great gesture driven UI that is a joy to use and very gorgeous to look at. No more of this all white bull**** Google has been forcing down our throats since 2014
Q: "How good is the battery life?
A: After a day of playing cave story at work and reading discord and listening to music, I am at about 30-40% end of day (I start at 8:30AM, stop at 4:00PM)
Okay now that the Q/A segment is over, lets get to the real meat
ISSUES
1. Battery Read is wonky, it only goes in 10% increments until it reaches 20%, then it starts going in 5% increments
2. If you use the 2.1.3.7 build keyboard backlight is broken, but it works fine on the 2.1.0.11 build
3. Bluetooth is wonky, I was able to play audio through speakers in the 2.1.3.7 build...
4. FM Radio is broken too
5. As the maemo-talk thread says, CDMA is untested, and like on Photon Q, most likely does not work. GSM works great though! :good:
6. The old 2.1.0.11 build has a slew of issues compared to the new 2.1.3.7 build. These include data not working out of box, wifi requiring a reboot to work, and auto rotation not working in a majority of apps by default. Consult this thread and the maemo talk thread for more help, and if you want rotation anywhere, install patchmanager 2.0 and auto rotate anywhere from warehouse for sailfish os.
Alien Dalvik install tutorial
I did not make this and do not know who did. the developer claims someone threw a brick at them with an sd card attached. The sdcard contained links to these files in the form of a text file names "monkeyAIDS.txt"
https://drive.google.com/file/d/1mS6di1jYfVeDoFBjcANS6SmfkhGyEKoa/view - AD Jolla C (different from the Turing phone rpm, this is built for 3.1.x kernels)
http://sfos.scanf.su/maserati/alien-patched.tar.gz
So extract both files to your ~/ (home) directory and type in the following:
devel-su
[insert root password you set in settings]
zypper in [alien dalvik rpm]
rsync -a /home/nemo/alien/ /opt/alien/
ln -s /vendor /opt/alien/system/vendor
reboot
OPTIONAL: fix for the default 320PPI value
devel-su
[insert root password]
vim /opt/alien/system/build.prop
change ro.sf.lcd.density to the value of your choosing (Droid 4 is 256)
Keyboard Backlight Fix, works on 2.1.0.11, don't know about 2.1.3.7 -- Thank you @moodroid for this legendary patch!
On <2.1.3.7, I got the keyboard backlight to work by creating an /etc/mce/20backlight.ini with:
[KeyPad]
BrightnessDirectory=/sys/class/leds/keyboard-backlight
Then do 'pkcon install mce' and 'systemctl restart mce'.
Download Links
Here is the thread with the Download Link to the 2.1.0.11 build
https://talk.maemo.org/showthread.php?t=99031&page=9
If you don't mind a lack of keyboard backlight and want a more up to date build, grab the new and fabulous leaked 2.1.3.7 Build:
https://drive.google.com/file/d/1k3MOCrMvbFb114Omf0MzSvnQ7wBkTiWH/view?usp=sharing
Basically if you are fed up with how ****ty the latest Lineage OS builds are and just want to try something new, give this a try. Why not? What have you got to lose. All in all great work by TheKit and I am very happy with the port as it is and I think you will be too.
Hi,
On <2.1.3.7, I got the keyboard backlight to work by creating an /etc/mce/20backlight.ini with:
[KeyPad]
BrightnessDirectory=/sys/class/leds/keyboard-backlight
Then doing 'pkcon install mce' and 'systemctl restart mce'.
Hope you get the OK to share your AD success!
Thanks
moodroid said:
Hi,
On 2.1.3.7, I got the keyboard backlight to work by creating an /etc/mce/20backlight.ini with:
[KeyPad]
BrightnessDirectory=/sys/class/leds/keyboard-backlight
Then doing 'pkcon install mce' and 'systemctl restart mce'.
Hope you get the OK to share your AD success!
Thanks
Click to expand...
Click to collapse
dude you are a legend!
I would add that to the OP but you are first comment so anyone viewing the op will see this. I will definitely tell TheKit about this (then again, he gave you the 2.1.3.7 build so you can just tell them yourself)
Greetings,
I've been playing around with SailfishOS on my Droid 4 in the past few days, and I have a few questions about the whole thing. TheKit publicly shared a 2.1.3.7 build for the Droid 4 on his thread at Maemo, is that the one you are talking about or is it a different build? As someone mentioned this specific build seems to have issues with wifi, and I have the same problem. I can't post links, but the download link to the build I mentioned is on page 12.
The 2.1.0.11 build seems to work fairly well, however I wasn't able to install Alien Dalvik. After the installation the "Android Support" button does show up in the settings app, however nothing happens when I click the start button. I also attempted installing an apk both via the GUI (by clicking on it in the downloads) and via the command line by using "apkd-install", but it doesn't seem to work. Full log of the installation process attached.
I talked with TheKit, and the 2.1.3.7 build I mentioned (the one at page 12) is indeed outdated. He just updated the OP at Maemo and added the latest 2.1.3.7 build, which I just flashed and it's working great. Also installed Alien Dalvik following the instructions in the OP and it seems to be working fine as well! However I wasn't successful with the backlight fix method yet.
For anyone wondering how I flashed the latest build I went CM11 --> SailfishOS 2.1.0.11 --> SailfishOS 2.1.3.7 (rel2).
NIKKOS said:
I talked with TheKit, and the 2.1.3.7 build I mentioned (the one at page 12) is indeed outdated. He just updated the OP at Maemo and added the latest 2.1.3.7 build, which I just flashed and it's working great. Also installed Alien Dalvik following the instructions in the OP and it seems to be working fine as well! However I wasn't successful with the backlight fix method yet.
For anyone wondering how I flashed the latest build I went CM11 --> SailfishOS 2.1.0.11 --> SailfishOS 2.1.3.7 (rel2).
Click to expand...
Click to collapse
Hi Nikkos,
Sorry - that was me that posted the backlight fix, and I agree that it doesn't work on 2.1.3.7-rel2. It'd worked on every other version I tried, and I've now edited my post above. Glad everything is working.
Sorry again
moodroid said:
Hi Nikkos,
Sorry - that was me that posted the backlight fix, and I agree that it doesn't work on 2.1.3.7-rel2. It'd worked on every other version I tried, and I've now edited my post above. Glad everything is working.
Sorry again
Click to expand...
Click to collapse
No worries.
If anyone is wondering how to change the SailfishOS UI scale (I find the default one to be way too big) here's how I did it via the terminal:
Code:
devel-su
rm /etc/dconf/db/vendor.d/locks/silica-configs.txt
dconf write /desktop/sailfish/silica/theme_pixel_ratio value
I believe the default value should be around 1.1; you can also reset the value to stock with:
Code:
dconf reset /desktop/sailfish/silica/theme_pixel_ratio
or read the value with:
Code:
dconf read /desktop/sailfish/silica/theme_pixel_ratio
Not exactly droid 4 related, but thought I'd share.
Okay, I got the backlight to turn on!
Type the following in the terminal:
Code:
devel-su
echo 255 >/sys/class/leds/keyboard-backlight/brightness
It seems to properly react to some triggers like standby after being turned on but not to others like sliding the keyboard in and out (which means it will always stay on if the screen is on, regardless if it's been slided in or out). My assumption is that the keyboard sliding trigger got broken in some way, as I believe that's the way the backlight is being turned on. The events which trigger the backlight seem to be stored in the file /sys/class/leds/keyboard-backlight/trigger, so I assume that would be a good starting point to attempt fixing this.
The keyboard backlight intensity can also be changed, just change the 255 to a different value (it goes from 0 to 255).
Note: this change is not permanent, it will need to be applied again at reboot. Writing a script which executes the above commands at boot should be trivial though, and I will include instructions when I get it done myself.
EDIT:
Here's how to make the change permanent. Following these instructions you will create a Systemd service which will turn the backlight on when active and off when inactive; it will automatically run at boot and it can also be controlled like any other Systemd service (i.e. using systemctl via the terminal)
Type the following commands through the terminal:
Code:
devel-su
cd /etc/systemd/system
touch keyboard-backlight.service
chmod 744 keyboard-backlight.service
You will now need to edit the keyboard-backlight.service file with a text editor (either vim or nano will do, vim comes preinstalled, nano does not). Depending on your preferred text editor, type the following:
Code:
vim keyboard-backlight.service
or
Code:
nano keyboard-backlight.service
Now write the following to the file and save it:
Code:
[Unit]
Description=XT894 keyboard backlight service
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 255 >/sys/class/leds/keyboard-backlight/brightness"
ExecStop=/bin/sh -c "echo 0 >/sys/class/leds/keyboard-backlight/brightness"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Now type the following to enable the service:
Code:
systemctl enable keyboard-backlight.service
That's it. You can now control the service by using the following:
Code:
systemctl start keyboard-backlight //This will turn the backlight on
systemctl stop keyboard-backlight //This will turn the backlight off
systemctl status keyboard-backlight //This will display the service status
Can anyone share the google drive file from the first post? Is there an alternative link available? Or could you PM me a google drive link? Thanks!
Can anyone suggest the best/correct ROM-slot size for TWRP?
Is it still like for CM/LOS:
800MB for system
10MB for cache
and rest for data as one likes?

How to reverse a SELinux policy?

Trying to help a friend install an rclone pluing for Kodi, I found out that on my phone I needed to install this module https://github.com/galeksandrp/app-data-file-exec
The module worked and Kodi was able to run a binary in its data directory. Problem is my friend uses an Nvidia Shield and he wants to use official streaming apps too (Netflix, Prime Video, etc.). Rooting is consequently a no-no, otherwise those would fail to play at highest quality.
I've found a possible workaround but to test I need to reverse this policy:
allow * { app_data_file privapp_data_file } file { execute_no_trans }
Which is pretty much all that the module I installed does.
Uninstalling the module did not remove the policy. Kodi keeps on being able to execute the rclone binary. And I need to restore my system to how it was before that policy modification.
Any help? Thanks in advance!
Edit: while waiting for somebody knowledgeable enough I've been searching and searching. I've found this, from here: https://android.googlesource.com/platform/system/sepolicy/+/master/private/app_neverallows.te#58
Code:
# Block calling execve() on files in an apps home directory.
# This is a W^X violation (loading executable code from a writable
# home directory). For compatibility, allow for targetApi <= 28.
# b/112357170
neverallow {
all_untrusted_apps
-untrusted_app_25
-untrusted_app_27
-runas_app
} { app_data_file privapp_data_file }:file execute_no_trans;
But I am unsure how to proceed, since the module does not completely reverse the above, it's more targeted. I wouldn't want to create a situation where normal apps cannot work properly anymore.
gorman42 said:
Trying to help a friend install an rclone pluing for Kodi, I found out that on my phone I needed to install this module https://github.com/galeksandrp/app-data-file-exec
The module worked and Kodi was able to run a binary in its data directory. Problem is my friend uses an Nvidia Shield and he wants to use official streaming apps too (Netflix, Prime Video, etc.). Rooting is consequently a no-no, otherwise those would fail to play at highest quality.
I've found a possible workaround but to test I need to reverse this policy:
allow * { app_data_file privapp_data_file } file { execute_no_trans }
Which is pretty much all that the module I installed does.
Uninstalling the module did not remove the policy. Kodi keeps on being able to execute the rclone binary. And I need to restore my system to how it was before that policy modification.
Any help? Thanks in advance!
Click to expand...
Click to collapse
every custom allow (ie not compiled into the ROM) I apply on my phone, has to be reinstated on boot.
If you have root, its possible that it is being reinstated by something, on every boot. eitehr a Magisk script, a Magisk module or a rooted app.
However, when compiling ROMs, the opposite of "allow" is "deny". I have never tried to add a deny (or revert an allow), and it cant be done without root, so you are back where you started.
Sorry, I probably did not explain myself fully.
I have root and it's absolutely fine for me to keep root on this device. Withouth that policy my rooted device was behaving the same way as Nvidia Shield TV. And I simply want to restore it to the way it was.
This is why I linked to the module, because to me it seems that it simply issues the command I pasted here. But maybe I am missing something. I have unistalled it, I have deleted the files too. But still Kodi is now able to execute binary code in its own data directory, something that on 11 should be not allowed.
If there are termux commands I can use to check the situation, as stated, I have root, I can do whatever is needed to gather more information.
I simply thought that it was enough for me to uninstall the module to revert but that does not appear to be the case. Unless the privilege Kodi is using is saved once and for all on a per app basis. And since Kodi used it once, it remained (it doesn't sound likely but I'm grasping at straws).
I asked mods to move this, if this is not the correct forum to ask for this.
Edit: it was in general questions and answers
Bump? I hope it's allowed.
Could somebody be so kind as to advise where I could post this so as to get an answer? I realize this might be the wrong forum, maybe.
But I have asked already in two different places and I haven't gotten to the bottom of it.
Thanks!
Bump
Bump... :-(
Bump. I hope somebody could at least point me to somewhere where I could ask.
Please?
Bump.

Categories

Resources