Can't hook a method. - Xposed Framework Development

Hello guys!
I'm trying to hook a method in the Recents windows.
This is my code:
Code:
public static final String PACKAGE_NAME = "com.android.systemui";
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (!loadPackageParam.packageName.equals(PACKAGE_NAME)) return;
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onMeasure", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("Found onMeasure.");
super.afterHookedMethod(param);
}
});
}
}
but I can't see the log says "Found onMeasure", what am I doing worng?
The method does exists here:
http://grepcode.com/file/repository.../systemui/recents/views/RecentsView.java?av=f
Thanks!

Hi, you should get used to checking the Xposed log in the event of trouble, which is accessible from the installer -> logs. You would have seen a NoSuchMethodError : ....findMethod()#exact there. This signified that there is no such exact method in the source, which is true because you need to specify the types of arguments of a method while hooking into it. Therefore, this should work.
Code:
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onMeasure", int.class, int.class, new XC_MethodHook() {
Cheers!

Rijul.A said:
Hi, you should get used to checking the Xposed log in the event of trouble, which is accessible from the installer -> logs. You would have seen a NoSuchMethodError : ....findMethod()#exact there. This signified that there is no such exact method in the source, which is true because you need to specify the types of arguments of a method while hooking into it. Therefore, this should work.
Code:
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onMeasure", int.class, int.class, new XC_MethodHook() {
Cheers!
Click to expand...
Click to collapse
Thanks!
I'm checking it now and will update.

Rijul.A said:
Hi, you should get used to checking the Xposed log in the event of trouble, which is accessible from the installer -> logs. You would have seen a NoSuchMethodError : ....findMethod()#exact there. This signified that there is no such exact method in the source, which is true because you need to specify the types of arguments of a method while hooking into it. Therefore, this should work.
Code:
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onMeasure", int.class, int.class, new XC_MethodHook() {
Cheers!
Click to expand...
Click to collapse
I added your line, but it still does not working.
This is the code now:
Code:
public static final String PACKAGE_NAME = "com.android.systemui";
@Override
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (!loadPackageParam.packageName.equals(PACKAGE_NAME)) return;
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onMeasure", int.class, int.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Log.d("Xposed","onMeasure!");
Rect rect = (Rect)XposedHelpers.getObjectField(param.thisObject,"searchBarSpaceBounds");
View searchBar = (View)XposedHelpers.getObjectField(param.thisObject,"mSearchBar");
searchBar.measure(
View.MeasureSpec.makeMeasureSpec(120, View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(rect.height(), View.MeasureSpec.EXACTLY));
super.afterHookedMethod(param);
}
});
I'm trying to change the width of Google's search bar in the Recents panel.

Wassupdog said:
I added your line, but it still does not working.
This is the code now:
Code:
public static final String PACKAGE_NAME = "com.android.systemui";
@Override
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (!loadPackageParam.packageName.equals(PACKAGE_NAME)) return;
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onMeasure", int.class, int.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Log.d("Xposed","onMeasure!");
Rect rect = (Rect)XposedHelpers.getObjectField(param.thisObject,"searchBarSpaceBounds");
View searchBar = (View)XposedHelpers.getObjectField(param.thisObject,"mSearchBar");
searchBar.measure(
View.MeasureSpec.makeMeasureSpec(120, View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(rect.height(), View.MeasureSpec.EXACTLY));
super.afterHookedMethod(param);
}
});
I'm trying to change the width of Google's search bar in the Recents panel.
Click to expand...
Click to collapse
Do you mind posting your Xposed log?

