Android SMS limit on Android 4.0.4 - android

I am working with phone with Android 4.0.4 (I know, the old one)
Now I need to override limit of 100 sms send per hour (Below android 4.1 there should be limit 100 sms per hour. Since android 4.1 there is limit 30 sms per 30 minutes).
Since Android 4.2 it is possible via adb shell settings put global sms_outgoing_check_max_count.
But I have no idea how to do it on Android 4.0.4 without rooting because there is no "adb shell settings" command. Any idea?
P.S. I am not creating app. I need to override this limit ideally in android settings via adb or by using another app for this (if it exists)

You could do it by creating the application and overriding the SmsUsageMonitor:
com.android.internal.telephony.SmsUsageMonitor
It should basically work on any phone, without rooting it first.

Could you try to follow theses steps via ADB :
1.Open Command Terminal
2.Type in adb shell hit enter
3.Type in su hit enter
4.Type in sqlite3 /data/data/com.android.providers.settings/databases/settings.db hit enter
5.Type in INSERT INTO secure (name, value) VALUES('sms_outgoing_check_max_count’, 9999); hit enter
6.Type in INSERT INTO system (name, value) VALUES('sms_outgoing_check_max_count’, 9999); hit enter
7.Type in .exit hit enter (you should now see a hash tag again instead of sqlite>. If not conitune typing in .exit and hitting enter until you are)
8.Type in sqlite3 /data/data/com.google.android.gsf/databases/gservices.db
9.Type in INSERT INTO main (name, value) VALUES('sms_outgoing_check_max_count’, 9999); hit enter
10.Again exit back to where the command line has a hashtag
11.Type in reboot and hit enter.
I don't have a phone with Android 4.0.4, so i can't confirm that it will work
Happy testing !

you have to use abd command to open that restrictions here is the link for tutorial change sms limit
1.Go to the android platform tool directory
`(C:\Users\username\AppData\Local\Android\Sdk\platform-tools)``enter code here`
open command shell by using Shift+mouserightclick and enter this command
adb shell settings put global sms_outgoing_check_max_count 5
settings put global sms_outgoing_check_interval_ms 9000000
I am actually reducing the number so Android warns me if I have sent more than 5 SMS messages within 30(9000000) minutes. Change “5” to whatever number you want

What exactly do you want to acheive with over 100 SMS per hour?
I am sure there is a way more efficient way of sending your data for example through
a wireless network or mobile data. You would hardly manage to reach the data limits of
those networks.
Just saying ... try only to do it over SMS if there really is NO other way of sending it.
Good luck!

Related

Open an android application via shell command in python script

So I have a python script to test an android app with the monkeyrunner tool and at a certain point in the script, I have command to launch the application on the mobile phone. The command is: device.shell('monkey -p com.blah.blah -v 500') and it works perfect. But my question is: "What is the meaning of the number 500?"
I found this command on a forum and some users are using the value 300 instead of 500 or other values.. For me it works with all of them but not without it. I just need to understand what the number does so I can fully understand what I do.
As per Android Documentation this command will launch your application and send 500/300/200(as specified by you) pseudo-random events to it such as clicks, touches, or gestures.

Automatically configure Android settings?

At work, we have an Android-based infotainment system that we're constantly deploying new versions to, on a half-dozen different test benches. The deployment script does the moral equivalent of:
for apk in ${apk_files}; do
adb install -r ${apk]
done
After this, we need to manually execute the following steps:
Set the home app to be one of our just-installed applications (Always, not Just Once)
Become a developer, and enable the Stay Awake option
Select the Google TTS engine for text-to-speech functionality rather than Pico
Executing these steps after each deploy is a giant PITA. People often forget one or more steps, and leave the test bench in a non-working state. This results in a bunch of 'bogus' bug reports that waste everbody's time.
Is there some way (using adb, perhaps) that we can automate these steps?
You can disable other home apps with adb shell pm disable .... I don't think there's a command line option to set apps as default. I remember looking into this before and there was a "preferred application" XML file where this was stored. If you want to look into it, the magic happens in PackageManagerService.addPreferredActivityInternal(). Looks like it writes the data to a file on disk: package-restrictions.xml. I suppose it's possible you could figure out the format thereof and write the file (you'd need root).
This is controlled by a system settings, "stay_on_while_plugged_in". You can set it using adb shell settings system put ....
The TTS engine is stored in a secure setting, "tts_default_synth". You can see the value like,
$ adb shell settings get secure tts_default_synth com.svox.pico
com.svox.pico
And you can set it with adb shell settings put secure "tts_default_synth" <the value>.
I noticed that if the value was not been previously set, when you get the value using the settings command you get null and it's not listed in settings list, even though there is a default value. As of Android 6 (I think), settings are no longer in a DB but rather are stored in XML files in /data/system/users/0/settings_*.xml. You can see the values therein.

Turning off second SIM via adb shell/Tasker - using activities/intents

I have a Xiaomi Mi6, which supports two SIMs. I need to figure out how I can switch the second SIM (SIM2) off outside business hours using Tasker.
I've got as far as figuring out how to open the settings page for SIM2 with Tasker:
Action: android.intent.action.MAIN
Cat: Launcher
Extra 1: subscription_id:1
Extra 2: slot_id:1
Package: com.android.phone
Class: com.android.phone.settings.MultiSimInfoEditorActivity
Target: Activity
which brings up the settings page for SIM2, like so. However, I can't figure out how to toggle the SIM on or off.
In hope of finding something useful I have decompiled com.android.phone (TeleService.apk) but as I don't know Java I haven't an idea where to go from here. I know there is a Java solution already on SO here but I have no idea if it works or how to adapt it to Tasker.
The decompiled MultiSimInfoEditorActivity can be found here. I have also taken a logcat of what occurs when the SIM is switched off and on again.
I greatly appreciate any help!
I've solved the issue, although it may not work for all versions of Android. I've only tested it with my Mi6 running MIUI v9, Android build 8.0.0. It requires root.
After studying the SO solution linked above in my question I noticed that the code was retrieving the index number of a particular telephony function, which it would then use to run a command to switch off mobile data. Using this, I've found a way to actually switch the SIM off.
Googling produced this page from Haotian Deng that showed these indexes for the service call function were listed inside the ITelephony.aidl file. These are what were being fetched by the Java code . None of these worked for the Mi6, but linked to this page which explained the service call command:
# service
Usage: service [-h|-?]
    service list
    service check SERVICE
    service call SERVICE CODE [i32 INT | s16 STR] ...
Options:
  i32: Write the integer INT into the send parcel.
  s16: Write the UTF-16 string STR into the send parcel.
Armed with this I found that the indexes were listed in com.android.internal.telephony.ITelephony in the devices' framework.jar.
So, to get the required index out of your device, you'll need to run the following commands from command prompt:
Download jadx from here
ADB pull the devices framework.jar (adb pull /system/framework/framework.jar)
Open the .jar file with 7-Zip and extract the *.dex files.
Open each .dex file with jadx-gui until you find the one with the following tree: com.android.internal.telephony.ITelephony
Search for the item TRANSACTION_setSimPowerStateForSlot. Note the = x after it; this is the index number.
Now you have the index number you can test the following command in adb shell (or Tasker, with the "run shell" function). You will need to "su" in shell, or set Tasker to "Use Root".
service call phone x i32 y i32 z
Where:
x = index number you fetched previously,
y = your subscription ID (generally, SIM1 = 0, SIM2 = 1)
z = whether on (1) or off (0)
Of course, now that you can execute it in Tasker you can now switch either SIM off at specific times.
I've verified that it does indeed switch the SIM off (calls go straight to voicemail right after this command is executed) but I'm unsure of any further effects this switch has.
Enjoy!

Open and interact with android application from command line

I've loaded Android onto VirtualBox and would like to do the following:
1) Via the command line (Terminal Emulator), open up a downloaded app (call it Lyft)
2) Interact with the app as if I were a user working with the app normally on a phone --
2a) Pass my username/password to log in
OR
2b) Pass in new account credentials to create a new account
I imagine this thing is possible, given that Android is just a modified version of Linux but I'm not entirely sure where to get started. How could one do this sort of thing to emulate the experience of using the mobile app, without an API and without actually touching a phone?
You can use AndroidViewClient/culebra to create a script that does all you want. culebra --gui can also be used to create the script just pointing and clicking on the UI (check https://github.com/dtmilano/AndroidViewClient/wiki/Culebra-GUI).
You can launch the app , but accessing input fields is possible if the login form fields request focus immediately after launching . Otherwise , an interaction to click on the form field is a must
For launching the app , go to the android sdk directory or if its added to the path - connect the phone and run
adb shell
adb shell monkey -p com.android.chrome -c android.intent.category.LAUNCHER 1
where com.android.chrome should be replaced by the package name of the app you want to launch

how can i use 'adb shell' command to know application response or current activity

I have created a batch file that fires adb shell command to start activity, send events to enter text into username and password text fields & click login buttons to navigate to other activity(screen).
how can i know that application navigate to other activity or want to know the response that tell me if login successful or not using shell commands.
Thanks,
Bhushan
Dollop, where I work, provides a record-and-play-back tool for Android that will do the things you suggest and save you the hassle of interacting with low-level shell commands. (It is currently limited to running on Windows in communication with Android devices). It's easy to configure and use, requires no programming, runs against real devices (which do NOT have to be rooted) and automatically saves screenshots as it plays tests. I'd love to hear your feedback.
try to get process (ps aux | grep xxxxx ) information to know the activity running or not

Categories

Resources