Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch private activities #2

Closed
Magissia opened this issue Sep 30, 2015 · 47 comments
Closed

Launch private activities #2

Magissia opened this issue Sep 30, 2015 · 47 comments

Comments

@Magissia
Copy link

Hello, it would be useful if the application. could use SU to launch private activities

@jadedgnome
Copy link

Can't launch service mode activities even though my device is rooted. launching with su would have been great.

@butzist
Copy link
Owner

butzist commented Jan 3, 2021

Good idea. Would require root access - any free code you can point me to, that I can integrate?

@vaimalaviya1233
Copy link
Contributor

vaimalaviya1233 commented Jan 17, 2021

Good idea. Would require root access - any free code you can point me to, that I can integrate?

@butzist
SU permissions

@drogga
Copy link
Collaborator

drogga commented Jan 17, 2021

Already done in a fork (or 2). You can get some ideas form there, like how it's implemented, even tho it's based on a super old version build, that doesn't even have the search functionality.
https://github.com/DerekZiemba/RootActivityLauncher
https://github.com/ThePBone/RootActivityLauncher

Dev. - please read your E-Mail inbox, the one form the app's Play Store page that you provided.
I don't know why the hell did you increased (bump - AGAIN) the minSDKversion (API) this time to 19 [4.4 KK], it seems like you keep and keep increasing it every so often, without any real, actual\particular reason, breaking the compatibility with older OS versions, which are no longer able to installed it from Play (because you didn't left the older vers. there too...), I'm one of those, with 4.0.3, 4.1.2 & 4.3 devices !

BTW - I modded v2.9.2 .apk for myself, making the UI \ theme dark (DeviceDefault), it's actually pretty easy to do.

@butzist
Copy link
Owner

butzist commented Jan 18, 2021

@drogga Will look into launching private activities

Regarding minSdkVersion: I had issues keeping the code clean and simultaneously supporting old Android versions. If you have a suggestion plz create a PR.

@butzist
Copy link
Owner

butzist commented Jan 18, 2021

@drogga if you have code for dark mode support - please share

@vaimalaviya1233
Copy link
Contributor

@butzist
Although i was not able to theme the drop down menu and loading dialogue box but anything other than that is themed here i will keep that only until january 20th since it's author is you and i don’t know if the many file i will be able to create pull request so i was going to work on renewing menu bar so download if you want to still want to work on dark mode Activity-dark-mode and check last commit named Dark Mode for more info

@drogga
Copy link
Collaborator

drogga commented Jan 18, 2021