Rijul.A said:
Do you mind posting your Xposed log?
Click to expand...
Click to collapse
Code:
12-15 20:58:03.650 7906-7906/? I/Xposed: -----------------
12-15 20:58:03.650 7906-7906/? I/Xposed: Added Xposed (/system/framework/XposedBridge.jar) to CLASSPATH
12-15 20:58:03.793 7906-7906/? I/Xposed: Detected ART runtime
12-15 20:58:03.814 7906-7906/? I/Xposed: Found Xposed class de/robv/android/xposed/XposedBridge, now initializing
12-15 20:58:03.988 7906-7906/? I/Xposed: Loading modules from /data/app/lfprodev.xposed.xstana-2/base.apk
12-15 20:58:04.382 7906-7906/? I/Xposed: Loading class lfprodev.xposed.xstana.EngineXstana
12-15 20:58:04.399 7906-7906/? I/Xposed: Loading modules from /data/app/eightbit.com.clearall-1/base.apk
12-15 20:58:04.425 7906-7906/? I/Xposed: assets/xposed_init not found in the APK
12-15 21:02:56.040 11226-11226/de.robv.android.xposed.installer I/XposedInstaller: updating modules.list
12-15 21:03:13.621 11447-11447/? D/XposedStartupMarker: Current time: 1450206193, PID: 11447
12-15 21:03:13.622 11447-11447/? I/Xposed: -----------------
12-15 21:03:13.622 11447-11447/? I/Xposed: Starting Xposed version 78, compiled for SDK 23
12-15 21:03:13.622 11447-11447/? I/Xposed: Device: Nexus 4 (LGE), Android version 6.0.1 (SDK 23)
12-15 21:03:13.622 11447-11447/? I/Xposed: ROM: to_mako-userdebug 6.0.1 MMB29M eng.jenkins.20151212.033742 test-keys
12-15 21:03:13.622 11447-11447/? I/Xposed: Build fingerprint: google/to_mako/mako:6.0.1/MMB29M/jenkins12120339:userdebug/test-keys
12-15 21:03:13.622 11447-11447/? I/Xposed: Platform: armeabi-v7a, 32-bit binary, system server: yes
12-15 21:03:13.622 11447-11447/? I/Xposed: SELinux enabled: yes, enforcing: no
12-15 21:03:16.082 11447-11447/? I/Xposed: -----------------
12-15 21:03:16.082 11447-11447/? I/Xposed: Added Xposed (/system/framework/XposedBridge.jar) to CLASSPATH
12-15 21:03:16.287 11447-11447/? I/Xposed: Detected ART runtime
12-15 21:03:16.289 11447-11447/? I/Xposed: Found Xposed class de/robv/android/xposed/XposedBridge, now initializing
12-15 21:03:16.460 11447-11447/? I/Xposed: Loading modules from /data/app/lfprodev.xposed.xstana-2/base.apk
12-15 21:03:16.825 11447-11447/? I/Xposed: Loading class lfprodev.xposed.xstana.EngineXstana
12-15 21:03:16.836 11447-11447/? I/Xposed: Loading modules from /data/app/eightbit.com.clearall-2/base.apk
12-15 21:03:16.864 11447-11447/? I/Xposed: assets/xposed_init not found in the APK

Wassupdog said:
Code:
12-15 20:58:03.650 7906-7906/? I/Xposed: -----------------
12-15 20:58:03.650 7906-7906/? I/Xposed: Added Xposed (/system/framework/XposedBridge.jar) to CLASSPATH
12-15 20:58:03.793 7906-7906/? I/Xposed: Detected ART runtime
12-15 20:58:03.814 7906-7906/? I/Xposed: Found Xposed class de/robv/android/xposed/XposedBridge, now initializing
12-15 20:58:03.988 7906-7906/? I/Xposed: Loading modules from /data/app/lfprodev.xposed.xstana-2/base.apk
12-15 20:58:04.382 7906-7906/? I/Xposed: Loading class lfprodev.xposed.xstana.EngineXstana
12-15 20:58:04.399 7906-7906/? I/Xposed: Loading modules from /data/app/eightbit.com.clearall-1/base.apk
12-15 20:58:04.425 7906-7906/? I/Xposed: assets/xposed_init not found in the APK
12-15 21:02:56.040 11226-11226/de.robv.android.xposed.installer I/XposedInstaller: updating modules.list
12-15 21:03:13.621 11447-11447/? D/XposedStartupMarker: Current time: 1450206193, PID: 11447
12-15 21:03:13.622 11447-11447/? I/Xposed: -----------------
12-15 21:03:13.622 11447-11447/? I/Xposed: Starting Xposed version 78, compiled for SDK 23
12-15 21:03:13.622 11447-11447/? I/Xposed: Device: Nexus 4 (LGE), Android version 6.0.1 (SDK 23)
12-15 21:03:13.622 11447-11447/? I/Xposed: ROM: to_mako-userdebug 6.0.1 MMB29M eng.jenkins.20151212.033742 test-keys
12-15 21:03:13.622 11447-11447/? I/Xposed: Build fingerprint: google/to_mako/mako:6.0.1/MMB29M/jenkins12120339:userdebug/test-keys
12-15 21:03:13.622 11447-11447/? I/Xposed: Platform: armeabi-v7a, 32-bit binary, system server: yes
12-15 21:03:13.622 11447-11447/? I/Xposed: SELinux enabled: yes, enforcing: no
12-15 21:03:16.082 11447-11447/? I/Xposed: -----------------
12-15 21:03:16.082 11447-11447/? I/Xposed: Added Xposed (/system/framework/XposedBridge.jar) to CLASSPATH
12-15 21:03:16.287 11447-11447/? I/Xposed: Detected ART runtime
12-15 21:03:16.289 11447-11447/? I/Xposed: Found Xposed class de/robv/android/xposed/XposedBridge, now initializing
12-15 21:03:16.460 11447-11447/? I/Xposed: Loading modules from /data/app/lfprodev.xposed.xstana-2/base.apk
12-15 21:03:16.825 11447-11447/? I/Xposed: Loading class lfprodev.xposed.xstana.EngineXstana
12-15 21:03:16.836 11447-11447/? I/Xposed: Loading modules from /data/app/eightbit.com.clearall-2/base.apk
12-15 21:03:16.864 11447-11447/? I/Xposed: assets/xposed_init not found in the APK
Click to expand...
Click to collapse
Which one of these modules is yours? The last one?

