Noot Tablet "Operating Mode" - Barnes & Noble Nook Tablet

On a rooted Nook Tablet, you can access a FAT partition at mount point /rom. Under the "devconf" directory is a configuration file titled "OperatingMode". Right now it contains the value "Normal" (no trailing CR or LF). The Nook Color did not have this file.
One area of experimentation is to rename that file (to save it), and then create a replacement one with various values, rebooting each time; eg:
mount -o remount,rw /rom /rom
cd /rom/devconf
mv OperatingMode OperatingMode.org
echo -n "Debug" > OperatingMode (the "-n" option suppresses the writing of a LF)
Other values to try are "Test", "Admin", "Update", "Factory", etc. Who know if any values will affect rooting, checking for signing, etc.
WARNING: I have no idea if doing any of this will brick your device. Experiment at your own peril.
EDIT: Please don't ask me what various values will do. Read the above. I don't know. That's why I posted this as an experiment for others to try if they wish.

Have you tried this? Any idea why it would do?

Perhaps try "Debug"?

I found this, maybe it's something related.

I wonder if that's a file which might reflect what boot mode the device is in - that is, the range of values can be set using variations on the reboot command. Some devices write files at boot time, or rewrite them, to create known states at each boot. (The yp-g70 recreates its LED configuration, badly, on every boot.)
The "OEM reboot codes" section of http://tjworld.net/wiki/Android/HTC/Vision/BootProcess#FastBootRestart
discusses a number of reboot flags that can be passed via ADB. Depending on what flag is passed, they put the device in different modes.
It might be interesting to try passing commands via adb reboot options and see if the file content is changed - but you'd need to be able to interrupt the boot process *and* have a viable ADB shell or other way to pull data from the device to do that. I don't know of a way to do that, but it might be possible -- I think I've seen NTs booting Clockwork now, and at least some CWR boot modes have ADB support, or used to.
Various commands issued to rebooted to bootloader phnes have been used to help unlock bootloaders, eg,
http://www.androidcentral.com/how-unlock-galaxy-nexus-bootloader is a discussion of this on the Galaxy
I may not understand that and I may be wrong.

I just searched through the source. I'd say this is likely for the Nook app or something.
Code:
[email protected]:~/Desktop/nook_tablet_1-4_Source$ grep -r "OperatingMode" ./
./kernel/android-2.6.35/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c:| Function Name : int i_APCI3XXX_AnalogInputConfigOperatingMode |
./kernel/android-2.6.35/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c:static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev,
./kernel/android-2.6.35/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c: i_APCI3XXX_AnalogInputConfigOperatingMode(dev,
Code:
[email protected]:~/Desktop/nook_tablet_1-4_Source$ grep -r "Operating Mode" ./
./kernel/android-2.6.35/drivers/staging/rt2860/rtmp_def.h:/* 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case */
./kernel/android-2.6.35/drivers/net/stmmac/dwmac100.h:#define MAC_CONTROL_OM 0x00200000 /* Loopback Operating Mode */
./kernel/android-2.6.35/drivers/net/tulip/dmfe.c: /* Operating Mode Check */
./kernel/android-2.6.35/drivers/net/tulip/de4x5.h:#define OMR_OM 0x00000c00 /* Operating Mode */
./kernel/android-2.6.35/drivers/net/tulip/de4x5.c: s32 csr6; /* Saved Operating Mode Reg. */
./kernel/android-2.6.35/drivers/net/wan/lmc/lmc_var.h:#define TULIP_CMD_OPERMODE 0x00000C00L /* (RW) Operating Mode */
./kernel/android-2.6.35/arch/blackfin/mach-bf548/include/mach/defBF54x_base.h:#define CNTMODE 0x700 /* Counter Operating Mode */
./kernel/android-2.6.35/arch/blackfin/mach-bf548/include/mach/defBF54x_base.h:#define XFR_TYPE 0xc /* Operating Mode */
./kernel/android-2.6.35/arch/blackfin/mach-bf518/include/mach/defBF516.h:#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
./kernel/android-2.6.35/arch/blackfin/mach-bf518/include/mach/defBF51x_base.h:#define CNTMODE 0x700 /* Counter Operating Mode */
./kernel/android-2.6.35/arch/blackfin/mach-bf527/include/mach/defBF527.h:#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
./kernel/android-2.6.35/arch/blackfin/mach-bf527/include/mach/defBF52x_base.h:#define CNTMODE 0x700 /* Counter Operating Mode */
./kernel/android-2.6.35/arch/blackfin/mach-bf537/include/mach/defBF537.h:#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
./kernel/android-2.6.35/arch/arm/mach-at91/include/mach/at91rm9200_mc.h:#define AT91_BFC_BFCOM (3 << 0) /* Burst Flash Controller Operating Mode */
./kernel/android-2.6.35/Documentation/power/regulator/consumer.txt:5. Regulator Operating Mode Control & Status (dynamic drivers)
grep: warning: ./android/alsa-lib/include/alsa: recursive directory loop
./u-boot/include/asm-mips/inca-ip.h:/***SCC Control Register (Operating Mode)***/
./u-boot/include/asm-mips/inca-ip.h:/***SCC Control Register (Operating Mode)***/
./u-boot/board/tqm8xx/tqm8xx.c: * | +----------- Operating Mode = Standard
./u-boot/board/LEOX/elpt860/elpt860.c: * | +----------- Operating Mode = Standard

Related

cant get android sqlite select statement to work

I'm trying to select the items that have expired in my database but nothing is ever returned. I've tried the following all dates in the format yyyy-mm-dd and tried date format yyyymmdd
Code:
select * from productTable where columnExpiration < date( currentDate)
When that didn't work I tried:
Code:
Select* from productTable where columnExpiration < currentDate
and when that didn't work I tried
Code:
SELECT * FROM "+ productTable + " WHERE datetime("+columnExpiration+") < datetime(currentDate)" ;
Any suggestions? This is really starting to drive me crazy. Thanks
Code:
select * from productTable where columnExpiration < date( currentDate)
Is currentDate a variable you have declared? Have you tried?
Code:
select * from productTable where date(columnExpiration) < date('now')
or
Code:
select * from productTable where date(columnExpiration) < date(currentDate)
We really don't have enough info from your code to know if you are using the actual table names or variables.
If you're building your SQL statement as a string and using rawQuery, you'll need to start the string with the quotation mark.
SELECT * FROM "+ productTable + " WHERE datetime("+columnExpiration+") < datetime(currentDate)"
Should be:
String sql = "SELECT * FROM productTable WHERE datetime(columnExpiration) < datetime(currentDate)";
If you're using variables, you'll want to end the quote and use the addition symbol like you did in your example.
String sql = "SELECT * FROM "+productTable+" WHERE datetime("+columnExpiration+") < datetime("+currentDate+")";
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

[Root][4.4.2 ND7]GhettoRoot (Towelroot port) v0.3.2

GhettoRoot (Towelroot port) v0.3.0.1, v0.3.2 Testing (looking for new owner)
Code:
*** Disclaimer
This project is licensed under the GPLv3. Bundled third-party components
have different licenses, but these components are bundled or downloaded
as separate executables; all appropriate LICENSE files are included, along
with links to source code.
THIS UTILITY MAKES USE OF A KERNEL EXPLOIT TO GAIN ROOT PRIVILEGES
AND MAKE MODIFICATIONS TO YOUR DEVICE'S FILESYSTEM. IT WILL
PROBABLY WILL VOID YOUR WARRANTY. IF YOU DO NOT FOLLOW THE
INSTRUCTIONS, YOU COULD END UP WITH A BRICK. EVEN IF YOU DO
FOLLOW THE INSTRUCTIONS, YOU MIGHT END UP WITH A BRICK.
ROOTING IS A POTENTIALLY DANGEROUS PROCESS AND, WHILE I WILL TRY
TO HELP IF YOU HAVE TROUBLE, I CANNOT ACCEPT RESPONSIBILITY
FOR RANDOM MISFORTUNE, COSMIC RAYS, ETC.
Help Wanted
My activity with this project will be diminishing. As far as I know, everything as of now "just works" with the SCH-I605, and that's all I really wanted to accomplish from the start. I'm hoping someone will take it over -- ideally someone who'd be willing to look into fixing the code to support other devices. It's open-source, so you can start looking at it now and see if you're interested. Compiling is simple... Just install the NDK and use ndk-build, or 'make' in Linux.
If you'd like to take over the development, and you've worked on projects like this before, I'd greatly appreciate it; perhaps we can get a mod to transfer this thread to you, or you're free to start a new one. After a certain point, I'll stop monitoring threads and messages, so you're free to go ahead and take charge without waiting to hear from me, if you'd like.
Post elsewhere, if you'd like, to let people know that this code is available and might be adjustable for other devices. It really shouldn't be difficult for someone with a background with this stuff.
Problematic areas are likely the iov code (search "Not sure if this is entirely correct") and also the limit_offset stuff (search "ph->limit_offset != 0"), but I have no way of knowing for sure if there's anything wrong with limit_offset since I don't have an applicable Samsung device. There are scattered references to the sources I used to figure out some of this in the README and in ghettoroot.c itself.
That's all, folks. Thanks.
Introduction
This is an automatic root method for your Note 2 (or, potentially, other device) based on code for the CVE-2014-3153 exploit.Unlike towelroot, it is a tethered root in that it requires you to connect your device to a computer to perform the root. However, it only requires a computer the one time; root sticks.
This code appears to have been reverse-engineered from towelroot itself (but not the latest version), so Geohot gets the credit for this one. This is more like a bugfix which only works (for sure) with the Verizon Galaxy Note II so far. The changes from the towelroot-equivalent exploit code are incredibly minimal. Only a few lines of code need really be changed to get it working, but devices incompatible with towelroot are becoming ghetto, so there wasn't a lot of motivation for the problems to be investigated.
GhettoRoot attempts to walk you through the prerequisites for the rooting process and give you hints if there are problems; it does the dirty work itself.
Click to expand...
Click to collapse
Installation instructions
Please see the LICENSE file for details on copying and usage (GPLv3).
This software will attempt to root your device and might void its warranty.
Please BACK UP ANYTHING IMPORTANT before continuing.
Note: By default, v0.3.0.1 attempts to disable Knox and OTA update packages.
If you'd rather this not happen, scroll to CONFIGURATION.
Install USB drivers for your device if needed, for Windows.
Koush's drivers are a good bet. 'Download Windows Installer', and run:
https://github.com/koush/UniversalAdbDriver
Download the busybox-arm4vl binary. The installer will help you with this.
You can get it manually from http://www.busybox.net, specifically from
http://www.busybox.net/downloads/binaries/latest
Place the binary in the files/ folder. It will be automatically renamed
to 'busybox'.
Enable USB debugging. If necessary, go to 'About device' under Settings and tap
the Build number several times to enable the Developer options. Go back, and
go to Developer options, and enable USB debugging there.
Plug in your device to your computer.
Unlock your device's lockscreen if it is locked.
Manually choose a USB mode from the notification, or wait for the Installer mode
phase of USB to end, which takes about 30 seconds. If your device does not have
an Installer mode, skip this. If you're not sure, just wait the 30 seconds.
If/when a popup appears asking for authorization for your PC, allow it.
If a popup does not appear and has never appeared before, or you clicked Cancel,
or you're just having a lot of trouble, go to Developer option and toggle USB
debugging off and on again. Then, try again. You may need to disconnect and re-
connect your device or tap Revoke USB authorization if nothing seems to help.
On Linux or OS X, enter a terminal at the folder you extracted the zip file to,
and type chmod +x INSTALL.sh.
To run, execute INSTALL.cmd on Windows.
On Linux or OS X, type the following in the same terminal: ./INSTALL.sh
Follow the on-screen instructions.
Click to expand...
Click to collapse
Configuration
v0.3.2 config.txt details:
Code:
Open up config.txt, and customize as follows, adding or removing arguments
as you see fit. It should always start with ./root.sh
*** ENSURE THE CONTENTS OF config.txt IS A *SINGLE LINE*.
*** COMMENTS WITHIN config.txt ARE NOT PERMITTED.
Default: ./root.sh --root --deknox --deota --desurveillance
Former default: ./root.sh --root --disable-knox --disable-ota
Usage: ./root.sh [OPTION] [COMMAND]
With no arguments, --root is implied.
Main options
--root, --supersu Install SuperSU (permaroot)
--deknox Remove Knox (recommended)
--deota Remove OTA packages (recommended)
--debloat Remove Bloat (recommended)
--desurveillance Remove some surveillance (recommended)
--disable-ota Disable OTA update-related packages
--disable-knox Disable Knox packages
--really-remove Actually remove things instead of
putting them in $jaildir
--undo Try to undo the specified option.
If you had used --really-remove then
it won't work for deknox, debloat, deota.
Anti-convenience options
--no-mount-rw Don't mount / and /system read-write
--no-sepermissive Don't set SEAndroid to permissive
--no-chmod-scripts Don't chmod 0755 all scripts in
$TMPDIR
COMMAND: Command to be run after other options.
Arguments may follow.
If unspecified, will look for and run custom.sh.
ex. ./root.sh --root
./root.sh --root --undo
./root.sh --root --deknox --deota --debloat
./root.sh cp /sdcard/build.prop /system/build.prop
[/HIDE]
Thanks To/Credits
Code:
geohot for developing [URL="http://forum.xda-developers.com/showthread.php?t=2783157"][U]towelroot[/U][/URL], on which
this code is DIRECTLY based! Reverse-engineered/decompiled, but not by me.
I don't think anyone had a licensing claim on towelroot or this code so I made it GPLv3.
fi01 for his shared [URL="https://gist.github.com/fi01/a838dea63323c7c003cd"][U]exploit code[/U][/URL] on github:
tinyhack.com for the [URL="http://tinyhack.com/2014/07/07/exploiting-the-futex-bug-and-uncovering-towelroot/"][U]helpful post on the Futex bug[/U][/URL]:
chainfire, for [URL="http://forum.xda-developers.com/showthread.php?t=1538053"][U]SuperSU[/U][/URL]!
THANK YOU for the lenient distribution policy.
NetworkingPro at xda-developers for the assistance to all. :)
Other folks at xda-developers for testing and offering support.
Google, of course, and the Android Open Source Project.
Changelog & Download
A note on v0.3.2 Testing:
Code:
WARNING: ESPECIALLY with this version, PLEASE make sure you have backups of
your important applications and their data!
Alternatively, you might be safer changing config.txt to the
old value as listed below.
Code:
This version is called 'Testing' because I haven't really had time to test it
fully, and there's a bunch of new stuff, namely the de* (*-removal) scripts.
I DON'T KNOW HOW WELL THE DE* CODE WORKS. You may want to give me some time
to see how my device holds up before testing yourself, or check out
files/root.sh to see what the new stuff does, but I do need other people to
test as well, so I've changed the config.txt to include the new features,
sans --debloat.
If you DO NOT want to try the new features, change config.txt to the following:
./root.sh --root --disable-knox --disable-ota
However, even the --disable-knox and --disable-ota code has changed.
Your mileage may vary!
Search files/root.sh for ### DEBLOAT, ### DEKNOX, ### DEOTA, ## DESURVEILLANCE,
etc. to see exactly what they do.
Code:
Current changelog: [U][B][URL="http://forum.xda-developers.com/devdb/project/dl/?id=8457"]v0.3.2 [I]Testing[/I][/URL][/B][/U] (2014/09/08)
[fixed?] drowsy attempt to fix a silly bug with default modstring
[new] new default config.txt: --deknox, --deota, --desurveillance
[new] --deknox, --deota, --debloat, --desurveillance, --really-remove,
--undo features added. See README.txt or search files/root.sh
for ### DEBLOAT, ### DEKNOX, ### DEOTA, ## DESURVEILLANCE,
etc. to see exactly what they do.
[change] starting to change verbage from 'phone' to 'device'
[note] v0.3.1 would have been too confusing, so straight to v0.3.2.
[U][B][URL="http://forum.xda-developers.com/devdb/project/dl/?id=8439"]Download v0.3.0.1[/URL][/B][/U] (2014/09/07)
[fixed] Issue with find.exe when other find executables are in PATH.
[URL="http://forum.xda-developers.com/devdb/project/dl/?id=8438"]v0.3.0 (2014/09/07)[/URL]
[new] License: this project is licensed under GPLv3.
[new] Added ADB binaries for Linux and Mac OS X.
[note] This means we have experimental & untested support for Intel Macs
[changed] Restructuring of post-root procedures:
No more hard-coded commands for installing SuperSU, etc.
These things are present in files/root.sh instead, and
may be freely edited.
[changed] Command-line parameters have DRASTICALLY changed.
See the README.txt.
[new] Added modstrings.txt, config.txt
[changed] Busybox no longer bundled due to licensing concerns;
curl added for downloading busybox, instead.
Older changelogs:
Code:
v0.2.2 (2014/09/04)
Fixed INSTALL.cmd hanging when launching ADB, or not running
properly as an administrator.
Further improved error handling, with more detailed steps for
troubleshooting, and retries.
User acknowledgment now required for certain tasks with (Y/N).
Fixed date on previous update being in the future... Hmm...
v0.2.1 (2014/09/03)
** pulled, did not fix adb hang issue after all **
v0.2 (2014/09/03)
Code cleaned up a bit, but still gives verbose debug messages
since they might be important. Can disable those with --brief.
Some error handling in the install script.
Everything is orchestrated from a single batch file ("one-click",
though multiple scripts are still used internally).
Should work properly with Windows and Linux, and come
bundled with ADB for Windows. Thanks, NetworkingPro!
v0.1 (2014/08/31)
Initial release.
LINK TO FORMER THREAD HERE
Apologies in advance for any kind of faux pas I've made or rule I've broken. There always seems to be something...
Code:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GhettoRoot is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* GhettoRoot is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with GhettoRoot. If not, see <http://www.gnu.org/licenses/>. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
hmmm
If I hadn't just killed my phone (perma red angry text of death) I would definitely help test. Of course you have me to thank as well. Why? Because I knew as soon as I broke my phone, or upgraded someone would come out with a root fix. So you're welcome. However there is still a good chance that the new "probably very used" replacement phone I get from Verizon will be 4.4.2 already so then I will try this out. Unless this is some sort of very cruel trick played on those of us that can't afford to upgrade our phones every other month, in which case shame on you, and I will still try it until I am blue in the face. And crying.
J_3dgar_H00v3r said:
If I hadn't just killed my phone (perma red angry text of death) I would definitely help test. Of course you have me to thank as well. Why? Because I knew as soon as I broke my phone, or upgraded someone would come out with a root fix. So you're welcome. However there is still a good chance that the new "probably very used" replacement phone I get from Verizon will be 4.4.2 already so then I will try this out. Unless this is some sort of very cruel trick played on those of us that can't afford to upgrade our phones every other month, in which case shame on you, and I will still try it until I am blue in the face. And crying.
Click to expand...
Click to collapse
Nope, not a trick! My username looks a bit dubious even to me, but it was randomly generated by KeePass.
I am getting, "error: device unauthorized. Please check the confirmation dialog on your device." I am not getting anything on my phone. Any thoughts?
Im testing this now. Will let you know in a few mins. So far, so good.
Edit: This worked like a champ for me. Root achieved. For anyone wanting to do this, please follow these steps:
Run clean.cmd
Run prepare.cmd
Run root.cmd
Do these in this order. I went ahead and added a pause to each batch (Except root.bat that already had one) to ensure everything was kicking off as expected. Sorry if this was outlined in the OP, but Im sort of a "D personality" and wont read a lot of fluff.
Thanks!
Seems to be running good here to ... some more fiddling and see how things go but I now have root on 4.4.2. Thanks
Update: no problems also Knox has NOT been tripped and no other issues.
Worked for me!
I tried this, and it worked like a charm. So far, no issues.
Thank you!!!
=D
i dont think i've been this excited since safestrap was in the works for the N2!!! cant wait to try this when i get home!!! thanks dev
I still don't have root. Not sure what went wrong. My phone restarted like it was supposed to but not root.
NetworkingPro said:
Im testing this now. Will let you know in a few mins. So far, so good.
Edit: This worked like a champ for me. Root achieved. For anyone wanting to do this, please follow these steps:
Run clean.cmd
Run prepare.cmd
Run root.cmd
Do these in this order. I went ahead and added a pause to each batch (Except root.bat that already had one) to ensure everything was kicking off as expected. Sorry if this was outlined in the OP, but Im sort of a "D personality" and wont read a lot of fluff.
Thanks!
Click to expand...
Click to collapse
Does clean.cmd wipe all data? I only ran root.cmd and the phone rebooted like it was supposed to, but Titanium Backup doesn't register my device as rooted.
Tkun said:
Does clean.cmd wipe all data? I only ran root.cmd and the phone rebooted like it was supposed to, but Titanium Backup doesn't register my device as rooted.
Click to expand...
Click to collapse
It just cleans up old root files that might have been part of previous root methods, or failed attempts.
NetworkingPro said:
It just cleans up old root files that might have been part of previous root methods, or failed attempts.
Click to expand...
Click to collapse
Thanks! Using your steps it worked and my phone is rooted!
Also, thanks OP for providing this solution! I was worried us 4.4.2 users would never again have root. I can finally backup and restore my apps again using Titanium Backup.
Tkun said:
Thanks! Using your steps it worked and my phone is rooted!
Also, thanks OP for providing this solution! I was worried us 4.4.2 users would never again have root. I can finally backup and restore my apps again using Titanium Backup.
Click to expand...
Click to collapse
Glad I could help, I went ahead and read through the source code before I did it, so had a pretty good idea of what it was doing.
---------- Post added at 10:38 PM ---------- Previous post was at 10:36 PM ----------
25yvdgpo06 said:
tl;dr: This is a modified version of [basically towelroot] to work with the Verizon Galaxy Note II (SCH-I605) VRUFND7 firmware.
Currently, a PC with the Prerequisites is required. If someone wants to package this into an APK, that's great and it may remove the PC requirement.
I'm too new to be allowed to post in the developer forums (which is probably for the best), and I don't consider myself much of a developer anyway, but with a couple sleepless nights, a little bit of determination, and a lot of sugar cereal (but not enough milk!!!!), I've modded some code based on Towelroot to get the CVE-2014-3153 exploit to work with our phone and its 3.0.31 kernel. Who knows - it might work with other phones, too, but this is the only one I have right now.
WARNINGS
YOUR MILEAGE MAY VARY. THIS WILL PROBABLY VOID YOUR WARRANTY. PLEASE BACK UP IMPORTANT FILES FIRST, JUST IN CASE AND AS A GOOD PRACTICE.
Your phone will reboot after rooting which could cause data loss if any apps are in the middle of writing data, so please close open apps and wait a few moments before rooting! If your phone is just starting up, give it some time to initialize before rooting. These recommendations should be followed prior to almost any automated reboot of your phone, but particularly when rooting.
This does not flash anything, so as far as I'm aware, it will not trip KNOX but I really don't know! It DOES try to disable KNOX, which might trip it. I don't know how any of that works.
There *shouldn't* be any problems with this, but if there are, keep in mind that you made the choice to try it, knowing it's relatively untested. As of first posting of the binary, I am the only person who has tested this.
PREREQUISITES
You will need access to a computer with the following things:
Android SDK
ADB in your PATH (in platform-tools at your Android SDK install path)
Your phone's USB drivers
USB debugging enabled
INSTRUCTIONS
Connect your phone to your computer.
Close any active applications on your phone so you don't lose data when your phone reboots. If your phone just started, give it time to initialize.
Once active apps are closed, wait 10-20 seconds or so for the phone to be done doing stuff.
With that out of the way, extract the zip file if you haven't already.
The procedure will execute immediately when running the scripts, so this is your last chance to back out! Do not proceed if you don't feel ready!
Run root.cmd on Windows, or root.sh on Linux and maybe OS X.
Allow your phone to reboot after the process, and enjoy root. Let me know if you got errors or it didn't work.
This has not happened to me (or anyone else to my knowledge, since I just released this), but if it goes into a loop trying to root and keeps failing, go ahead and CTRL-C to end it, and then close the command window. If worst comes to worst, shut off your phone or pull the battery.
QUESTIONS
Q. What's the difference between this and Towelroot, then?
A. There are a few modifications to the reverse-engineered source code of Towelroot, or at least I assume that's what the code is, since Towelroot isn't open source, as far as I know. There is a github link to that source at the top of ghettoroot.c, included in the zip file. You can do a diff comparing ghettoroot.c to the github code to see exactly what I changed.
Q. And this will get me rooted, even if I have a locked bootloader?
A. Yeah. It won't unlock your bootloader, though. If you find me some info on how the previous bootloader unlocks were found and/or what they involved, I might try to look into it...
Q. You mentioned command-line options. I tried out -? or --help and saw them but it's nearly impossible to read.
A. The help is a mess, but this usage message -- to be included in a future version -- should be more...useful.
The root.sh and root.cmd scripts should pass your arguments along to the ghettoroot binary, so where you see ghettoroot in the usage message, replace with ./root.sh (be sure to chmod +x it) or root.cmd.
Code:
Usage: ghettoroot METHOD ALIGN LIMIT_OFFSET HIT_IOV EXCLUDE_FEATURE
USERCMD USERARGV
All parameters are optional. The first non-number and following arguments
will be interpreted as the user command and user arguments.
ex. ghettoroot <-- runs with defaults, attempting to detect some settings
ghettoroot 0 1 0 4 0 <-- standard, default root for most phones.
ghettoroot mkdir /system/happyface <-- does everything, then that...
ghettoroot 0 1 0 4 7 cp /sdcard/build.prop /system/build.prop
^ copies a modified build.prop but does not permaroot, etc.
Formatting key: [Default value]PARAMETER NAME: value range: description
[0]METHOD: 0-sendmmsg, 1-recvmmsg, 2-sendmsg, 3-recvmsg:
This typically does not need to be changed.
[1]ALIGN: 0/1: attack all 8 IOVs hit with MAGIC
This behavior may/may not match up with original ALIGN behavior.
Currently, enabling this causes HIT_IOV to go unused.
[0]LIMIT_OFFSET: 0-8192: offset of addr_limit in thread_info, multiple of 4
If desperate, download manufacturer's kernel sources to check headers.
Rarely necessary, but 7380 is needed for newer Samsung phone models.
[4]HIT_IOV: 0-7: offset to rt_waiter in vulnerable futex_wait_requeue_pi.
see vulnerable futex_wait_requeue_pi function for your kernel if needed.
[0]EXCLUDE_FEATURE: 0-31: all features are enabled by default.
to disable, add up the numbers for any/all of the following features:
1 Install SuperSU
2 Disable Knox
4 Disable OTA Updates
8 SEAndroid Permissive (temporary)
16 Mount /, /system read-write (temporary)
Example values for EXCLUDE_FEATURE:
31 temp roots solely to run a user command, immediately after root.
Reboot is still required.
6 does *not* disable Knox or OTA, but installs SuperSU.
7 does *not* disable Knox or OTA updates, or install SuperSU.
Still remounts /, /system as rewrite and turns off SEAndroid.
Meant to be used with a user command, or else it is pointless.
USERCMD: Command to be run after all other enabled featuers, if any.
USERARGV: All further arguments are passed along to the user command.
I don't know how well any of those arguments are working. You shouldn't need any of them for this phone.
Q. I think ToiletRoot would have been a better name.
A. Hmm... Me too. Oh well.
CREDITS
GeoHot, developer of Towelroot, on which this is based, and without whom it would be impossible.
Chainfire, developer of SuperSU, which is bundled.
Somebody, developer/compiler of busybox, which is bundled. To be honest I don't know where it came from. It was lying around on my PC. I know, I know... just let me know if I really need to make my life revolve around fixing political issues like this and I will try.
fi01, person on Github sharing code publicly
Apologies in advance for some kind of faux pas I've made or rule I've broken. There always seems to be something(s).
Click to expand...
Click to collapse
Where did you pick this up at? I want to go ahead and rewrite it to be more efficient later tonight, but I kind of need to know where it came from?
---------- Post added at 10:39 PM ---------- Previous post was at 10:38 PM ----------
Oh well, screw it... I'll go ahead and clean it up later.
NetworkingPro said:
Glad I could help, I went ahead and read through the source code before I did it, so had a pretty good idea of what it was doing.
---------- Post added at 10:38 PM ---------- Previous post was at 10:36 PM ----------
Where did you pick this up at? I want to go ahead and rewrite it to be more efficient later tonight, but I kind of need to know where it came from?
---------- Post added at 10:39 PM ---------- Previous post was at 10:38 PM ----------
Oh well, screw it... I'll go ahead and clean it up later.
Click to expand...
Click to collapse
It is the first link at the top of ghettoroot.c, fi01's cube-towel.c page. (Every page linked in ghettoroot.c was helpful.)
I am planning to clean it up a bit myself this evening, but if someone wants to repackage the entire thing and re-post to a new thread, go for it! Or you can wait until I clean things up a little bit and then do it... Or just not. Whatever you want to do. I'm not very concerned about who gets credit for what, though a mention of my randomly-generated name might be nice.
Thanks to those who've helped others so far, and those who've shared success/failure.
EDIT: Wanted to point out that there were very few changes from fi01's original cube-towel.c code that were necessary to get the exploit itself to work. The rest is fluffy stuff, in addition to execution of useful commands once root was gained rather than being a proof-of-concept alone.
Here is *exactly* what was changed in the exploit code. Very minimal, you will see.
Setting of processor affinity added as recommended at tinyhack.com's "Exploiting the Futex Bug and uncovering Towelroot" post, and called in main():
Code:
void setaffinity()
{
pid_t pid = syscall(__NR_getpid);
int mask=1;
int syscallres = syscall(__NR_sched_setaffinity, pid, sizeof(mask), &mask);
if (syscallres)
{
printf("Error in the syscall setaffinity: mask=%d=0x%x err=%d=0x%x", mask, mask, errno, errno);
sleep(2);
printf("This could be bad, but what the heck... We'll try continuing anyway.");
sleep(2);
}
}
Change to IOV code, also using tinyhack.com recommendations:
From:
Code:
if (ph->l2 == 0) {
for (i = 0; i < 8; i++) {
msg_iov[i].iov_base = (void *)MAGIC;
msg_iov[i].iov_len = MAGIC_ALT;
}
}
else {
for (i = 0; i < 8; i++) {
msg_iov[i].iov_base = (void *)MAGIC;
msg_iov[i].iov_len = 0x10;
}
}
To:
Code:
// tbh i'm not really sure how this is supposed to look or work
// but it is working with note 2 as is with modstring 0 1 0 4
// and that is all i care about right now.
// see http://tinyhack.com/2014/07/07/exploiting-the-futex-bug-and-uncovering-towelroot/
for (i = 0; i < 8; i++) {
iov[i].iov_base = (void *)MAGIC;
if (ph->align == 0) {
if (i==ph->hit_iov) {
iov[i].iov_len = MAGIC_ALT;
}
else {
iov[i].iov_len = 0x10;
}
}
else {
iov[i].iov_len = MAGIC_ALT;
}
}
When searching through task structures for a credential to overwrite (to get us root), verify that the credential is in kernel address space, the same way the other pointers are verified. Otherwise, we're not in the right place in memory yet...
From:
Code:
if (task->cpu_timers[0].next == task->cpu_timers[0].prev && (unsigned long)task->cpu_timers[0].next > KERNEL_START
&& task->cpu_timers[1].next == task->cpu_timers[1].prev && (unsigned long)task->cpu_timers[1].next > KERNEL_START
&& task->cpu_timers[2].next == task->cpu_timers[2].prev && (unsigned long)task->cpu_timers[2].next > KERNEL_START
&& task->real_cred == task->cred) {
To:
Code:
if (task->cpu_timers[0].next == task->cpu_timers[0].prev && (unsigned long)task->cpu_timers[0].next > KERNEL_START
&& task->cpu_timers[1].next == task->cpu_timers[1].prev && (unsigned long)task->cpu_timers[1].next > KERNEL_START
&& task->cpu_timers[2].next == task->cpu_timers[2].prev && (unsigned long)task->cpu_timers[2].next > KERNEL_START
&& task->real_cred == task->cred && (unsigned long)task->cred > KERNEL_START) {
That's all that needed to be changed, keeping in mind none of us have seen the actual towelroot source code so some of these things may not even be necessary or may already be present there, leaving it up in the air why towelroot doesn't work for us. I would guess the IOVs were the issue, somehow, but at least with this code, the credential needed to be checked to be in kernel space as well. Did not test without setaffinity.
Droc1983 said:
I still don't have root. Not sure what went wrong. My phone restarted like it was supposed to but not root.
Click to expand...
Click to collapse
I had to Uninstall towel root apk. Now I have root access. Thank you.
My apologies...
alkitchen said:
I am getting, "error: device unauthorized. Please check the confirmation dialog on your device." I am not getting anything on my phone. Any thoughts?
Click to expand...
Click to collapse
My apologies, disregard my post... I ran it again this evening and it WORKED!! Thanks so much.
Now to try Safestrap...
25yvdgpo06 said:
It is the first link at the top of ghettoroot.c, fi01's cube-towel.c page. (Every page linked in ghettoroot.c was helpful.)
I am planning to clean it up a bit myself this evening, but if someone wants to repackage the entire thing and re-post to a new thread, go for it! Or you can wait until I clean things up a little bit and then do it... Or just not. Whatever you want to do. I'm not very concerned about who gets credit for what, though a mention of my randomly-generated name might be nice.
Thanks to those who've helped others so far, and those who've shared success/failure.
EDIT: Wanted to point out that there were very few changes from fi01's original cube-towel.c code that were necessary to get the exploit itself to work. The rest is fluffy stuff, in addition to execution of useful commands once root was gained rather than being a proof-of-concept alone.
Here is *exactly* what was changed in the exploit code. Very minimal, you will see.
Setting of processor affinity added as recommended at tinyhack.com's "Exploiting the Futex Bug and uncovering Towelroot" post, and called in main():
Code:
void setaffinity()
{
pid_t pid = syscall(__NR_getpid);
int mask=1;
int syscallres = syscall(__NR_sched_setaffinity, pid, sizeof(mask), &mask);
if (syscallres)
{
printf("Error in the syscall setaffinity: mask=%d=0x%x err=%d=0x%x", mask, mask, errno, errno);
sleep(2);
printf("This could be bad, but what the heck... We'll try continuing anyway.");
sleep(2);
}
}
Change to IOV code, also using tinyhack.com recommendations:
From:
Code:
if (ph->l2 == 0) {
for (i = 0; i < 8; i++) {
msg_iov[i].iov_base = (void *)MAGIC;
msg_iov[i].iov_len = MAGIC_ALT;
}
}
else {
for (i = 0; i < 8; i++) {
msg_iov[i].iov_base = (void *)MAGIC;
msg_iov[i].iov_len = 0x10;
}
}
To:
Code:
// tbh i'm not really sure how this is supposed to look or work
// but it is working with note 2 as is with modstring 0 1 0 4
// and that is all i care about right now.
// see http://tinyhack.com/2014/07/07/exploiting-the-futex-bug-and-uncovering-towelroot/
for (i = 0; i < 8; i++) {
iov[i].iov_base = (void *)MAGIC;
if (ph->align == 0) {
if (i==ph->hit_iov) {
iov[i].iov_len = MAGIC_ALT;
}
else {
iov[i].iov_len = 0x10;
}
}
else {
iov[i].iov_len = MAGIC_ALT;
}
}
When searching through task structures for a credential to overwrite (to get us root), verify that the credential is in kernel address space, the same way the other pointers are verified. Otherwise, we're not in the right place in memory yet...
From:
Code:
if (task->cpu_timers[0].next == task->cpu_timers[0].prev && (unsigned long)task->cpu_timers[0].next > KERNEL_START
&& task->cpu_timers[1].next == task->cpu_timers[1].prev && (unsigned long)task->cpu_timers[1].next > KERNEL_START
&& task->cpu_timers[2].next == task->cpu_timers[2].prev && (unsigned long)task->cpu_timers[2].next > KERNEL_START
&& task->real_cred == task->cred) {
To:
Code:
if (task->cpu_timers[0].next == task->cpu_timers[0].prev && (unsigned long)task->cpu_timers[0].next > KERNEL_START
&& task->cpu_timers[1].next == task->cpu_timers[1].prev && (unsigned long)task->cpu_timers[1].next > KERNEL_START
&& task->cpu_timers[2].next == task->cpu_timers[2].prev && (unsigned long)task->cpu_timers[2].next > KERNEL_START
&& task->real_cred == task->cred && (unsigned long)task->cred > KERNEL_START) {
That's all that needed to be changed, keeping in mind none of us have seen the actual towelroot source code so some of these things may not even be necessary or may already be present there, leaving it up in the air why towelroot doesn't work for us. I would guess the IOVs were the issue, somehow, but at least with this code, the credential needed to be checked to be in kernel space as well. Did not test without setaffinity.
Click to expand...
Click to collapse
I'll wait til you clean it up and then repackage. I don't care about credit either. I'll pm you my gtalk shortly.
I would like to try this. I have downloaded the SDK, however I do not have any idea what the ADB step means. Basically, I have no idea what I am doing and would appreciate a little help as far as making sure I have everything that needs downloaded. Thanks.
edit: Got it figured out!
Having trouble with safestrap. I installed apk and ran install recovery and grant root access but it says recovery not installed in the app.
Not working...
I'm seeing:
Unable to chmod /data/local/tmp/busybox: no such file or directory
sh: /data/local/tmp/busybox: not found
Could not find/unzip SuperSU: Success
Please place an UPDATE-SU-*.zip file in the mail folder before running the install script
Click to expand...
Click to collapse
Any help would be appreciated.

[Q] Samsung S4 Exploit adaptable to HDX?

Hi there,
right now I'm trying to get some knowledge about the little kernel bootloader and how it's working. I just read an article about exploiting the S4 bootloader: http://blog.azimuthsecurity.com/2013/05/exploiting-samsung-galaxy-s4-secure-boot.html
Basically the author describes a method, how to modify the function, which verifies the signature during runtime. As far as i understand it, he modifies a boot image in such a way, that a certain shell script is overwriting the check-function and in the end returns a check passed value.
Then i had a quick look into the little kernel source code to the corresponding position (at least i think, that's the right position:
Code:
else
{
dprintf(INFO, "Authenticating boot image (%d): start\n", imagesize_actual);
auth_kernel_img = image_verify((unsigned char *)image_addr,
(unsigned char *)(image_addr + imagesize_actual),
imagesize_actual,
CRYPTO_AUTH_ALG_SHA256);
dprintf(INFO, "Authenticating boot image (%d): done\n", imagesize_actual);
if(auth_kernel_img)
{
/* Authorized kernel */
device.is_tampered = 0;
}
}
I'm just wondering if it wouldn't be possible, to overwrite the image_verify function in the same way the author did it in his article?
regards,
scotch

[KERNEL][5.1.1][P607] zStock CIFS + NFS + SELinux options + Force Fast Charge [v1.2]

Intro-
This is the stock kernel for the T-Mobile SM-P607T Samsung Note 10.1 (2014 Edition) with the following additional features:
Multiple flavors for SELinux preference
CIFS kernel support
NFS kernel support
Force Fast Charge support
Download Options-
Enforcing ONLY - http://files.zpivot.com/sm-p607t/p607t-zstock-kernel-enforcing-only-1.2.37.tar.md5
SELinux stock behavior, always enforcing
Permissive OPTIONAL - http://files.zpivot.com/sm-p607t/p607t-zstock-kernel-permissive-optional-1.2.37.tar.md5
SELinux mode can be change with setenforce command
Permissive ONLY - http://files.zpivot.com/sm-p607t/p607t-zstock-kernel-permissive-only-1.2.37.tar.md5
SELinux always permissive
Install-
Reboot into download mode
Open ODIN
Add the kernel file downloaded from link above to AP section
Click start!
How to mount cifs/smb shares-
REQUIREMENTS:
root
busybox
ability to read and follow directions
custom kernel with cifs support (ie the kernel above)
INSTRUCTIONS:
Open a terminal emulator or adb shell
Code:
su
Code:
mkdir /mnt/shares/*share_name*
Code:
busybox mount -t cifs -o username=guest,unc=\\\\*server_ip*\\*share_name*,ip=*server_ip* *server_ip*/*share_name* /mnt/shares/*share_name*
NOTES:
Make sure you replace *server_ip* in the instructions above with the ip address of your server, and *share_name* with the name of your shared folder.
You must mount your shares outside of /storage and /mnt/sdcard for all applications to have access. I have provided a public tmpfs for creating mount points at /mnt/shares.
---Your samba share will now be accessible by all programs/apps under the /mnt/shares directory on root.
How to use Force Fast Charge-
DISPLAY FORCE FAST CHARGE INFO:
Open a terminal emulator or adb shell
Code:
cat /sys/kernel/fast_charge/info
ENABLE FORCE FAST CHARGE MODE:
Open a terminal emulator or adb shell
Code:
su
Code:
echo 1 > /sys/kernel/fast_charge/force_fast_charge
SET CUSTOM FORCE FAST CHARGE LEVELS:
Open a terminal emulator or adb shell
Code:
su
Code:
echo 2 > /sys/kernel/fast_charge/force_fast_charge
Code:
echo 1000 > /sys/kernel/fast_charge/usb_charge_level
Code:
echo 2100 > /sys/kernel/fast_charge/ac_charge_level
NOTES:
Force Fast Charge will be disabled by default
When setting custom levels for usb and ac force fast charge, use one of the available values listed when using the display info command above (in the examples I used the max values)
Additional info:
Code:
/*
* Forced Fast Charge - SysFS interface :
* --------------------------------------
*
* /sys/kernel/fast_charge/force_fast_charge (rw)
*
* 0 - disabled (default)
* 1 - substitute AC to USB
* 2 - use custom mA configured through sysfs interface (see below)
*
* /sys/kernel/fast_charge/ac_charge_level (rw)
*
* rate at which to charge when on AC (1.0A/h to 2.1A/h)
*
* /sys/kernel/fast_charge/usb_charge_level (r/w)
*
* rate at which to charge when on USB (0.460A/h to 1.0A/h)
*
* /sys/kernel/fast_charge/wireless_charge_level (r/w)
*
* rate at which to charge when on WIRELESS (0.650A/h to 1.2A/h)
*
* /sys/kernel/fast_charge/failsafe (rw)
*
* 0 - disabled - allow anything up to 2.1A/h to be used as AC / USB custom current
* 1 - enabled - behaviour as described above (default)
*
* /sys/kernel/fast_charge/ac_levels (ro)
*
* display available levels for AC (for failsafe enabled mode)
*
* /sys/kernel/fast_charge/usb_levels (ro)
*
* display available levels for USB (for failsafe enabled mode)
*
* /sys/kernel/fast_charge/wireless_levels (ro)
*
* display available levels for WIRELESS (for failsafe enabled mode)
*
* /sys/kernel/fast_charge/version (ro)
*
* display fast charge version information
*
* /sys/kernel/fast_charge/info (ro)
*
* display complete fast charge configuration in human readable format
*
*/
Changelog
v1.0 - Initial release
v1.1 - Added Enforcing only version (build 21)
v1.2 - Added Force Fast Charge support (build 37)
Thanks/Credits-
mkasick - CIFS/NFS empty mount patch - http://forum.xda-developers.com/showthread.php?t=2106480
blue cat - permissive only patch - http://forum.xda-developers.com/galaxy-note-10-2014/development/kernel-stock-selinux-permissive-kernel-t3232814
chad0989 - force fast charge initial work - http://forum.xda-developers.com/galaxy-nexus/verizon-develop/kernel-patch-devs-force-ac-fast-charging-t1524020
faux123 - force fast charge extensions
yank555-lu - force fast charge note 3 port​
Just a question - do you know how to add charging at different voltages? It drives me crazy that our tab can only charge at 1.8V, no more, no less.
Sent from my LG-H818 using Tapatalk
itsita said:
Just a question - do you know how to add charging at different voltages? It drives me crazy that our tab can only charge at 1.8V, no more, no less.
Sent from my LG-H818 using Tapatalk
Click to expand...
Click to collapse
I do not know how to adjust the voltage used for charging. Although you did give me an idea to implement the force fast charging kernel mod. I am currently building a test release with the added patches... let the experiments begin!!!
Updated OP
Okay, I have updated the OP and added a new version with the force fast charge mod in place. I have only done minor testing to make sure the code was functional. I would suggest that you perform your own testing as your mileage may vary depending on the charging equipment you are using.
oneleft.ak said:
Okay, I have updated the OP and added a new version with the force fast charge mod in place. I have only done minor testing to make sure the code was functional. I would suggest that you perform your own testing as your mileage may vary depending on the charging equipment you are using.
Click to expand...
Click to collapse
Thanks! Ill test and post results
Sent from my SM-P605 using Tapatalk
I am getting "md5 error! invalid binary " while adding the kernel file through odin..
plz guide
i have 607T with 5.1.1
tabi304 said:
I am getting "md5 error! invalid binary " while adding the kernel file through odin..
plz guide
i have 607T with 5.1.1
Click to expand...
Click to collapse
This will happen when you change the filename before attempting to flash or if the download completed with errors. Make sure you are trying to flash the file from one of the download links in the OP.
oneleft.ak said:
This will happen when you change the filename before attempting to flash or if the download completed with errors. Make sure you are trying to flash the file from one of the download links in the OP.
Click to expand...
Click to collapse
hmm i'm getting the invalid binary message as well,
tried different odins and different files (didn't change the name or anything..)
I also tried different odin versions but no success
File server error
tabi304 said:
I also tried different odin versions but no success
Click to expand...
Click to collapse
I see what you mean, it appears my file server is altering the file size upon upload.... I am looking into it right now- Will update this thread once it has been corrected.
UPDATE:
Okay, turns out it was the ftp program(FileZilla) I was using to upload the files to my file server. The files have been restored correctly and I have personally tested all three of the links by downloading from my file server and flashing in ODIN.
Thanks for the heads up guys and please let me know if you run into any further issues--
itsita said:
hmm i'm getting the invalid binary message as well,
tried different odins and different files (didn't change the name or anything..)
Click to expand...
Click to collapse
Maybe now you can finally get the chance to test the force fast charge options!!!
Is this kernel valid for P605 too? Surely not, but just asking....
How do you root the P607T? Also, whats the difference (in laymens terms) between the 3 versions?
Worked well thank you
Set my levels to this - hopefully it speeds up the charge a little
Fast charge mode : 2 - Use custom mA on AC and USB
Custom AC level : 2100mA/h
Custom USB level : 1000mA/h
Custom Wireless level : 650mA/h
Failsafe mode : 1 - Failsafe active (default)
Valid AC levels : 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100
Valid USB levels : 460 500 600 700 800 900 1000
Valid Wireless levels : 650 800 900 1000 1100 1200
I flashed the kernel from here, and followed the steps, when i go to check /sys/kernel/fast_charge/info to see if it worked, all i get is permission denied.
no matter what kernel ive used in the past on this tablet ive gotten "permission denied" like trying to set up linux deploy or linux on android. I am rooted, I am using a Permissive kernel, Busy Box installed. So what gives?
Can this be used in P605 ? TY !!
Istarth said:
Can this be used in P605 ? TY !!
Click to expand...
Click to collapse
Yes. It was also the kernel inside Pyrana v27.
zombie thread warning*
So as i understand it, you can use kernels for older roms on newer releases right?
So for example, im trying out an unofficial lineage os rom, and it does not have fast charge support baked in, nothing through kernel auditor or 3c toolbox that can be changed. Could I flash this kernel and add support to the rom that way? The dinosaur charging speeds on this thing is really inconvenient if I ever forget to charge it overnight.
Please, links down.

Android Bluetooth pairing limitation

There is a 100 device limit in Android for the maximum number of paired Bluetooth devices. This causes problems for my App used for reading the meter status.
Solutions
Multiple solutions to the problem looks possible.
* Solutions that replace the Bluetooth lib library all require some form of rooting the device.
* Use AOSP and GSI to update system image of device.
* Manufacturers use different solutions for partitioning etc. of phones so it’s very hard to create a portable solution even when using GSI.
* Replace only the Bluetooth library
Replacing only the lib may be more general, but it also requires rooting and installation of TWRP.
* Use the ndk to patch/replace the pairing code or try to integrate the App deeper in the stack
There is an interesting old paten for “Centralized Bluetooth Device Pairing”
* Patch of Bluetooth library
The idea is to just change BTM_SEC_MAX_DEVICE_RECORDS variable. If we can change or override this variable outside in some configuration file and do not build source is more desirable.
If we can just build and replace component which allow it to keep more then 100 paired Bluetooth device is ideal
The below code seems to be culprit
According to the Bluetooth implementation, if there are more than 100 device records the allocation will fail. The responsible BTM_SEC_MAX_DEVICE_RECORDS is defined in bt_target.h:
/* The number of security records for peer devices. */
#ifndef BTM_SEC_MAX_DEVICE_RECORDS
#define BTM_SEC_MAX_DEVICE_RECORDS 100
#endif
This is then used inside btm_dev.c, specifically in BTM_SecAddDevice which returns false after 100 pairings:
/* There is no device record, allocate one.
* If we can not find an empty spot for this one, let it fail. */
for (i = 0; i < BTM_SEC_MAX_DEVICE_RECORDS; i++)
Query
* If I update the #define BTM_SEC_MAX_DEVICE_RECORDS from 100 to lets say 1000, do I need to build the complete GIS image and install.
* Or, can I only update the BT library?
* Or, any other methods?

Categories

Resources