pylerSM / XInstaller

[Xposed module] Various tweaks for Package Installer
http://repo.xposed.info/module/com.pyler.xinstaller
BSD 2-Clause "Simplified" License
153 stars 61 forks source link

UI overhaul, fix crash/reload #27

Closed easyaspi314 closed 8 years ago

easyaspi314 commented 9 years ago

Major redesign in preferences!

Everything is English only and will need to be translated eventually

pylerSM commented 9 years ago

Good good :)

easyaspi314 commented 8 years ago

Hey, I have a question: Should we use Holo/Material themes or stay with DeviceDefault? (Because preference headers are ugly in TW).

easyaspi314 commented 8 years ago

Here are some screenshots of my current thing using App Settings and Holo Themer to switch themes and Tablet Layout.

DeviceDefault screenshot_2015-10-20-07-10-17 screenshot_2015-10-20-07-10-22 screenshot_2015-10-20-07-08-22

Holo screenshot_2015-10-20-07-09-53 screenshot_2015-10-20-07-09-56 screenshot_2015-10-20-07-07-01

Holo Light/Dark screenshot_2015-10-20-07-09-22 screenshot_2015-10-20-07-09-29 screenshot_2015-10-20-07-08-49

pylerSM commented 8 years ago

I prefer DeviceDefault theme :) Btw, how did you open apps in "tablet" mode?

Looks really well :)

pylerSM commented 8 years ago

Maybe you can add item "Bug report" which opens browser with link of issue page of this Github project.

easyaspi314 commented 8 years ago

And source code. Good idea! On Oct 20, 2015 5:28 PM, "pyler" notifications@github.com wrote:

Maybe you can add item "Bug report" which opens browser with link of issue page of this Github project.

— Reply to this email directly or view it on GitHub https://github.com/pylerSM/XInstaller/pull/27#issuecomment-149708636.

easyaspi314 commented 8 years ago

I think I am on to something, but it seems that I am having some fragment trouble. What can I say. Fragments hate me. :)

pylerSM commented 8 years ago

heh ;)

easyaspi314 commented 8 years ago

I am likely going to commit later today. I just got a new SD card (8GB Class 2 -> 32GB UHS-1 :smile: ) and am currently moving stuff over... but Vista copies slooooowly.

easyaspi314 commented 8 years ago

I would've committed earlier but I had issues with the things in the video, removePreference(Preference preference, and SwitchPreference's OnClickListener bug. I am currently implementing a module disabled notification and then it might just be ready. Still need to fix 4.1 issues though but I don't know Xposed well.

pylerSM commented 8 years ago

I will fix that 4.1 issue myself. That's okay.

easyaspi314 commented 8 years ago

OK I am almost done, I am just having a bit of trouble with recreate() and Preference Headers. I will try and finish it up this afternoon.

– Devin Hussey

On Sun, Oct 25, 2015 at 5:44 PM, pyler notifications@github.com wrote:

I will fix that 4.1 issue myself. That's okay.

— Reply to this email directly or view it on GitHub https://github.com/pylerSM/XInstaller/pull/27#issuecomment-150977107.

easyaspi314 commented 8 years ago

Here ya go. Test it and see if it works on your device(s) and can you do me a favor and test it on a tablet (or tablet-sized emulator)? On Oct 26, 2015 11:24 AM, "Devin Hussey" husseydevin@gmail.com wrote:

OK I am almost done, I am just having a bit of trouble with recreate() and Preference Headers. I will try and finish it up this afternoon.

– Devin Hussey

On Sun, Oct 25, 2015 at 5:44 PM, pyler notifications@github.com wrote:

I will fix that 4.1 issue myself. That's okay.

— Reply to this email directly or view it on GitHub https://github.com/pylerSM/XInstaller/pull/27#issuecomment-150977107.

easyaspi314 commented 8 years ago

Feel free to reformat it, I may have used tabs instead of spaces and I think there are a few extra blank lines. On Oct 26, 2015 7:56 PM, "Devin Hussey" husseydevin@gmail.com wrote:

Here ya go. Test it and see if it works on your device(s) and can you do me a favor and test it on a tablet (or tablet-sized emulator)? On Oct 26, 2015 11:24 AM, "Devin Hussey" husseydevin@gmail.com wrote:

OK I am almost done, I am just having a bit of trouble with recreate() and Preference Headers. I will try and finish it up this afternoon.

– Devin Hussey

On Sun, Oct 25, 2015 at 5:44 PM, pyler notifications@github.com wrote:

I will fix that 4.1 issue myself. That's okay.

— Reply to this email directly or view it on GitHub https://github.com/pylerSM/XInstaller/pull/27#issuecomment-150977107.

easyaspi314 commented 8 years ago

By the way to open apps in tablet mode I used App Settings. Just lower the DPI to something like 160 and set the Screen (dp) to 1000x1600. Some things might not work properly because unused themes are usually removed from your ROM to save space.

Sorry I didn't see the second line of your comment a few days ago.

easyaspi314 commented 8 years ago

You have write access.