Rijul.A said:
Which one of these modules is yours? The last one?
Click to expand...
Click to collapse
Yes, "ClearAll" module.

You did not specify an assets/xposed_init file, as required by the framework. https://github.com/rovo89/XposedBridge/wiki/Development-tutorial
Are you using Android Studio or Eclipse?

Rijul.A said:
You did not specify an assets/xposed_init file, as required by the framework. https://github.com/rovo89/XposedBridge/wiki/Development-tutorial
Are you using Android Studio or Eclipse?
Click to expand...
Click to collapse
I didn't.
I'm using Android Studio.

Then please specify one using the development tutorial and this repository as a reference https://github.com/basil2style/Xposed-Android-Studio-Project/tree/master/XposedDemoProject
EDIT : The repo is just to define the location of the assets folder, https://github.com/basil2style/Xpos.../master/XposedDemoProject/app/src/main/assets
That is the assets folder is in the same directory as the root of the java classes folder

Rijul.A said:
Then please specify one using the development tutorial and this repository as a reference https://github.com/basil2style/Xposed-Android-Studio-Project/tree/master/XposedDemoProject
EDIT : The repo is just to define the location of the assets folder, https://github.com/basil2style/Xpos.../master/XposedDemoProject/app/src/main/assets
That is the assets folder is in the same directory as the root of the java classes folder
Click to expand...
Click to collapse
I did, but, can I ask why is this important to do?
EDIT: I added it and I got problem now.
This is the problem:
java.lang.ClassNotFoundException

Wassupdog said:
I did, but, can I ask why is this important to do?
Click to expand...
Click to collapse
An Android project may have multiple classes. Merely specifying that it is an Xposed module, therefore, is not enough. You need to tell the framework the class to be loaded, which is done using this file.
Did it work?
---------- Post added at 12:51 AM ---------- Previous post was at 12:50 AM ----------
Please post complete log.

Rijul.A said:
An Android project may have multiple classes. Merely specifying that it is an Xposed module, therefore, is not enough. You need to tell the framework the class to be loaded, which is done using this file.
Did it work?
---------- Post added at 12:51 AM ---------- Previous post was at 12:50 AM ----------
Please post complete log.
Click to expand...
Click to collapse
Code:
12-15 21:21:22.567 22110-22110/? E/Xposed: java.lang.ClassNotFoundException: Didn't find class "de.robv.android.xposed.mods.clearall" on path: DexPathList[[zip file "/data/app/eightbit.com.clearall-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at de.robv.android.xposed.XposedBridge.loadModule(XposedBridge.java:467)
at de.robv.android.xposed.XposedBridge.loadModules(XposedBridge.java:432)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "de.robv.android.xposed.mods.clearall" on path: DexPathList[[zip file "/system/framework/XposedBridge.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 4 more
Suppressed: java.lang.ClassNotFoundException: de.robv.android.xposed.mods.clearall
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 5 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

Please post complete .class file, including package "..."

Rijul.A said:
Please post complete .class file, including package "..."
Click to expand...
Click to collapse
Code:
package eightbit.com.clearall;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
/**
* Created by Home on 15/12/2015.
*/
public class Main implements IXposedHookLoadPackage {
public static final String PACKAGE_NAME = "com.android.systemui";
@Override
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (!loadPackageParam.packageName.equals(PACKAGE_NAME)) return;
findAndHookMethod("com.android.systemui.recents.views.RecentsView", loadPackageParam.classLoader, "onLayout", int.class, int.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
}
});
}
}
I also tried to write
Code:
eightbit.com.clearall
in xposed_init to see if it will work, but same problem.

