Hide an APK without having access to the source code. - Android Q&A, Help & Troubleshooting

I had an APK that I installed on my phone that I did not want anybody seeing so I used the method in the following post: https://forum.xda-developers.com/t/how-to-make-an-apk-hidden-when-it-installs.1501053
Essentially what I did was I replaced :
Code:
<category android:name="android.intent.category.LAUNCHER"/>
by
Code:
<category android:name="android.intent.category.DEFAULT"/>
Now the app is hidden but I cannot open it even when going into the settings. I want to see if there is a way to keep the app hidden but be able to open it somehow. I saw this stack overflow post: https://stackoverflow.com/questions...-app-without-android-intent-category-launcher, but that assumes that I have access to the source code which I do not.
I appreciate any help possible, thank you.

Maybe something like Activity Launcher would help? IDK..

Related

[Q][DEV] Question about GingerBread code - Settings.apk

Hello everyone!
I recently started modfying Settings.apk to make it look like ICS following THIS GUIDE.
What I'm trying to do, though, is to add toggle buttons to the Wi-Fi and Bluetooth options, just like ICS.
This code:
Code:
<PreferenceScreen android:title="@string/settings_label" android:key="parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceCategory android:title="@string/settings_ics_radio" />
<CheckBoxPreference android:persistent="false" android:title="@string/wifi_quick_toggle_title" android:key="enable_wifi" android:summary="@string/wifi_quick_toggle_summary" />
Adds the button, but that said button does nothing.
What do I need to add in order to make it work?
Edit: I see from here that it might require smali editing, but I'm not too sure since that last guide was trying to add a toggle that didn't actually exist before, and I just want to add a button that already exists in another menu.
Thanks in advance.

Editing AndroidManifest.xml .. formatting / localized to Chinese(?), Go SMS Pro Theme

Hi everyone,
I've created a GO SMS Pro theme using their webtool,
but it appears to have yet to implement various common aspects of functionality. I want to be able to modify the AndroidManifest.xml file myself, primarily to add Airpush (the presence of which I let people know of from the beginning), but the formatting is quite garbled. I'm guessing this may be due to the localization to Chinese that the Google Play developer console reports. Does anyone have a functional, readily editable version in English with all the required information for a GO SMS Pro Theme? I want to be assured I have all the required information, rather than hacking together another xml file with Eclipse. I figured I'd install the Chinese language on my computer, but it appears Microsoft did not include such functionality in Windows 7 Premium (64-bit). I've download other GO SMS Pro themes with Airpush, figuring I could use their AndroidManifest.xml and mail.xml files as templates, but found the same formatting / editability issue. Thank you for your help!
I've since found kantbstopped519's post at the end of page 3 in the following thread: http://forum.xda-developers.com/showthread.php?t=1125626&page=3
and used what was posted:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="5" android:versionName="1.0" android:installLocation="auto" package="com.jb.gosms.theme.kxnt.dark"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/jb_smsmms">
<activity android:theme="@android:style/Theme.Dialog" android:label="@string/app_name_desc" android:name=".GoSmsInstallDialog" android:excludeFromRecents="true" android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
<intent-filter>
<action android:name="com.jb.mms.theme.others" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
Click to expand...
Click to collapse
It appears this functioned for kantbstopped519.
I used this as a template (made no additions of Airpush or anything such) and made the supposedly appropriate changes, also changing anything referencing @string to plain text directly in AndroidManifest.xml. Now I'm getting that informative "The server could not process your apk. Try again."
I've been making various changes, deletions, and resigning after each change, to repeatedly the same message. Only re-adding my original garbled-de-goop AndroidManifest.xml file and resigning has thus far resulted in a successful processing upon upload. Could this have something to do with the resources.arsc and/or classes.dex files in the root of the apk?
If the APK is already compiled then you will need to decompile it with apktool to get the XML readable.