pylerSM commented 8 years ago

Crash: Click on report bug, cancel dialog, click on Github - crash.

Something with resuming and preferences.

easyaspi314 commented 8 years ago

Can you show a logcat? (auto correct changed to logical (: )

– Devin Hussey

On Thu, Nov 5, 2015 at 12:33 PM, pyler notifications@github.com wrote:

Crash: Click on report bug, cancel dialog, click on Github - crash.

Something with resuming and preferences.

— Reply to this email directly or view it on GitHub https://github.com/pylerSM/XInstaller/pull/27#issuecomment-154132019.

easyaspi314 commented 8 years ago

nvm try what I have now.

– Devin Hussey

On Thu, Nov 5, 2015 at 1:50 PM, Devin Hussey husseydevin@gmail.com wrote:

Can you show a logcat? (auto correct changed to logical (: )

– Devin Hussey

On Thu, Nov 5, 2015 at 12:33 PM, pyler notifications@github.com wrote:

Crash: Click on report bug, cancel dialog, click on Github - crash.

Something with resuming and preferences.

— Reply to this email directly or view it on GitHub https://github.com/pylerSM/XInstaller/pull/27#issuecomment-154132019.

pylerSM commented 8 years ago

http://pastebin.com/p8LQdHj1

pylerSM commented 8 years ago

11-05 18:26:44.261 E/AndroidRuntime( 7603): FATAL EXCEPTION: main 11-05 18:26:44.261 E/AndroidRuntime( 7603): java.lang.RuntimeException: Unable to resume activity {com.pyler.xinstaller/com.pyler.xinstaller.Preferences}: java.lang.NullPointerException 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2830) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2859) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1322) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.os.Handler.dispatchMessage(Handler.java:99) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.os.Looper.loop(Looper.java:137) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.ActivityThread.main(ActivityThread.java:5283) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at java.lang.reflect.Method.invokeNative(Native Method) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at java.lang.reflect.Method.invoke(Method.java:511) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at dalvik.system.NativeStart.main(Native Method) 11-05 18:26:44.261 E/AndroidRuntime( 7603): Caused by: java.lang.NullPointerException 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.preference.PreferenceGroup.removePreferenceInt(PreferenceGroup.java:188) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.preference.PreferenceGroup.removePreference(PreferenceGroup.java:181) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at com.pyler.xinstaller.Preferences$Settings.onResume(Preferences.java:339) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.Fragment.performResume(Fragment.java:1742) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:937) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1075) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1057) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1870) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.Activity.performResume(Activity.java:5371) 11-05 18:26:44.261 E/AndroidRuntime( 7603): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2820) 11-05 18:26:44.261 E/AndroidRuntime( 7603): ... 11 more

easyaspi314 commented 8 years ago

OK. I think I see the issue. I soft-bricked my phone so I can't test it. :angry:

Try moving all of the onResume() code to onCreate() in the fragment. See if it happens again. It seems that appTranslator is null because it has already been removed.

easyaspi314 commented 8 years ago

I was planning to deregister the listeners in onPause(), but that never happened.

pylerSM commented 8 years ago

Another reported crash by user on XDA: https://www.dropbox.com/s/m6v9l3d2uwr5whc/alogcat.2015-11-11-11-55-40-0200.txt?dl=0

pylerSM commented 8 years ago

And it seems we have another issue too: https://github.com/pylerSM/XInstaller/issues/28

Maybe I will have to move back to old UI (until everything is fixed), since we need working UI for work on XInstaller for Android M.

pylerSM commented 8 years ago

Okey, I saw and merged your fixes. We need to verify #28 .

easyaspi314 commented 8 years ago

I got LP running and your module causes my phone to just hang at boot. It definitely looks like the preferences are the issue. Maybe as a hack, we could do something like this:

com.pyler.xinstaller.Preferences

@Override
public void onStop() {
    super.onStop();
    try {
        new XSharedPreferences("com.pyler.xinstaller").makeWorldReadable();
    } catch (Throwable e) {}
}

Obviously until we get a real fix. And tell people not to force reboot/soft reboot from your app.

pylerSM commented 8 years ago

this fix will not fix it

getPreferenceManager().setSharedPreferencesMode( Context.MODE_WORLD_READABLE);

should handle it.

when we edit something manually we need to open it as https://github.com/pylerSM/XInstaller/blob/master/src/com/pyler/xinstaller/Utils.java#L220

This bug is release-blocker. Need good fix, not fast hack.

pylerSM commented 8 years ago

The problem is that after you change any preference, prefs file became not "world readable". I don't know why since we open it in this mode.

pylerSM commented 8 years ago

This (https://github.com/pylerSM/XInstaller/blob/e9ac602542159ccfa77c907e67c5dae93e35368a/src/com/pyler/xinstaller/Preferences.java#L104) is bad code, imho, since we should open it in world readable mode.

pylerSM commented 8 years ago

@easyaspi314 We need to fix issue https://github.com/pylerSM/XInstaller/pull/27#issuecomment-154132019 and this is ready to go as stable release.