Use
Code:
eightbit.com.clearall.Main
in xposed_init

Rijul.A said:
Use
Code:
eightbit.com.clearall.Main
in xposed_init
Click to expand...
Click to collapse
I will try and update, my Nexus suddenly turns off by itself today so it will take few minutes .
Thanks for all your help!
I really appreciate it .

Rijul.A said:
Use
Code:
eightbit.com.clearall.Main
in xposed_init
Click to expand...
Click to collapse
Code:
12-15 21:33:27.462 10734-10734/com.android.systemui E/Xposed: java.lang.NoSuchMethodError: com.android.systemui.recents.views.RecentsView#onMeasure(de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam,de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam)#exact
at de.robv.android.xposed.XposedHelpers.findMethodExact(XposedHelpers.java:181)
at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:131)
at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:138)
at eightbit.com.clearall.Main.handleLoadPackage(Main.java:24)
at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:20)
at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:34)
at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:70)
at de.robv.android.xposed.XposedBridge$1.beforeHookedMethod(XposedBridge.java:173)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:655)
at android.app.ActivityThread.handleBindApplication(<Xposed>)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:114)
We got progress .
The same error occurs when using int.class.

Code:
package eightbit.com.clearall;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
public class Main implements IXposedHookLoadPackage {
public static final String PACKAGE_NAME = "com.android.systemui";
[user=439709]@override[/user]
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (!loadPackageParam.packageName.equals(PACKAGE_NAME)) return;
Class<?> RecentsView = XposedHelpers.findClass("com.android.systemui.recents.views.RecentsView",
loadPackageParam.classLoader);
findAndHookMethod(RecentsView, "onMeasure", int.class, int.class, new XC_MethodHook() {
[user=439709]@override[/user]
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
}
});
}
}
Does this work?

Related

Xposed On Android 6.0 Will Not Install Properly

This is my log
11-18 12:00:14.664 I/Xposed ( 1711): ----------------- 11-18 12:00:14.664 I/Xposed ( 1711): Starting Xposed version 78, compiled for SDK 23 11-18 12:00:14.664 I/Xposed ( 1711): Device: Nexus 6 (motorola), Android version 6.0 (SDK 23) 11-18 12:00:14.664 I/Xposed ( 1711): ROM: MRA58K 11-18 12:00:14.664 I/Xposed ( 1711): Build fingerprint: google/shamu/shamu:6.0/MRA58K/2256973:user/release-keys 11-18 12:00:14.664 I/Xposed ( 1711): Platform: armeabi-v7a, 32-bit binary, system server: yes 11-18 12:00:14.664 I/Xposed ( 1711): SELinux enabled: yes, enforcing: yes 11-18 12:00:15.678 I/Xposed ( 1711): ----------------- 11-18 12:00:15.679 I/Xposed ( 1711): Added Xposed (/system/framework/XposedBridge.jar) to CLASSPATH 11-18 12:00:16.662 I/Xposed ( 1711): Detected ART runtime 11-18 12:00:16.663 E/Xposed ( 1711): Could not load libxposed: dlopen failed: library "/system/lib/libxposed_art.so" not found 11-18 12:00:17.030 I/Xposed ( 1711): Errors during Xposed initialization 11-18 12:00:17.047 E/Xposed ( 1711): java.lang.UnsatisfiedLinkError: No implementation found for int de.robv.android.xposed.XposedBridge.getRuntime() (tried Java_de_robv_android_xposed_XposedBridge_getRuntime and Java_de_robv_android_xposed_XposedBridge_getRuntime__) 11-18 12:00:17.047 E/Xposed ( 1711): at de.robv.android.xposed.XposedBridge.getRuntime(Native Method) 11-18 12:00:17.047 E/Xposed ( 1711): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:94)
Try setting SELinux to permissive
Pardon my ignorance but his would I go about doing that?
Easiest Method
https://f-droid.org/repository/browse/?fdfilter=Selinux&fdid=com.mrbimc.selinux

handleInitPackageResources Error - Unable to setReplacement | Help

