Broadcasted intent not being received by system app - Android Software/Hacking General [Developers Only]

Posted this on stackoverflow but got no response so I'm trying here.
I have a BroadcastReciever in a system app that I want to send an Intent to (for testing purposes as I'm modding that system app).
The AndroidManifest.xml of the system app looks like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="15" android:versionName="4.0.4-I9300XXALF6" package="com.sec.android.contextaware"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_REMOVED" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.DUMP" />
<application android:label="@string/app_name">
<receiver android:label="StateReceiver" android:name=".abstractor.StateReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.sec.android.contextaware.HEADSET_PLUG" />
<action android:name="android.intent.action.LOCALE_CHANGED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<provider android:name=".manager.LoggingDataProvider" android:authorities="com.sec.android.contextaware.manager.LoggingDataProvider" />
</application>
</manifest>
I use a test app and check if the target system app indeed can receive that intent with:
Code:
Intent intent = new Intent();
intent.setAction("com.sec.android.contextaware.HEADSET_PLUG");
PackageManager pm = getPackageManager();
for (ResolveInfo resolveInfo : pm.queryBroadcastReceivers(bt, 0)) {
Log.d("APP: ", resolveInfo.toString());
}
and get back a `ResolveInfo` with the system app's info, so it should be able to receive the intent. I then broadcast the intent with:
Code:
sendBroadcast(intent);
However nothing happens, the intent is not received. I have full control of the target system app's manifest file and code. Is it possible to somehow get the intent across?
Device is rooted.

Related

[Q] Edit AndroidManifest.xml to Remove Ads

Hi, if I remove this lines (RED) from AndroidManifest.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1" android:versionName="1.0" package="com.strek.whistle.dog"
xmlns:android="xttp://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="3" />
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:theme="@android:style/Theme.Light.NoTitleBar" android:label="@string/app_name" android:name=".DogWhistleActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
[COLOR="red"] <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />[/COLOR]
</application>
[COLOR="Red"] <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />[/COLOR]
</manifest>
would that be enough to get rid of ads?
Cheers!!!
Are my question stupid?
Anyone!
You can patch host file in /system/etc/hosts
dhruv.always said:
You can patch host file in /system/etc/hosts
Click to expand...
Click to collapse
thanksssssss
dhruv.always said:
You can patch host file in /system/etc/hosts
Click to expand...
Click to collapse
Thank you for this but you gave me the fish and I want to learn fishing!
Look like I am going to delete those 3 lines, compile and see will app crush...
Cheers!!!
Ads added to an app by the developer are there so the app can be free and the developer doesn't have to make paid only apps to support the time needed to make the apps. If you don't want the ads then use a modded host file.
XDA is a site focused on developers so we will not help you remove the things they need to keep developing.
Thread closed

[GUIDE][DECOMPILE] Hide app from launcher

I thought there's no similar thread here, so I create it here
There's 2 guide here, you could use 1st guide but if app still available at launcher you can use 2nd guide
Things you will need
PC or Laptop
apktool, zipalign and others / or Tickle My Android
WinRAR or WinZip
Notepad++
Patience!
Click to expand...
Click to collapse
So, lets begin..
PS I'm using Tickle My Android now, it's more easier than using normal apkTool :good:​
1st Guide by @Emperor.dk
This is the original method
Emperor.dk said:
First go here and download my X10MP essentials pack (for both Mimmi and Robyn), and install framework-files as described in the thread.
http://forum.xda-developers.com/showthread.php?t=2033415
In this guide we will mod Torch.apk so it will not appear in the app-drawer. Widgets will still work and Power-widget-button will still work
Extract Torch.apk from your ROM and place it in the APKTool folder.
NOTICE:
- If you plan to use the modded Torch.apk in a non-odex'ed ROM, then mod an APK from such ROM.
- If you plan to use the modded Torch.apk in an odex'ed ROM, then mod an APK from such ROM.
Click Command Prompt.bat (or open CMD from Start-menu on the PC and navigate to the APKTools folder)
Type in the command for decompile the apk:
{
"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"
}
This will decompile the apk into a folder named "Torch".
Use Notepad++ to open AndroidManifest.xml. Download Notepad++ here: http://notepad-plus-plus.org/
AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="10" android:versionName="2.3.7" package="net.cactii.flash2"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:label="@string/app_name" android:name=".MainActivity" android:launchMode="singleTask" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
[COLOR="red"]<category android:name="android.intent.category.LAUNCHER" />[/COLOR]
</intent-filter>
</activity>
<activity android:name=".WidgetOptionsActivity">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver android:label="Torch" android:name="TorchWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="net.cactii.flash2.TORCH_STATE_CHANGED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
</receiver>
<service android:name=".TorchService" android:enabled="true" />
<receiver android:label="@string/app_name" android:name="TorchSwitch" android:enabled="true">
<intent-filter>
<action android:name="net.cactii.flash2.TOGGLE_FLASHLIGHT" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.flash" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
The red argument tells the UI to put the icon in the launcher, so we can just delete that line and save the XML.
Back in the Command prompt recompile the apk:
This will compile the APK again. The new APK will be placed in "Torch/dist"
Next we have to sign the new APK.
Move the new Torch.apk to the SignApk-folder.
Open Command Prompt in SignApk-folder and run the command to sign the APK:
This will sign the APK and save it to Torch_s.apk (you can rename it later).
Move the app to your handset and move to /system/app.
Set file-permissions to rw- r-- r--
Reboot.
Enjoy!
Here is the result (for non odex'ed ROM): http://www.mediafire.com/download.php?q5pp7coofa5x1g2
You can use this mod in odex'ed ROM too, but you then have to delete Torch.odex
Click to expand...
Click to collapse
This is my Tickle My Android method
Diaz1999 said:
STEP 1
Copy your framework-res.apk from system/framework and Torch.apk from /system/app/ then place it inside _in folder​
STEP 2
Open Tickle My Android, select Theming Menu, select Install Framework on PC, select framework-res.apk
Then select Decompile Files, select Torch.apk​
STEP 3
Go to _working folder, open Torch.apk
Open AndroidManifest.xml with Notepad++
Go to this
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="10" android:versionName="2.3.7" package="net.cactii.flash2"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:label="@string/app_name" android:name=".MainActivity" android:launchMode="singleTask" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
[COLOR="red"][U]<category android:name="android.intent.category.LAUNCHER" />[/U][/COLOR]
</intent-filter>
</activity>
<activity android:name=".WidgetOptionsActivity">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver android:label="Torch" android:name="TorchWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="net.cactii.flash2.TORCH_STATE_CHANGED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
</receiver>
<service android:name=".TorchService" android:enabled="true" />
<receiver android:label="@string/app_name" android:name="TorchSwitch" android:enabled="true">
<intent-filter>
<action android:name="net.cactii.flash2.TOGGLE_FLASHLIGHT" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.flash" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Just delete that red line and save​
STEP 4
Open Tickle My Android, select Recompile Files, select Torch.apk
Then select Sign App, select Torch.apk
After that, select Zipalign App, select Torch.apk​
STEP 5
Go to _out folder, move your Torch.apk to your phone, move it to /system/app/ and change permission to rw-r--r--
Then reboot​
Click to expand...
Click to collapse
2nd Guide by @keval_dk
This is the original method
keval_dk said:
Decompile apk...and Edit AndroidManifest.xml..
its an example(torch.apk) :-
u can see those lines there...
<application android:label="@string/app_name" android:icon="@drawable/icon">
juzz delete android:icon="@drawable/icon" and save n recompile it...n push it...i hope it'll work...
n dont forget to press thank you button if it works..
Click to expand...
Click to collapse
This is my Tickle My Android method
Diaz1999 said:
STEP 1
Copy your framework-res.apk from system/framework and Torch.apk from /system/app/ then place it inside _in folder​
STEP 2
Open Tickle My Android, select Theming Menu, select Install Framework on PC, select framework-res.apk
Then select Decompile Files, select Torch.apk​
STEP 3
Go to _working folder, open Torch.apk
Open AndroidManifest.xml with Notepad++
Go to this
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="10" android:versionName="2.3.7" package="net.cactii.flash2"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" [COLOR="red"][U]android:icon="@drawable/icon"[/U][/COLOR]>
<activity android:label="@string/app_name" android:name=".MainActivity" android:launchMode="singleTask" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".WidgetOptionsActivity">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver android:label="Torch" android:name="TorchWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="net.cactii.flash2.TORCH_STATE_CHANGED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
</receiver>
<service android:name=".TorchService" android:enabled="true" />
<receiver android:label="@string/app_name" android:name="TorchSwitch" android:enabled="true">
<intent-filter>
<action android:name="net.cactii.flash2.TOGGLE_FLASHLIGHT" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.flash" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Just delete that red line and save​
STEP 4
Open Tickle My Android, select Recompile Files, select Torch.apk
Then select Sign App, select Torch.apk
After that, select Zipalign App, select Torch.apk​
STEP 5
Go to _out folder, move your Torch.apk to your phone, move it to /system/app/ and change permission to rw-r--r--
Then reboot​
Click to expand...
Click to collapse
Is there a way to hide apps from framework-side so that i dont have to repeat this process after updating the app?
How to decompile greenify.apk?
rdnomercy said:
How to decompile greenify.apk?
Click to expand...
Click to collapse
Use ApkTool (Using PC) or you can use ApkEditorPro (available on playstore)
I am not able to open Tickle my android.exe ........a grey screen flashes for a second and then closes automatically.

AndroidManifest.xml issues

Alright I used this same AndroidManifest.xml code several times to create my app and it worked just fine now I'm getting 5 different errors and I can't figure out why.
Here's the xml code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="technologx.technologx"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<meta-data
android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAILe2cCZXNBhacXv2fkMpNM5F7FWTdWRUw-r1dFg" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="technologx.technologx.SplashScreen"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="technologx.technologx.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="technologx.technologx.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Here's the errors I"m getting every time I try to create the apk:
Code:
Error:(27, 24) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(28, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
Error:(31, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(40, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:Execution failed for task ':app:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/knye1991/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
Could someone possibly help me fix my issue please?

Create Settings shortcut for Settings$RunningServices

Hi all,
i'm going to extend the existing Settings shortcut widget in Android Nougat with "Running services", which actually can be launched under Settings -> Developer options.
I found following two sections in packages/apps/Settings/AndroidManifext.xml:
Code:
<activity-alias android:name=".RunningServices"
android:label="@string/runningservices_settings_title"
android:exported="true"
android:targetActivity="Settings$ManageApplicationsActivity">
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.applications.ManageApplications" />
</activity-alias>
<activity android:name="Settings$RunningServicesActivity"
android:label="@string/runningservices_settings_title"
android:taskAffinity="com.android.settings"
android:parentActivityName="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.applications.ManageApplications" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
and deleted the activity-alias part and changed the activity part to this:
Code:
<activity android:name="Settings$RunningServicesActivity"
android:label="@string/runningservices_settings_title"
android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.applications.RunningServices" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
I know that there will be a shortcut after building Android, but the last two times i tried it with other changes i ran into RuntimeException. Will this be the right part?
Kind regards
Pat
I know this thread is ancient but it appears on google search results so I thought I would post something I found that works:
Code:
am start -n com.android.settings/.SubSettings -e :settings:show_fragment com.android.settings.applications.RunningServices
This works for android 9 but needs to be run as root.
garbb said:
I know this thread is ancient but it appears on google search results so I thought I would post something I found that works:
Code:
am start -n com.android.settings/.SubSettings -e :settings:show_fragment com.android.settings.applications.RunningServices
This works for android 9 but needs to be run as root.
Click to expand...
Click to collapse
Thanks for posting. It's members like you that make xda great

Question Sbh 52 problem with calling help

Sbh 52 problem with calling from handsfree....it doesnt call at all....when i installed sbh 52.apk a warning came up telling me that this apk is for older android version....i know that is the problem i dont know what can i do to fix it...all the other function wotk properly...i have just unlocked bootloader and installed crdroid....if anyone can help i will be gratefull....thanks in advance
update it can make calls from th e bluetooth device only if i have the screen on and opened the application of sbh52 .....when i lock the screen i cannot do anything,no calls no messages
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="10023"
android:versionName="1.0.23"
package="com.sonymobile.smartconnect.raphael">
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<uses-permission
android:name="android.permission.READ_CONTACTS" />
<uses-permission
android:name="android.permission.BLUETOOTH" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission
android:name="android.permission.VIBRATE" />
<permission
android:label="@ref/0x7f060008"
android:name="com.sonyericsson.extras.liveware.aef.HOSTAPP_PERMISSION"
androidrotectionLevel="2" />
<uses-permission
android:name="com.sonyericsson.extras.liveware.aef.HOSTAPP_PERMISSION" />
<uses-permission
android:name="android.permission.READ_PHONE_STATE" />
<uses-permission
android:name="android.permission.READ_CONTACTS" />
<uses-permission
android:name="android.permission.CALL_PHONE" />
<uses-permission
android:name="android.permission.READ_CALL_LOG" />
<uses-permission
android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<application
android:theme="@ref/0x7f0a000c"
android:label="@ref/0x7f060001"
android:icon="@ref/0x7f020011"
android:name="com.sonymobile.smartconnect.raphael.RaphaelAha"
android:debuggable="false"
android:allowBackup="true">
<activity
android:theme="@ref/0x7f0a000b"
android:name="com.sonyericsson.j2.AhaActivity">
<intent-filter>
<action
android:name="com.sonymobile.smartconnect.raphael.LAUNCH" />
</intent-filter>
</activity>
<service
android:name="com.sonyericsson.j2.AhaService" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.HeadsetHomeActivity"
android:launchMode="2">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<action
android:name="com.sonyericsson.extras.SETTINGS" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.sonyericsson.j2.preferences.DebugPreferences" />
<activity
android:theme="@ref/0x7f0a000b"
android:name="com.sonyericsson.j2.fota.FotaActivity"
android:screenOrientation="1" />
<activity
android:theme="@ref/0x01030055"
android:name="com.sonyericsson.j2.lwm.LwmUpgradeActivity"
android:screenOrientation="1" />
<activity
android:name="com.sonymobile.smartconnect.raphael.preferences.RaphaelExtensions" />
<activity
android:name="com.sonymobile.smartconnect.raphael.preferences.MultiSingleMasterPreferences" />
<activity
android:name="com.sonymobile.smartconnect.raphael.preferences.RaphaelAccessorySettings" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.HeadsetFirmwarePreferences" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.HeadsetUsageTips"
android:screenOrientation="1" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.SpeechEnginePreferences" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.ExtensionPreferences" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.CallHandlingPreferences" />
<activity
android:name="com.sonymobile.smartconnect.headsetaha.preferences.TtsPreferences" />
<activity
android:theme="@ref/0x7f0a000b"
android:name="com.sonymobile.smartconnect.headsetaha.tts.TtsCreator" />
<service
android:name="com.sonymobile.smartconnect.raphael.call_log.RaphaelCallLogService" />
</application>
</manifest>
thats the manifest inside the apk ....i dont know how and where to start .....thanks in advance for any help

Categories

Resources