[MOD][GUIDE] ICS+ Tabbed settings(MIUI Like)

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So I came across this thread a week or more back and implemented it in my ICS rom, but I wasn't happy with it(various reasons but mostly because it is gesture based). So I abandoned it. Fast forward a couple days, jumping from project to project, idea to idea and I somehow ended up porting the latest ICS version of ShenduOS. Then boom, the settings app was *almost* exactly what I wanted. It featured a more natural swiping from tab to tab, similar to most launchers.
So I stripped the code for the tabs from the shendu settings app, stripped that code of any Shendu specific code and re-coded portions of the smali code so I could add it to the settings app of the ICS rom I use as my daily driver. What I ended up with is what seems to be something thats pretty generic and not rom specific.
So now I share with you what *should* work with any ICS+ rom. This guide will be very similar to the one I linked to above.
THIS SHOULD ALSO WORK ON OTHER DEVICES BUT I CANNOT TEST TO BE SURE
Prerequisites:
-experience decompiling/recompiling apk's with APKTool
-experience signing apks
-experience editing/theming apks
I will not go into any of the above any more then just saying when to preform certain actions......
GUIDE:
1. First you will need to decompile the Settings.apk from your ROM with apktool
2. Download the Settings.zip I attached to this post
3. Unzip the Settings.zip and copy the 'res' and 'smali' folders to your decompiled Settings.apk folder(merge with existing folders of the same names)
4. Open 'res/values/strings.xml' from the decompiled settings apk in your favorite text editor and add the following to the end of the list of strings...
Code:
<string name="personalized_setting">Personal</string>
<string name="device_setting">System</string>
<string name="app_setting">Applications</string>
5. Open 'res/values/ids.xml' from the decompiled settings apk in your favorite text editor and add the following to the end of the list of ID's
Code:
<item type="id" name="linearLayout1">false</item>
<item type="id" name="personalized_tab">false</item>
<item type="id" name="device_tab">false</item>
<item type="id" name="app_tab">false</item>
<item type="id" name="cursor">false</item>
<item type="id" name="vPager">false</item>
6.Now you must recompile the settings.apk. This is because APKtool will give resource ID's to certain resources we added during this process, we need these generated ID's in the following steps because the code access's some resources directly by the ID's.
7. Decompile the Newly recompiled APK again, from here on out I will assume your editing this newly recompiled/decompiled version.
8. With this step it is very easy to make a typo, so please make sure you are paying Extra attention to details during this step.
-Open up 'res/values/public.xml' and you will find lines similar to the following.
Code:
<public type="id" name="[COLOR="Red"]vPager[/COLOR]" id="[U]0x7f08022a[/U]" />
-Below I will give you a list of .smali file names, each file is located in the 'smali/com/android/settings/' folder of your decompiled settings.apk
- Each file name will be followed by a line similar to above, you need to search the smali files for the ID(underlined in the example above)
- Then search the public.xml I told you to open above for the name for each line(red in example above)
- Replace the ID in the smali file with the one you located in the public.xml
Code:
!--MainSettings.smali--!
<public type="id" name="vPager" id="0x7f08022a" />
<public type="id" name="cursor" id="0x7f080229" />
<public type="id" name="app_tab" id="0x7f080168" />
<public type="id" name="device_tab" id="0x7f080228" />
<public type="id" name="personalized_tab" id="0x7f080227" />
<public type="layout" name="mainsetting" id="0x7f040090" />
!--DeviceSettings.smali--!
<public type="xml" name="device_settings_headers" id="0x7f050051" />
!--AppSettings.smali--!
<public type="xml" name="app_settings_headers" id="0x7f050052" />
!--PersonalSettings.smali--!
<public type="xml" name="personal_settings_headers" id="0x7f050053" />
9. Now open up the 'AndroidManifest.xml' of your decompiled settings.apk in a text editor.
-Find a section similar to the below....
Code:
<activity android:label="@string/settings_label_launcher" android:name="Settings" android:taskAffinity="com.android.settings" android:clearTaskOnLaunch="true" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The important parts you are looking for are 'name="Settings" and the 'android.intent.category.LAUNCHER' lines, there *should* only be a single section with these.
Change this section to the below:
Code:
<activity android:label="@string/settings_label_launcher" android:name="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Directly above that section copy/paste the following code:
Code:
<activity android:name="MainSetting" android:theme="@android:style/Theme.NoTitleBar" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="@string/settings_label_launcher" android:name="PersonalSettings" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="@string/settings_label_launcher" android:name="DeviceSettings" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="@string/settings_label_launcher" android:name="AppSettings" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
10. You are now done with this round of modifications, its time to recompile the APK. Because this is a system app and we edited AndroidManifest.xml we must sign this recompiled Apk before pushing it to the system. You can try using any of the keys that come with whatever apk signing tool you use, but you will more then likely end up with a Settings.apk that wont show as being installed. To overcome this on ASOP roms I download and sign system apks with the platfrom keys from CyanogenMod's android_build github. If everything goes well and you push the new signed apk to the system, your settings app should now look similar to this when you open it.
11. What you have is 3 tabs with no settings. I left this for you to do, as each rom has its own specific settings options. Most ASOP roms store the main page of settings options in the 'res/xml/settings_headers.xml'. Copy/paste/reorganize each of these options into the 'app_settings_headers.xml', 'device_settings_headers.xml' and 'personal_settings_headers.xml' files which are also located in 'res/xml/'.
12. After all is said and done above, you *may* need to edit/theme the 'res/layout/mainsettings.xml' to suit your roms specific look.
NOTE:
If you are attempting this on a Non-ASOP Rom or are having trouble you may need to follow these additional instructions
And to finally end this, here are some screenshots where I added this feature to the settings.apk of our twistedmodICS rom by pwn.
alternate mirror to files :http://www.mediafire.com/?8vp99zjfkbe42z2
reserved....
Nice to see you finally got it how you wanted it. Thanks for the guide
Sent from my myTouch_4G_Slide using Tapatalk 2
Nice guide. Thank you.
TEAM MiK
MikROMs Since 3/13/11
strapped365 said:
Nice to see you finally got it how you wanted it. Thanks for the guide
Sent from my myTouch_4G_Slide using Tapatalk 2
Click to expand...
Click to collapse
Yessir, I was giddy like a little school girl when I finally got it to function how I wanted
Sent from my HTC Evo Shift using xda app-developers app
Thanks for the work you put into this and the guide
Never mind, I figured it out!
SaintZ93 said:
Never mind, I figured it out!
Click to expand...
Click to collapse
lol.. I re-downloaded to double check, checked it, then quoted your reply only to see that you figured it out already... If you need anything else let me know
Awesome
Shifted from planet Namek
thanks Bro for the guide
but I'm still confuse with this
Quote :
"To overcome this on ASOP roms I
download and sign system apks with the
platfrom keys from CyanogenMod's
android_build github. "
can you guide that too ?
Thanks in advance
hello BigSplit.....after I followed your tutorial. I get this in apktool
C: \ Documents and Settings \ server \ Desktop \ ICS Apktool> apkto
I: Checking Whether sources has changed ...
I: Smaling ...
I: Checking Whether resources has changed ...
I: Building resources ...
AAPT: warning: string 'dsds_dsds_device_status' has no def
\ Documents and Settings \ server \ Desktop \ ICS Apktool \ Settings
AAPT: warning: string 'dsdsdevice_status' has no default t
ents and Settings \ server \ Desktop \ ICS Apktool \ Settings \ res;
I: Building apk file ...
C: \ Documents and Settings \ server \ Desktop \ ICS Apktool> apkto
I: Checking Whether sources has changed ...
I: Checking Whether resources has changed ...
I: Building apk file ...
C: \ Documents and Settings \ server \ Desktop \ ICS Apktool>
and I try to push my settings and my settings disappeared after reboot. help me to fix this problem .. thks
did u sign the apk like i mentioned in the op?
Adi_ai****eru said:
thanks Bro for the guide
but I'm still confuse with this
Quote :
"To overcome this on ASOP roms I
download and sign system apks with the
platfrom keys from CyanogenMod's
android_build github. "
can you guide that too ?
Thanks in advance
Click to expand...
Click to collapse
Google for a guide about signing apks. Most tutorials will have you sign apks with test keys, I gave you a link in that sentence you quoted directly to the files I said you should use in signing instead.
BigSplit said:
Google for a guide about signing apks. Most tutorials will have you sign apks with test keys, I gave you a link in that sentence you quoted directly to the files I said you should use in signing instead.
Click to expand...
Click to collapse
Adi_ai****eru said:
thanks Bro for the guide
but I'm still confuse with this
Quote :
"To overcome this on ASOP roms I
download and sign system apks with the
platfrom keys from CyanogenMod's
android_build github. "
can you guide that too ?
Thanks in advance
Click to expand...
Click to collapse
Dont worry, I got you
HOW TO SIGN APKS/ZIPS
Note: Java needs to be installed for this to work
1. Download the signapk.zip file from my mediafire
http://www.mediafire.com/#8gjgusqbct8q2
2. Extract it and read the "usage.txt"
3. Download the .pk8 and .pem files that BigSplit linked to and copy those into the extracted "signapk" directory
4. Open a command prompt window in the "signapk" extracted directory (Shift+RightClick > Open command prompt here)
5. Run the command in the "usage.txt", substituting your downloaded ".pem" file and your downloaded ".pk8" file and the Settings.apk file in the appropriate places
Command should look something like this
Code:
java -jar signapk.jar downloaded-certificate-HERE.pem download-key-HERE.pk8 SettingsAppHere.apk Settings-signed.apk
The "settings-signed.apk" part can be changed to anything, thats just the signed output file
"SettingsAppHere.apk" is the Settings app you are modding
Sent from my PG06100
Time to sticky this one
stare into oblivion
Fall into sleep
turkbot said:
Time to sticky this one
stare into oblivion
Fall into sleep
Click to expand...
Click to collapse
I know right.
Awesome find again, BigSplit, must've taken you a lot of digging in forums and background knowledge but I gotta say, the end product is definitely worth it :good:
Sent from my PG06100
CNexus said:
Dont worry, I got you
HOW TO SIGN APKS/ZIPS
Note: Java needs to be installed for this to work
1. Download the signapk.zip file from my mediafire
http://www.mediafire.com/#8gjgusqbct8q2
2. Extract it and read the "usage.txt"
3. Download the .pk8 and .pem files that BigSplit linked to and copy those into the extracted "signapk" directory
4. Open a command prompt window in the "signapk" extracted directory (Shift+RightClick > Open command prompt here)
5. Run the command in the "usage.txt", substituting your downloaded ".pem" file and your downloaded ".pk8" file and the Settings.apk file in the appropriate places
Command should look something like this
Code:
java -jar signapk.jar downloaded-certificate-HERE.pem download-key-HERE.pk8 SettingsAppHere.apk Settings-signed.apk
The "settings-signed.apk" part can be changed to anything, thats just the signed output file
"SettingsAppHere.apk" is the Settings app you are modding
Sent from my PG06100
Click to expand...
Click to collapse
How about ApkMultitools ?
I ussualy use ApkMultitools to decompile/compile/sign.apk
Sent from my GT-I8150 using xda app-developers app
Adi_ai****eru said:
How about ApkMultitools ?
I ussualy use ApkMultitools to decompile/compile/sign.apk
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
I guess thats fine too. I like doing things manually though when I can
BigSplit said:
did u sign the apk like i mentioned in the op?
Click to expand...
Click to collapse
Sir ... Can you make this for me. I always fail at boot time ... my settings are always lost. probably because I could not find - <public type="layout" name="mainsetting" id="0x7f040090" /> in public.xml,
im st23i 4.0.4. thks sir ..
Nathan Ali Ashari said:
Sir ... Can you make this for me. I always fail at boot time ... my settings are always lost. probably because I could not find - <public type="layout" name="mainsetting" id="0x7f040090" /> in public.xml,
im st23i 4.0.4. thks sir ..
Click to expand...
Click to collapse
So you are on a stock firmware? If so, I would guess that the other packages are not signed with the same keys I linked to since its a stock ROM and not asop. The only thing you can do then is to attempt to re-sign every system apk/jar with a new signature(which I've never been successful at doing).
And the mainsetting will only show up in the public xml AFTER you compile it, then decompile it again. The only reason it wouldnt show up is if you are not placing the files i posted in the correct directories or not recompiling/decompiling when I said to.

How to disable components without root?

Is it possible to disable receivers without root?
pm disable? I'm not really familiar with it.
I don't really want to root and I've been trying to find out ways to disable receivers in apps.
StickyPuppyPerson said:
Is it possible to disable receivers without root?
pm disable? I'm not really familiar with it.
I don't really want to root and I've been trying to find out ways to disable receivers in apps.
Click to expand...
Click to collapse
It's possible, to disable an app go to settings-->apps and notifications-->All Apps and find the one you want to disable in the list. Click it and then click "disable".
The process may vary depending on the Android version, but I'm sure you can do it (this feature appeared but Android Ice Cream Sandwich).
P.s: You can't disable some apps because they are necessary to the system.
@StickyPuppyPerson
THREAD'S TITLE IS TOTALLY MISLEADING!
Anyway:
Apps can register receivers. These are specified in app's Manifest.xml file.
Example:
Code:
<receiver android:name=".MyBroadcastReceiver"
android:exported="true"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.INPUT_METHOD_CHANGED" />
</intent-filter>
</receiver>
Hence to disable/remove a receiver you would either have to change content of app's Manifest.xml file manually or programmatically by means of Android's PacketManager ( Note: if it's NOT a system app you want to modify then to do NO root is required ).
jwoegerbauer said:
@StickyPuppyPerson
THREAD'S TITLE IS TOTALLY MISLEADING!
Anyway:
Apps can register receivers. These are specified in app's Manifest.xml file.
Example:
Code:
<receiver android:name=".MyBroadcastReceiver"
android:exported="true"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.INPUT_METHOD_CHANGED" />
</intent-filter>
</receiver>
Hence to disable/remove a receiver you would either have to change content of app's Manifest.xml file manually or programmatically by means of Android's PacketManager ( Note: if it's NOT a system app you want to modify then to do NO root is required ).
Click to expand...
Click to collapse
How should I rename it?
Could you show me an example with adb?
Was wondering if there was an app for this that works with no root adb.
StickyPuppyPerson said:
How should I rename it?
Click to expand...
Click to collapse
Because there are four different types of app components:
Activities
Services
Broadcast receivers
Content providers
specify the component -> Replace "components" by "receivers"
Was wondering if there was an app for this that works with no root adb.
Click to expand...
Click to collapse
May be a so-called APK-Editor does the job: Don't know it.

Replacing status bar

Hey,
I have Knox license which with it I have managed to get some system-only permissions. For instance:
"android.permission.STATUS_BAR_SERVICE"
According to the source code:
<!-- Allows an application to be the status bar. Currently used only by SystemUI.apk
@hide -->
<permission android:name="android.permission.STATUS_BAR_SERVICE"
android:label="@string/permlab_statusBarService"
android:description="@string/permdesc_statusBarService"
android: protectionLevel="signature" />
So technically, since Knox said it was able to give my app these permissions I can replace the system's status bar.
Question is, how do I go about doing that?
Thanks, sorry I posted it here, I have too low post count to post in developing sections

Categories

Resources