Hi, I'm developing a module that change an image in an app, plus change a color.
The module is working fine on CM12, but on my Xperia LP Stock ROM, it's not, even though I'm hooking the same app with no changes, here the log :
variables :
XResources res = Xposed.INIT_PACKAGE_RESOURCES_PARAM.res;
Xposed :
public static InitPackageResourcesParam INIT_PACKAGE_RESOURCES_PARAM;
Image replacement
Code
HTML:
if (resId2 != 0) {
Log.d("InTheHook", "Blue Selected");
res.setReplacement(resId, new XResources.DrawableLoader() {
[user=439709]@override[/user]
public Drawable newDrawable(XResources res, int id) throws Throwable {
return Xposed.X_MODULE_RESOURCES.getDrawable(R.drawable.blue);
}
});
}
Log
HTML:
01-06 06:41:40.308 1395-2252/? D/InTheHook: Blue Selected
01-06 06:41:40.313 1395-2252/? E/Xposed: at de.robv.android.xposed.IXposedHookInitPackageResources$Wrapper.handleInitPackageResources(IXposedHookInitPackageResources.java:20)
01-06 06:41:40.313 1395-2252/? E/Xposed: at de.robv.android.xposed.XposedBridge$7.afterHookedMethod(XposedBridge.java:351)
01-06 06:41:40.313 1395-2252/? E/Xposed: at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:689)
Color replacement
HTML:
int material_accent = res.getIdentifier("material_accent", "color", Xposed.Music_PACKAGE_NAME);
if (material_accent != 0) {
Log.d("MusicHook", "material_accent");
res.setReplacement(material_accent, Color.BLACK);
}
Log :
HTML:
01-06 06:41:40.308 1395-2252/? D/MusicHook: material_accent
01-06 06:41:40.313 1395-2252/? E/Module: at com.abohani.moduletest.hooks.music(java:20)
that line is the "setReplacement" line, it's not replacing .
A New log :
01-10 01:20:19.219 17798-17798/? E/Xposed: at com.abohani.moduletest.hooks.hook(NotificationHeaderBg.java:77)
01-10 01:20:19.219 17798-17798/? E/Xposed: at com.abohani.moduletest.Xposed.handleInitPackageResources(Xposed.java:75)
01-10 01:20:19.219 17798-17798/? W/System.err: at com.abohani.moduletest.hooks.hook(NotificationHeaderBg.java:77)
01-10 01:20:19.219 17798-17798/? W/System.err: at com.abohani.moduletest.Xposed.handleInitPackageResources(Xposed.java:75)
01-10 01:20:19.852 17798-17798/? W/PackageManager: Failure retrieving resources for com.abohani.moduletest: Resource ID #0x0
I have used multi sizes for the picture, as some of the devs said it's a problem from the size/resolution, didn't work also .

LG Optimus G E975 - cannot install any custom ROM