@butzist That's unfortunate, I'm very dissapointed to read that...!
Let someone else figures-out a workaround / solution to this, the <4.4 compatibility.
Dark UI - I guess there's no point anymore, since @vaimalaviya1233 picked this, but anyway, my solution is way more simpler:
/res/values/styles.xml > DeviceDefault (I don't remember doing anything else...)

@vaimalaviya1233
Copy link
Contributor

@butzist That's unfortunate, I'm very dissapointed to read that...!
Let someone else figures-out a workaround / solution to this, the <4.4 compatibility.
Dark UI - I guess there's no point anymore, since @vaimalaviya1233 picked this, but anyway, my solution is way more simpler:
/res/values/styles.xml > DeviceDefault (I don't remember doing anything else...)

@drogga
Thanks for giving idea but originally i was going use newer material menubar and it was also compatible with theming and make it side bar instade of poping
Menu list from top anyway thanks😊

@vaimalaviya1233
Copy link
Contributor

vaimalaviya1233 commented Jan 19, 2021

I don't know why the hell did you increased (bump - AGAIN) the minSDKversion (API) this time to 19 [4.4 KK], it seems like you keep and keep increasing it every so often, without any real, actual\particular reason, breaking the compatibility with older OS versions, which are no longer able to installed it from Play (because you didn't left the older vers. there too...), I'm one of those, with 4.0.3, 4.1.2 & 4.3 devices !

@drogga as per of your increasing bump of minSDKversion is sometimes requires to add options like adding more features if it wasn’t for supporting older versions of android it would have gotten big big visual and functional support and major revamp in design. but keeping up support for older devices is becoming more difficult because some of API's is deciparated by google.

@drogga
Copy link
Collaborator

drogga commented Jan 22, 2021

So I downgraded the minSDKversion back to 14 of the Debug Builds (the PS and F-Droid builds crash on launch, so they doesn't seem to work at all on lower than 4.4 with this method, so thanks god the debug ones do) so I could do some tests on 4.1.2 Tablet and the only issue seems to be the misplaced drop-down \ expand symbol of the activities that shows up over the icons, plus the crash on rotation (as always with every other ver.). So I'm sure that some fixes can definitely be applied and the minSDK lowered-down back to 14.

@vaimalaviya1233 I also did the same with your debug build with the Dark Theme and I must admit that I kind of like what you did there (btw - the same issues as described above)... ;)

@butzist IDK why you had to replace\change the icon again, as the blue one from 1.9.2 was & looked much better then the new one...

@vaimalaviya1233
Copy link
Contributor

@drogga it doesn’t seem to crash on my phone(android 10) when rotating so it's issue that occurs on older devices so if you can get crash report. i or someone might be able to fix it because i don’t have phone older than android 6.0 and newer than android 10. glad you liked theme but unfortunately menubar can’t be themed and android pop-up dialogue box so i'm working on new menu bar it will have new icons if you'll want i can upload on github repo to you'll to if those icons are good or bad. and
keep in mind debug builds you will only be able to install by android studio otherwise it will fail to install because apk is not signed. it requires signature of apk to be installed i think this is what is issue of installing.

@vaimalaviya1233
Copy link
Contributor

@drogga @butzist getting way around crashing on android 4.4 is to launch activity launcher while phone is landscape. and @drogga i need your help you can contact me at telegram Instagram twitter

@drogga
Copy link
Collaborator

drogga commented Jan 23, 2021

---- Jan 23, 2021 12:50:22 PM ----

01-23 12:48:36.054 14297 14297 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{de.szalkowski.activitylauncher/de.szalkowski.activitylauncher.MainActivity}: androidx.fragment.app.Fragment$e: Unable to instantiate fragment de.szalkowski.activitylauncher.c: could not find Fragment constructor

01-23 12:48:36.054 14297 14297 E AndroidRuntime: Caused by: androidx.fragment.app.Fragment$e: Unable to instantiate fragment de.szalkowski.activitylauncher.c: could not find Fragment constructor

01-23 12:48:36.054 14297 14297 E AndroidRuntime: at de.szalkowski.activitylauncher.MainActivity.onCreate()

01-23 12:48:45.699 2361 3111 I ActivityManager: Process de.szalkowski.activitylauncher (pid 14297) (adj 9) has died.

---- Jan 23, 2021 12:50:22 PM ----
^this is from my dark ui mod of 1.9.2, but it applies to the latest too since it's the same rotating issue^

Sure, you can upload non-debug .apk in your git\repo.
Don't worry about the installing - if it's still not clear - I'm a newbie (junior) reverser, I know how to mod & sign\reSign .apk, .zip, .jar, also I have signature bypass patches applied to the system (package installer), so I don't need Android Studio since I'm a tech savvy power-user ;)
BTW - I have a bit of hard time understanding you, and Yes, I understand that your English is not native (mine too), but please try harder if you can, or use translators & spell checkers if you have to.

IDK about 4.4 KK, but here on 4.1.2 JB Tablet - I Am launching in Landscape and I get a crash when rotate, the same if I launch it in Portrait and rotate to Landscape.

Help for what ?
I don't use any of those and I don't intend to start now, so can I E-Mail you instead (to your yahoo mail from your profile\account page here) ?

@butzist
Copy link
Owner

butzist commented Jan 23, 2021

@vaimalaviya1233 The traceback does not look useful.
@drogga You need to install a debug build to get any useful traceback. Just build the app from sources. Then you will also see why it is not easy to keep the support for old API versions...

@drogga
Copy link
Collaborator

drogga commented Jan 23, 2021

I've never mentioned any colors !!
My ENg is not the problem, as mine is fluent, your's not !
I never said that this is "traceback" of a debug build (...IDK where do you read those stuff...), it's a LogCat, that's how they look like !
I can't build from source, I don't have the necessary tools. Also I can't deal with those currently.
Keep in mind that, Currently I don't have much interest in the current builds, because I don't use anything above 7 N, so they are useless to me, but if this ever changes, then I may check your progress, until then - have fun with the project...

Repository owner deleted a comment from twistedink90 Apr 5, 2021
@butzist
Copy link
Owner

butzist commented Dec 27, 2021

@drogga @Magissia @jadedgnome @vaimalaviya1233
I added some preliminary root support in PR #99

Can someone validate if this works? I don't have a use case for this.

@drogga
Copy link
Collaborator

drogga commented Dec 29, 2021

@butzist
The workflows are too much I think {Debug Build, Debug Build for PR, Release Build, Update Play Store listing}...
I DLed 2 artifacts from the latest workflows and they are in .aab {the file that is uploaded to PS} after extracting the .zip archive and I can't use those and there's basically no point in trying the older ones (in case there's .apk artifacts in those at all) as the test won't matter much and there's no custom naming of those artifacts files, which is super confusing and honestly a mess.

Also IDK on who and what the F-Droid releases depend, since they are outdated.

Anyway, I used this https://play.google.com/store/apps/details?id=com.lifesavi.bundle to convert the .aab to .apk on S20 FE {with Android 11} and the good thing is that the orientation {when forced} there no longer crashes A. L., so it can be re-enabled {and android:configChanges="orientation" should probably be added to the manifest for the main activity, if it needs to be configured in future, android:screenOrientation="unspecified" or whatever should be used, instead of how it's implemented currently} and the single standalone non-bundle\split .apk of the latest that is on P.S. v.1.12.3 now works, unlike before with the prev. v.1.11.0 that didn't work, only the splits did.

v.1.13.1 {latest Actions workflow build artifact} should also list the disabled\hidden activities, even on unrooted system, but it doesn't, I will later check on rooted and edit this if there's any other change, besides "Launch activity as root" which will probably work there {asking SU grant permission}, but it will still be pointless and I doubt that the hidden\disabled activities will magically show up.

The expand \ collapse up\down arrows are barely visible {system's Dark Mode is ON} and for some reason the status bar {notch area} is in blue color and forcing A. L. to FullScreen from the system settings doesn't change anything \ it still doesn't expand to the notch area as it should and as with other apps.

Nothing personal to @vaimalaviya1233, but I would've reverted most if not all of the theme \ UI \ layout changes that were contributed {I saw that some were already}.

@butzist
Copy link
Owner

butzist commented Dec 29, 2021

The workflows are too much I think

The workflows are just for me to automate the release process. Will probably get rid of the debug build, so all binaries are properly signed.

Artifacts from the latest workflows and they are in .aab

Very well, I can attach the built images as .apk instead

Also IDK on who and what the F-Droid releases depend

Neighter do I - someone else seems to be managing those

v.1.13.1 {latest Actions workflow build artifact} should also list the disabled\hidden activities

Good point, will try to add that today

I would've reverted most if not all of the theme \ UI \ layout changes

I've reverted most of the changes but kept the improvements - now using native theme everywhere. Android API < 21 does not support using the themed color in icons - maybe you want to create an icon with distinct color (grey? red? yellow?) to make sure it's visible with dark and light theme. In API >= 21 the icons will be automatically white/black depending on theme.

@butzist
Copy link
Owner

butzist commented Dec 29, 2021

@drogga Here's a new release APK for you: https://github.com/butzist/ActivityLauncher/actions/runs/1634884765
We are building this always on push to master.

Now we're also listing unexported activities - additionally, I might have fixed the color issue of the icons in dark theme and reverted to having a 300k APK :)

@butzist
Copy link
Owner

butzist commented Dec 29, 2021

@drogga @vaimalaviya1233 If you can confirm that everything works fine for you, I will release to production. As a followup, I will investigate whether there are any safe ways of creating shortcuts to private activities.

@drogga
Copy link
Collaborator

drogga commented Dec 30, 2021

If you want, I can show some examples of custom naming the artifacts on build, that can be made not only to include the app name, but also the version and build. That's what I meant by "there's no custom naming of those artifacts files, which is super confusing and honestly a mess".

You didn't have to keep restricting the rotation\orientation, I mentioned [android:screenOrientation="unspecified"] just to point out that it can be addressed \ restricted that way in case it's necessary in future, instead of how it was, so there's no need to use "locked" anymore {requires SDK\API 18 = 4.3 JB, we can try downgrading the minSDKversion back to 14 in future, which will also make this a issue}, since it doesn't crash per rotation and "unspecified" should be left just in case, to have it there if it's needed again for some reason or if it turns out that it crashes on older OS versions. As I mentioned in other issue (a recently closed one #74) and here, [android:configChanges="orientation"] should be added, so it will stay where it is when it's rotated (without loosing the expanded ones or the search filter), instead of the list being jumped to top, search filter cleared and everything expanded being collapsed. I tested with those two - it works.

Ok, now the private activities are listed, those with flag [exported="false"], but can the private disabled ones too, those with flag [enabled="false"] be listed at the same time and executed as root ?

In reality, the drop-down | drop-up expand \ collapse symbols do not respect the theme, with White theme they should be in\with Black color and with Dark theme they should be White, but they aren't, actually it looks like those are not pre-build icons, at least not as .png files, maybe as vector in .xml or .svg, IDK, because I couldn't find them as file.
Also IDK why you had to obfuscate \ shrink \ minify the resources and the classed\smali (proguard ?), I like them being as they are, without "confusion" or any other crippling, even if the size is slightly larger\bigger, this doesn't saves that much anyway.

The blue status bar and the fact that it can't be expanded to the notch area honestly makes the app look not great, especially on taller screens with 18.5:9 aspect ratio, I think that in code is called Action Bar, but I'm not sure, so you should probably look for that

Being able to also create shortcuts to the private un-exported and disabled activities and execute with root rights would indeed be nice to have ;)

I tested the app in rooted environment with SuperUser {"android-x86-4.4-r5.iso" ran by VirtualBox} and thankfully the default launch action by single tap is the "Launch activity as root" one for all the private activities, so it works !, but IDK if the situation will be the same with Magisk, as I can't currently test with it...

BTW - it's not necessary to bump the "versionName" with every edit or build, bumping the "versionCode" is enough, it will update over previous versions, no need to worry, Android doesn't care about the versionName much when it comes to installing updates over, only the versionCode matters, as long as it's not with lower numbers then the previous one - it's ok (PlayStore accepts updates submissions with only varsionCode {aka. Build numbers} increased and pushes them).

I think @IzzySoft takes care of the F-Droid releases\updates, and can probably help with the missing icon and screenshots there and pushing\listing the updates more frequently...

@drogga
Copy link
Collaborator

drogga commented Dec 30, 2021

It looks like this is revived: https://github.com/sdex/ActivityManager
It's probably inspired by A. L., but now some code can probably be used for ideas.

@IzzySoft
Copy link

I think @IzzySoft takes care of the F-Droid releases\updates, and can probably help with the missing icon and screenshots there and pushing\listing the updates more frequently...

Nope, updates/releases happen automatically. But after a quick look at the metadata of this app: If you want graphics, you need to establish Fastlane structures here in your app's repo. Once that's done and tagged (I can give it a quick check before tagging if you like), we need to update metadata on our end to make clear it shall be taken from Fastlane. If we get the timing right (i.e. merging the metadata update at F-Droid before the new tag was pulled and built), the next release should then have the new stuff from your Fastlane structures.

@drogga
Copy link
Collaborator

drogga commented Dec 30, 2021

@IzzySoft, @butzist should look at this, since I don't understand the matter that much.
Thanks for the input.

@IzzySoft
Copy link

It's not that hard actually, @drogga – just a structure to put files into, like in #101 😃

@butzist
Copy link
Owner

butzist commented Dec 31, 2021

@drogga @IzzySoft This ticket is actually about launching private activities. We have ticket #53 addressing F-Droid listing.

@butzist
Copy link
Owner

butzist commented Dec 31, 2021

@drogga Please create a new ticket for you layout issue and screen orientation. The artifact naming I do not consider really urgent to address. You are free to create a PR addressing this.

@butzist
Copy link
Owner

butzist commented Dec 31, 2021

@drogga Adressing here only the points related to this ticket

Ok, now the private activities are listed, those with flag [exported="false"], but can the private disabled ones too, those with flag [enabled="false"] be listed at the same time and executed as root ?

I'm marking activites as "private" that are !exported || !enabled. Does that make sense to you? Are you able to start both via su?

This was referenced Dec 31, 2021
@drogga
Copy link
Collaborator

drogga commented Dec 31, 2021

@butzist
The orientation part I can fix in the manifest - directly, since it's easy, just tell me if it's ok to do it by directly editing the Manifest, because I can't create PR's at this point, since I don't have the time (holidays and so on, also I'm at work), the other things I can't do at this point, since they are beyond my skills.

Back in the day (few years ago) when I had working rooted devices on hand, I used to play\experiment a lot and I believe as far as I can remember I was able to also start the disabled ones too [the ones with flag enabled="false"] via CMD > ADB in root mode and with the Terminal Emulator (su) on the devices themselves. As I mentioned already - those that A. L. now lists are launchable !, the disabled ones are not listed, so I don't have the necessary time to play with Terminal nowadays in order to confirm 100% that they are indeed launchable, so you can eventually "maybe" try to list them.

@IzzySoft
Copy link

This ticket is actually about launching private activities. We have ticket #53 addressing F-Droid listing.

Moved my part already to a PR, and will unsubscribe from this issue now. Apologies I simply responded to the ping, but I'm pinged so often that I don't have time to read the entire threads each time but can only concentrate on what I was asked for… Signing off here then, and all the best!

@butzist
Copy link
Owner

butzist commented Jan 1, 2022

@drogga I just pushed a new version that allow creation of shortcuts for private activities. Would be happy about feedback.
Disclaimer: I'm not happy with the UX of the whole app - but then I don't have time and skill to polish the layout and workflows in the app...

@drogga
Copy link
Collaborator

drogga commented Jan 1, 2022

Nice, I can test those with root after 2-3 days.

In the meantime, I could not notice that you keep mentioning (in code, What's New, changelogs, 1 recent comment, etc.) about the "disabled" private ones, but those are not listed, hence/therefore not currently launchable by this app, so please don't confuse the ones with flag exported="false" (which Are listed and launch-able), with the enabled="false" (aka. "disabled") ones that aren't, as those Are usually "private", not "public", but are disabled and NOT listed by this app, so it can't launch them, except maybe if the class of a "root" shortcut is being altered/edited before the creation to point to the disabled (private/hidden) activity.

I found some glitches with the apps and padlock icons - between the re-launches (not cleared from the recents) sometimes the apps icons are being misaligned / off-center (but not on their activities) for the older apps that don't naively have round/adaptive icon, but the system and A. L. shows them with one everywhere, and the padlock icons are shown on regular non-private activities, but fully closing A. L. fixes those glitches.

There's basically no point in having a context menu and 3-dots on/next to the app name too (collapsed state), they should be only shown for/on and next to the activities, or at least the 2 "Launch Activity" and "Launch Activity as root" are unnecessary there, the 2 for "Create shortcut" and "Create shortcut as root" just create ones for the main default activity, the one that is executed when clicking/tapping on the app's icon in the app drawer.

i installed the Good Lock's MultiStar module/plugin app, and on the bottom there's this last option called/named "The app size stretch to camera hole" with description "Set the app to overlap or not overlap the camera area", so it looks like the default behavior ("Defined by the app") for Activity Launcher actually is "Overlap with the camera area" (that's how A. L. is coded), so when I set it on/to "Not overlap with the camera area", A. L. looks as it probably should - not coloring the StatusBar in Blue color, being in pure black color, the same/just as the app's title bar (where the search and the 3-dots context menu icons/buttons are).
The last that looked like this (as / like it should), was v1.9.2 (original and my dark mod of it) & v1.10.0 Build 18 (from PlayStore).

@butzist
Copy link
Owner

butzist commented Jan 1, 2022

@drogga Sorry, but will not address layout/style issues in this ticket - please keep topics separated, so others can follow the discussion.

Regarding private activities:
The app is listing activities that are either disabled or not exported as "private", and thus tries to start them as root by default. What do you suggest to change regarding this behaviour?

@butzist
Copy link
Owner

butzist commented Jan 2, 2022

Added root/su detection to the app. Now these options will only appear for rooted OSes.

@drogga
Copy link
Collaborator

drogga commented Jan 2, 2022

I don't like that last part/change.
I understand the idea and point behind this decision and that it doesn't have much sense for the root options to show when there's no root, but what if there's a toggle option to show/list them anyway, only the root options are hidden when no root is detected, while still listing those usually hidden activities and/or a pop-up dialog or toast message shows/pops-up when trying to launch them, writing: "Root permission is required in order to launch this activity !", instead of restricting it that way, because, what if a Shizuku support is being added (I can probably launch those with Termux on the device itself) ?, as this allows commands and actions with elevated permissions being executed without root...

Edit:
Ok, only the "root" context menu items are unavailable without root, but trying to launch private activities by simply tapping/clicking on them will still show a toast message which is not user-friendly, but whatever, NVM.

@butzist
Copy link
Owner

butzist commented Jan 2, 2022

This is pretty much what I implemented. If no root is available, it will still show all activities, but possibly fail starting them.

@butzist
Copy link
Owner

butzist commented Jan 2, 2022

What's Shizuku?

@drogga
Copy link
Collaborator

drogga commented Jan 2, 2022

@butzist
Copy link
Owner

butzist commented Jan 2, 2022

Looks like a bigger change - let's create a separate ticket for it and mark as "need help". Maybe someone creates a PR before I have time to look into it.

@drogga
Copy link
Collaborator

drogga commented Jan 3, 2022

It turns out that now the Search also looks in the icon name path, instead of only activities titles and names, but it shouldn't (Activity Manager {by sdex} and Package Browser {by 4A} do not, which is better).

As I mentioned multiple times - the disabled public and/or private activities are still not listed, you can easily check this by installing 4A Package Browser, going to the "Settings" app (by searching there might be few, for me on samsung it's SecSettings.apk) -> Activities... -> filter "Shortcut", I have "public disabled activity com.android.settings.Settings$CreateShortcutActivity" which is missing from A. L.'s activities list of the same <- do you see what I mean ?

@butzist
Copy link
Owner

butzist commented Jan 3, 2022

Hey @drogga, since when are you missing those activities?
Is it possible that it was introduced with #79 ?

I pushed a new commit that should fix the wrong filter rule added by this PR. Can you plz check? I will immediately start rolling out a hotfix to google play, if this fixes it. Have many angry and not-so-polite Russians complaining about missing Cache clearing activities.

@drogga
Copy link
Collaborator

drogga commented Jan 5, 2022

IDK, since forever, that's why I mentioned numbers of times that not all are listed (like the disabled ones, this "shortcut" one is exactly that, as they don't want users to do something as simple as creating a shortcut to a setting, which wasn't the case years ago, anyway, I gave it just as an example), keep in mind that this is not only my issue.

I checked, even did a clean install - nothing's changed, everything seems to be the same.

You can re-direct the angry Russians to me, tell them to mention me in GitHub, open a issue here and read the already closed ones, where I mentioned multiple times, even today what's the issue with their devices.

@butzist
Copy link
Owner

butzist commented Jan 8, 2022

We could try using the pm binary instead, for rooted devices. For locked ones, I'm not quite sure if we can retrieve some activities at all.

@drogga
Copy link
Collaborator

drogga commented Jan 8, 2022

It looks like apps like Alliance Shield X on Samsung can start most if not any activity, no matter if it's private, unexported and disabled, it uses device admin, owner and knox privileges, I think the same can be achieved by Shizuku, that's why I suggested it.

We know that there are no other ways, besides the 2 above, using ADB commands to launch some, or of course Root to start any of the activities that usually aren't meant to be launched, that's why they are set to / made as private, unexported and disabled, so IDK what the people that complain, want or expect...

@butzist
Copy link
Owner

butzist commented Jan 8, 2022

Let's try not to insult anyone - join the Gitter chat for that 😉

@butzist
Copy link
Owner

butzist commented Jan 8, 2022

At the moment, I am not planning to implement more methods for listing and launching activities. If anyone wants to extend the app, send a PR. Closing this issue, because the main goal seems to have been achieved.

@butzist butzist closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants