'hacking' Android java, doing what people REALLY want

19 views
Skip to first unread message

Big Bad Bob

unread,
Jan 16, 2019, 1:53:20 PM1/16/19
to
Well, I'm once again showing my programming prowess, this time for Android.

(for alt.hackers, this entire post is considered an 'ObHack' since the
Android code is really hacking their UI to do things they never intended
be done - YEAH!)

I placed a couple of java files here:
https://github.com/bombasticbob/AndroidStuff

The first one, 'MessageBox.java', shows how you can implement a modal
dialog box to ask a 'yes/no' question, or to have the user press 'ok'
before continuing. In this case, it's relative to the main activity,
and as such SHOULD be callable by other activities that are opened by
the main one. however, if you need to, you could implement these within
each activity that might need to pop up a modal dialog box.

The second one, 'SkButton.java', implements a 3D Skeuomorphic version of
'Button' that can be referred to from your layout. You might have to
edit the XML but that's somewhat trivial. Essentially it's "Button" but
then draws a border around itself based on the 'pressed state'. It's a
nice 3D skeuomorphic border, similar to what you'd expect in a desktop
operating system, and is NOT "2D FLATTY McFLATFACE FLATSO".


* E N J O Y *


--
(aka 'Bombastic Bob' in case you wondered)

'Feeling with my fingers, and thinking with my brain' - me

'your story is so touching, but it sounds just like a lie'
"Straighten up and fly right"

Eli the Bearded

unread,
Jan 16, 2019, 3:44:55 PM1/16/19
to
In alt.hackers, Big Bad Bob <BigBadBob-at...@testing.local> wrote:
> (for alt.hackers, this entire post is considered an 'ObHack' since the
> Android code is really hacking their UI to do things they never intended
> be done - YEAH!)

Thanks for posting stuff here. It's nice to see /some/ traffic.

> then draws a border around itself based on the 'pressed state'. It's a
> nice 3D skeuomorphic border, similar to what you'd expect in a desktop
> operating system, and is NOT "2D FLATTY McFLATFACE FLATSO".

I dunno. My preferred UI and GUI is very plain. The thing that bothers
me most about Android is how much it tries to hide that it's a linux
system. I do a lot of stuff via Termux, which gives me a complete shell,
but Android itself limits what the shell can do[*]: "find /" --
"Permission denied". Skeuomorphic design often strikes me as excessive,
and I'd be happy if I could have a curses style GUI for some of my
stuff.

[*] Barring rooting, which I'm not against, but I do not have an easy
way to do for my preferred pocket computer. My pockets are not a
forgiving environment, so I've been getting the super-rugged phones
from Bullitt Group marketed under the construction equipment brand
Cat. Waterproof and drop resistant even on concrete, both of which
I've verified from personal experience.


Alright, some hacks.

Android hack
------------

First that Termux environment I mentioned? I use it for my image sharing
from the phone. $HOME/bin/termux-file-editor is run when you "edit" a
file with Termux, eg from my image gallery tool. That's a shell script
for me that strips exif and scales down images (to a configurable size,
but defaulting to 1000 pixels in largest dimension) and then forwards
the resized image to a tool I have on a personal server. That tool then
handles zero or more forwards to other locations. I get several benefits
from this:

1) My exif is not shared with the world, for privacy.
2) My full-size images are not shared with the world preventing photo
sensor fingerprinting.
3) Uploading a 1000 x 750 pixel image is a lot faster than uploading
a 4600 x 3400 image, even including resize time.
4) One phone upload can be sent to multiple locations without using
multiple phone uploads.

I find 3 & 4 a big benefit in out-of-the-way areas with poor cell
connections.

DNS hack
--------

At my current place of employment, the people who were in Devops two
years ago thought it was the bees-knees to use "views" in DNS. One DNS
server will give out different answers for the same request based on
the originating network (vlan). In many cases these view specific
answers will be the same for 6 of 8 networks which can lead to a false
sense of security. "Well, when I checked puppet.example.org, I got
10.123.45.67."

Another trouble is, those view-fan people have all left the company,
and since then new vlans have been created. Knowing how the DNS server
will respond to a view-specific request on a new host became a
challenge.

So I decided have DNS itself give us a diagnostic test. I created a TXT
record in every view called "vlan-check" that has the name of the view
as a response.

[personal computer] $ dig +short vlan-check.example.com TXT
"hq"
[personal computer] $


[jenkins server] $ dig +short vlan-check.example.com TXT
"vlan220"
[jenkins server] $

Xmas Hanging Hack
-----------------

There's a tree in my front yard that I hang large (8" diameter and up)
baubles on every year for the xmas holiday. For years I had been using a
ladder leaning against the tree to climb up, place one or two ornaments,
climb down, move the ladder, repeat for twenty items.