I bought LG Optimus G E975 (international) one year ago. I rooted my phone and unlock bootloader using FreeGee. Everything went well. I had unlocked bootloader and installed TWRP 2.6.3.0. I decided that It was time for installation new ROM. I chose CM 12 (snapshot version), I flashed it, but I had a bootloop problem (stuck on boot animation). After, I tried latest CM 12.1 nightly version, but I had error about umount system during flashing. I solved it by latest TWRP 3.0.0 for geehrc from mordesku.pl/show/geehrc/other/twrp-3.0.0-0-geehrc.zip site and latest bootloader makoz30f from mordesku.pl/show/geehrc/other/makoz30f_flasher.zip. Everything went well, I again flashed CM 12 and 12.1, but I have another error in both cases, that this versions is for E975, not for geehrc. I was suprised, because It is the same. So, I tried flashed another ROM (for geehrc) such as Xenon HD (all versions), Resurection Remix (all versions), PACman ROM, but I always problem with boot (stuck on boot animation). Of course I always did full wipe before flashing whatever. I also tried a trick with flashing, making backup, full wiping and restoring backuped ROM and fix selinux context, but nothing helped.
Fortunately, I have made backup of stock ROM, that works.
My logcat:
Code:
--------- beginning of main
W/auditd ( 158): type=2000 audit(0.0:1): initialized
I/auditd ( 158): type=1403 audit(0.0:2): policy loaded auid=4294967295 ses=4294967295
I/logd ( 158): type=1400 audit(0.0:3): avc: denied { audit_control } for capability=30 scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=capability permissive=1
I/logd ( 158): type=1400 audit(0.0:4): avc: denied { syslog_read } for scontext=u:r:init:s0 tcontext=u:r:kernel:s0 tclass=system permissive=1
I/setenforce( 166): type=1400 audit(0.0:5): avc: denied { write } for name="enforce" dev="selinuxfs" ino=4 scontext=u:r:recovery:s0 tcontext=ubject_r:selinuxfs:s0 tclass=file permissive=1
I/recovery( 161): type=1400 audit(0.0:6): avc: denied { execmem } for scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=process permissive=1
I/recovery( 161): type=1400 audit(0.0:7): avc: denied { execute } for path="/dev/ashmem" dev="tmpfs" ino=6351 scontext=u:r:init:s0 tcontext=ubject_r:ashmem_device:s0 tclass=chr_file permissive=1
I/ARMAssembler( 161): generated scanline__00000077:03010101_00008001_00000000 [ 91 ipp] (112 ins) at [0xb696a1f0:0xb696a3b0] in 152602 ns
I/ARMAssembler( 161): generated scanline__00000077:03545402_00000A01_00000000 [ 31 ipp] (52 ins) at [0xb696a3c0:0xb696a490] in 91561 ns
I/ARMAssembler( 161): generated scanline__00000077:03545402_00000A08_00000000 [ 31 ipp] (53 ins) at [0xb696a4a0:0xb696a574] in 61041 ns
I/recovery( 161): type=1400 audit(0.0:8): avc: denied { rename } for name="twrp.fstab" dev="rootfs" ino=5433 scontext=u:r:init:s0 tcontext=ubject_r:rootfs:s0 tclass=file permissive=1
I/recovery( 161): type=1400 audit(0.0:9): avc: denied { create } for name="fstab" scontext=u:r:init:s0 tcontext=ubject_r:rootfs:s0 tclass=file permissive=1
I/recovery( 161): type=1400 audit(0.0:10): avc: denied { write } for name="fstab" dev="rootfs" ino=1816 scontext=u:r:init:s0 tcontext=ubject_r:rootfs:s0 tclass=file permissive=1
I/ARMAssembler( 161): generated scanline__00000077:03545402_00000000_00000000 [ 30 ipp] (44 ins) at [0xb696a580:0xb696a630] in 183122 ns
What's the size of ur system partition ? It needs 2G version
Sent from my Optimus G using XDA-Developers mobile app
paul_zm said:
What's the size of ur system partition ? It needs 2G version
Click to expand...
Click to collapse
My system partition has 1,5G. How can I Increase it easily?
For example, after flashing XenonHD ROM, I have 964,6M free space, so I don't think the size of the system partition was important here.
I noticed that system partition size after flashing custom ROM has 1,4G, after restore stock ROM backup 1,5G. Is it normal?
Having Same issue any fix or workaround ?

LineageOS 15 on S5 mini and SE Linux enforcement. Doesn't work well together

