Convert gadget from Solar charging to wired charging
Check if the 4 NiMH batteries are in series; they probably are.
If they are, you need 4 x 1.2V = 4.8V; 5V should work. You could remove the solar panel and batteries, and connect the 5V and ground of a USB cable to the plus and minus outputs of the empty battery holder.
Keeping the rechargeable batteries is trickier to do; you would have to find out how the batteries are charged, and if 5V will do to charge them far enough, or at least trickle charge them. The solar panel could be delivering more than 5V, and the charging method and IC, if any, are unknown.
Or get a Boxer, I have found they are really good at keeping cats out of the garden.