As one can imagine, this was quite a chore, and about as difficult on
the take-down end.

In 2017, I came up with a fix. Take a string, tie a heavy nut (as in for
a bolt, not a chestnut or something) to it, stand behind the tree, throw
the nut over the tree and string play out, find where the nut landed,
untie it and retie the string to the ornament, go back behind the tree,
pull the string until the ornament is high enough, cut the string, and
tie it off.

To get the decorations back down, I had someone assist me, I'd untie the
string and let it drop for the other person to catch. (The ornaments are
not too fragile, but do break on a uncontrolled fall to the ground.)

In 2018 (so last month), I refined this a bit. This time I used fishing
line monofilament to hide the supports better. And for taking them down,
I made myself a long hook tool. I took a pole from an old ceiling duster
tool, long and light weight, and attached the hook from a dry cleaning
wire hanger to the end with a nut and bolt. When I untied the fishing
line, I'd figure out which ornament it connected to and then hook the
line to the decoration side of the line and use the tool to control the
descent. This has worked out to be a whole lot faster and easier to my
pre-2017 method, even including the time I spent making the hook tool.

Elijah
------
what's with the alt.hacker crosspost?

Big Bad Bob

unread,
Jan 16, 2019, 10:01:22 PM1/16/19
to
On 01/16/19 12:44, Eli the Bearded wrote:
> what's with the alt.hacker crosspost?
>

eh, I just wanted to post to both places at once

ObHacks:

a) using dental floss to loosen 3D printed objects from the base on the
printer (found it on a web page though, not my original idea)

b) Short section of pvc pipe to hold trunk open on car when you can't
buy replacement pistons that would normally (gently) push it open for ya
(and the car is old and they don't work any more). So the trunk wants
to close on your hand all of the time. PVC pipe holds it open, and it's
easy to store in the trunk.

Eli the Bearded

unread,
Feb 12, 2019, 8:23:12 PM2/12/19
to
In alt.hackers, Big Bad Bob <BigBadBob-at...@testing.local> wrote:
^^^^
S.F.T. Inc. has a strict NO spam policy regarding the use of the
'mrp3.com' domain. Unsolicited bulk or commercial e-mail that claims to
originate from this domain should be reported as 'spam' to ISPs and
'www.ifccfbi.gov'.

$ nslookup www.ifccfbi.gov.
...
** server can't find www.ifccfbi.gov.: NXDOMAIN

I never visited ifccfbi.gov while it existed. Is the ic3.gov site the
replacement? I reported spam at ic3.gov today; someone sent me spam
pretending to be an FBI agent, so I followed links from fbi.gov to
the proper place to report that.

> a) using dental floss to loosen 3D printed objects from the base on the
> printer (found it on a web page though, not my original idea)

I still don't have a 3D printer and I'm not sure I can think up enough
stuff I'd want out of *plastic* to justify one. I did just have a "need"
for a very specifically shaped piece of *metal* and improvised a way to
fashion it. What I needed was essentially a washer with exact inner and
outer diameters. How I got there is my hack.

I purchased a fender washer with a inner hole smaller and an outer hole
larger than I needed. I then drilled out the inner hole. Because I have
a large selection of drill bits, not too difficult; hardest part is
holding the washer still during drilling. I did that by attaching it to
a piece of scrap wood with screws:

.___________________________.
| |
| |
| _ ____ |
| .'x`." "-. |
| `7' \ _ |
| | .''. .'x'. |
| | `'' Y-' |
| \_ / |
| .'x'-....-'' |
| '-' |
| |
| |
|___________________________|

That still required tightening the screws several times. Then I put it
in a mandrel for a Dremel and chucked it. I turned the Dremel on and
started to grind down the outer edge. Nano capacity lathe!

The end result was to create a spacer for a saw blade to be attached to
that same Dremel mandrel. It is sandwiched between two larger fender
washers with some rubber gasket material for grippiness. Side view,
where xxx is the fabricated part, and saw is the saw blade (not to
scale):

s
a
WRwRW
.--AUxUA--,
.--------------' SBxBS |
'--------------. HBxBH |
'--EExEE--'
RRsRR
a
w

The actual part is 15mm outer diameter, 1/4" inner diameter, and the
saw blade is ~100 outer diameter. I used it to create a mini-table saw
for a dollhouse scale building project.

You'd think there'd be mandrels available for all different size tools,
but no, there are not. Dremel, recall, is a 1/8" shank:

https://www.mcmaster.com/mandrels

(Javascript site won't easily let me link deeper than that.)

Despite the javascript Mcmaster-Carr's site is such a breath of fresh
air compared to trying to shop for a specific sized something at Amazon.

Elijah
------
but it's quirky in that checkout will not tell you shipping costs
Reply all
Reply to author
Forward
0 new messages