Hi,
I'm running LineageOS 15 (Android 8) on S5 mini. Everything is fine except one banking app that I really need. They validate on startup, whether the phone is rooted.
They in fact check if SE Linux is in enforcement mode. Here is the log snippet:
Code:
11-23 18:44:54.894 2259 2521 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.fidor.fsw/com.gft.fidor.views.splash.SplashScreenActivity bnds=[350,815][506,994] (has extras)} from uid 10036
11-23 18:44:54.935 2084 2084 I display : [DYNAMIC_RECOMP] HWC_2_GLES by low FPS(0)
11-23 18:44:54.969 2259 4027 I ActivityManager: Start proc 20526:com.fidor.fsw/u0a119 for activity com.fidor.fsw/com.gft.fidor.views.splash.SplashScreenActivity
11-23 18:44:55.190 2084 2084 I display : [DYNAMIC_RECOMP] GLES_2_HWC by high FPS(39)
11-23 18:44:55.229 20526 20540 I vndksupport: sphal namespace is not configured for this process. Loading /system/lib/egl/libEGL_mali.so from the current namespace instead.
11-23 18:44:55.326 20526 20540 D libEGL : loaded /system/lib/egl/libEGL_mali.so
11-23 18:44:55.339 2084 2133 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x400
11-23 18:44:55.356 20526 20540 I vndksupport: sphal namespace is not configured for this process. Loading /system/lib/egl/libGLESv1_CM_mali.so from the current namespace instead.
11-23 18:44:55.362 20526 20540 D libEGL : loaded /system/lib/egl/libGLESv1_CM_mali.so
11-23 18:44:55.586 20526 20540 I vndksupport: sphal namespace is not configured for this process. Loading /system/lib/egl/libGLESv2_mali.so from the current namespace instead.
11-23 18:44:55.588 20526 20540 D libEGL : loaded /system/lib/egl/libGLESv2_mali.so
11-23 18:44:56.455 20526 20526 I putmethod.latin: type=1400 audit(0.0:774): avc: denied { read } for name="/" dev="tmpfs" ino=3689 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=1
11-23 18:44:56.455 20526 20526 W putmethod.latin: type=1300 audit(0.0:774): arch=40000028 syscall=334 per=800008 success=yes exit=0 a0=ffffff9c a1=898ca354 a2=4 a3=0 items=1 ppid=2066 auid=4294967295 uid=10119 gid=10119 euid=10119 suid=10119 fsuid=10119 egid=10119 sgid=10119 fsgid=10119 tty=(none) ses=4294967295 exe="/system/bin/app_process32" subj=u:r:untrusted_app_25:s0:c512,c768 key=(null)
11-23 18:44:56.455 1978 1978 W auditd : type=1307 audit(0.0:774): cwd="/"
11-23 18:44:56.455 1978 1978 W auditd : type=1302 audit(0.0:774): item=0 name="/sbin" inode=3689 dev=00:12 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=u:object_r:rootfs:s0
11-23 18:44:56.455 1978 1978 W auditd : type=1327 audit(0.0:774): proctitle="com.google.android.inputmethod.latin"
11-23 18:44:56.455 1978 1978 W auditd : type=1320 audit(0.0:774):
11-23 18:44:56.527 2259 3192 W ActivityManager: Force finishing activity com.fidor.fsw/com.gft.fidor.views.splash.SplashScreenActivity
Since LineageOS sets SELinux by default into permissive, this check fails and the app crashes. I'm able to set it to enforced with "SE Linux mode changer" or any other app of that kind, but immediately after the change the phone starts eating 100% cpu and modem (neither internet, nor SMS/phone calls) aren't working, which makes me think LineageOS doesn't work really well in enforcement mode of SE Linux. But the app itself launches just fine with SELinux in enforced.
I'm not an expert in Android and SELinux, but would like to know if there is a way:
to workaround the check we see in the logs and work with the app in permissive mode
to make LineageOS work correctly under enforced
PS. It doesn't matter which way to set the SELinux mode. Whatever is done - through kernel, in init.d or in adb shell, the symptoms are exactly the same after the change.
Thanks
bytes85 said:
Hi,
I'm running LineageOS 15 (Android 8) on S5 mini. Everything is fine except one banking app that I really need. They validate on startup, whether the phone is rooted...
Click to expand...
Click to collapse
I don't have this device but, your best bet is to post this question within the following Unofficial LineageOS (since there's no Official LineageOS Oreo released yet) thread for your device.
https://forum.xda-developers.com/showthread.php?t=3678205
Good Luck!
~~~~~~~~~~~~~~~
I DO NOT PROVIDE SUPPORT VIA PM UNLESS ASKED/REQUESTED BY MYSELF.
PLEASE KEEP IT IN THE THREADS WHERE EVERYONE CAN SHARE

Question There is a problem with SELinux rules after successful ROM compilation

The following error is reported in adb logcat
05-26 17:32:01.812 1 1 W /system/bin/init: type=1107 audit(0.0:152): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=persist.vendor.radio.call_waiting_for_sync_0 pid=32058 uid=10140 gid=10140 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_rild_prop:s0 tclass=property_service permissive=0'
05-26 17:32:01.808 32058 32058 W pool-5-thread-1: type=1400 audit(0.0:151): avc: denied { read } for name="u:object_r:vendor_rild_prop:s0" dev="tmpfs" ino=357 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_rild_prop:s0 tclass=file permissive=0 app=com.shannon.imsservice
05-26 17:32:02.035 535 535 E SELinux : avc: denied { find } for pid=30652 uid=10156 name=hardware.qorvo.uwb.IUwbVendor/default scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:hal_uwb_vendor_service:s0 tclass=service_manager permissive=0
I'm compiling a custom rom, I can see the same errors (along with others) in LogCat, but there's not issues or bugs in the rom
Does your rom crash or something?

Categories

Resources