Using Google Voice Recognition offline


Question

Question



How to force Google Voice Recognition working in offline mode even if an internet connection is available?



Background



I know Google Voice Recognition has an offline mode1, using "speech recognition packs" one can download.2 I'm also aware that this offline-mode is limited, compared to what it can do via Internet. Still, being a little paranoid on Google's data collection I rather avoid using its online facilities – and so I currently don't use Google Voice Search at all.



I'd like to give it a try, though – but always switching to airplane mode for that is not practical. My devices are all rooted, and have the XPosed Framework installed. I know about the GoogleOfflineVoice module – but that hasn't been updated since 9/2014 and is reported to be non-operational with the current Google Search app (plus it's unclear if the dev will pick up the work; I've just asked about that, answer was "Honestly no idea" (dev lacking time)).



Other benefits



It's reported that Google Voice Search is much faster in offline mode. So if one doesn't need the "extended capabilities" of its online mode, faster reaction will certainly be welcome – which makes this question interesting not only for "privacy fetishists", "conspiracy theorists" and "paranoid users" :)



Question (refined):



So I'm looking for alternatives: simple settings preferred, commands definitely accepted, root-solutions are fine. If it requires an app, that app itself should require none or only minimal permissions itself. I'm also open to speech-recognition suggestions not involving Google Voice Search as long as they work offline and don't invade privacy3.



Note:



I'm mainly interested in giving voice commands and maybe doing some dictation.



Related information








1: see: How to use speech-to-text offline?

2: see Google Voice Search requiring internet access even when offline speech recognition pack is installed

3: Internet permission just to download voice-packs is OK, as I can block it as soon as the download is completed. Manual download (placing the files on the SD card) preferred :)


Answer

I have been able to block the shady online service and force offline mode (for termux-speech-to-text) by identifying the user which (only) runs the offending googlequicksearchbox processes (from a root shell):


# /system/bin/ps -Awo uname,cmdline | grep -m1 -E " com\.google\.android\.googlequicksearchbox:search$" | cut -d" " -f1
u0_a41

(note: I specified Android's built-in ps path to avoid conflicts with other user-installed versions of ps which don't take the same parameters - ie. on Termux)


...and adding a firewall rule to block all outgoing traffic for this user's processes:


# iptables -A OUTPUT -m owner --uid-owner u0_a41 -j DROP

(this rule will go away after rebooting or running the same command with -D instead of -A)


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes