You are browsing as a guest. Sign up (or log in) to start making projects!

SMC_breach

  • 10 Devlogs
  • 8 Total hours

Monitor power usage stats for your mac devices! Planning to support M1 and later

Open comments for this post

18m 36s logged

Breaching into my mac before I sleep! :add-bad-apple-bruh:

At this point, I’ve managed to get absolute cinema levels of access to
the system.

After extensive research btwn yesterday and tmrw I’ve figured out that
the IOKit framework I yapped about earlier is an absolute tragedy, it’s:

SLOW & USELESS.


The data it provides updates on USB/Magsafe plug & play events or once in 2 minutes or so,

nice for uncs but not for me blud.

And I discovered the God

Not literally but not metaphorically either. Nonetheless now I’m gonna
have to directly communicate with the Darwin kernel (the main guts of
macOS) to gather all power related data (This might make my app need
sudo) but:

quality > security panic

and it’s open source so you can always see what’s going on under the
hood.


This is me signing off before I sleep! if you read till here, hit follow and we can exchange a couple greetings? won’t ya?

0
1
133
Open comments for this post

2h 3m 31s logged

I had told you I’m silly, and I proved myself right :fahh:

Historically great people have been great problem solvers, and to this day I used to think I was one.

But today my hopes were shattered, because how silly and d*mb can you really get?

I managed to think that my app has some severe error or a Memory leak, that’s causing it to stop at Thread 1 everytime I run it!

I wasted 30mins looking for it, turns out it was just a breakpoint I had set. :speed-trying-not-to-laugh:

I’m at a loss for words because how do I even speak for myself? :cryin:

0
1
14
Open comments for this post

2h 12m 18s logged

A new icon! and a new Interface!

It’s been 15 hours since my last devlog, had my night’s sleep, completed school, and worked for 3 hours too!

and finally, I think I’m ready to present you with an icon, it’s not perfect, it’s not the best, but it’s my (sub-par) greatest creation.

Presenting - SMC_breach …

4
1
243
Open comments for this post

35m 44s logged

:apple-logo: Better Animations, better data

The app now let’s you monitor live stats, features better scrolling text animations.


I made sure the app was polling the system every 0.25 seconds, then it was averaging out the 4 data points at 0.25s intervals and giving the user a smooth 1 reading per second. :uedataasset:

The Reward and the Challenge

This is now complemented by the animations which honestly took a solid amount of trial and error to get right, the key to mastering this was smooth fade out of the numbers, along side using the array chopping for animate per digit’s place! :j-ai-smooth-operator:

0
1
27
Open comments for this post

45m 22s logged

Liquid Glass and UI Update!

My mom keeps calling me dumb occasionally, not that she means any harm, but she might be correct.


I spent 15 minutes trying to figure out why I can’t apply Liquid Glass elements to my app.

Guess what was the issue? can ya?

3…
2…
1…

My dumb ahh forgot that you don’t add .glasseffect() inside of a .background() block.

yepp, that silly it was, but nonetheless Liquid Glass is up and running now.


From here on I gotta figure out how I can make the glass clearer, adjust depth, splay, dispersion. etc etc

The second Image represents my earlier mockup

0
1
24
Open comments for this post

16m 21s logged

Making the Figma UI Prototype!

Probably the only non-coding part here.

First off, I’m kinda in love… with my design.


Not only did I have to spend over an hour tweaking the correct liquid glass settings in Figma, I also I had put all my brain into designing this, trying to get the best of UX and a delight to the eye.


btw a hack for anyone tryna do liquid glass and make it readable, try to spike up the Frost slider in the settings ;)

I’ve also added My Mockup vs Vibecode UI Mockup in the Screenshots!


The next step is gonna be to implement this, and I’m more excited than you think!

0
1
37
Open comments for this post

49m 20s logged

Now I have the access to the internals of macOS

As promised through devlog #2 and devlog #3. I now have access to internal data states of macOS.

Currently the power data displayed is correct and alongside is fully functional, now it’s time to switch up the and give it a face-lift.

I’ve also discovered on features like Charge Control and more internal data states mentioned earlier.

I’ll share the facelift soon, the Github code is now live and available with downloads, I’ll share the source in my next devlog.


Thanks for following the journey, do follow it and I’ve got something a lot bigger going on, (a potential AA style title in browser)

0
0
28
Open comments for this post

21m 4s logged

The Skeleton is here!

As stated in my previous devlog #2, the skeleton UI is now here, I’ve
plugged in all the functions and metrics to gather data but a fix is
needed to make all these display correct values,


for now, we have a correct UpTime status and a correct Adapter Wattage
reading. Other details remain to be fixed.

thanks to the code completion I was able to type out these ~200 lines in under 25 minutes!

0
1
18
Open comments for this post

27m 59s logged

Now I have low-level Access to macOS

This is just theory, but realistically I’m only a couple of hours away from making this true.


Upon extensive research and code review on various online posts and OSS, I was able to find that:

  1. Apple introduced a detailed sub-dictionary within the AppleSmartBattery node on Apple Silicon architectures (M1 and beyond), known as PowerTelemetryData.

  2. The PowerTelemetryData structure yields three critical metrics that must be utilized by my app:

    a) SystemPowerIn: This represents the total DC power entering the machine’s logic board directly from the external AC adapter, “prior to any internal routing”.

    b) BatteryPower: This metric indicates the precise amount of power actively being routed into the battery for charging, or being pulled from the battery for discharging. (However many projects instead preferred manual calculation using our standard Voltage * InstantAmperage formula, likely for better accuracy?).

    c) SystemLoad: This defines the total localized power being consumed internally by the logic board, the System-on-Chip, the display, and all active peripherals.


Stay tuned, I’m finally gonna play with these metrics!

0
1
109
Open comments for this post

35m 30s logged

First day, first run, not like the average honeymoon phase!

What’s up folks? this is Atharva known online as FiniteCode.

This project is about building a macOS Power Information Utility, wherein the user can view live stats of power consumption and intake for their macbooks (and potentially macs too).

This project is gonna be interesting, this is probably my 3rd or 4th time attempting to work with Swift, it has always been fun.

Hidden APIs

macOS itself doesn’t natively broadcast a lot of the power information to the Applications, and so you have to go through hidden system APIs.

This is one of the reasons why such Power Management apps are never on the App Store but on sources like Homebrew or Github.

The Setup

Today I spent over 30minutes setting up my time tracking with Wakatime and connecting it to Stardance metrics, and submitted my IDs for verification.

It was after these basics where I started my research on the hidden APIs I talked about earlier, which for the base for the application, I utilized Gemini and Claude for researching on the same and my findings revealed an IOKitFramework called powermetrics which provides many C functions like:

IOReportCopyChannelsInGroup, IOReportMergeChannels, IOReportCreateSubscription, IOReportCreateSamples, and IOReportCreateSamplesDelta.

The goal will be to use these functions and as much more data as available to build on this app.

Design

I was thinking of making a Cyberpunk-esque design but honestly I’m not sure if I can do this, so we’ll come back to this one some time soon, for now the core focus is on the functionality.

Screenshots

I made the basic menu-bar app and setup Xcode and hence attached some screenshots, feel free to have a look.


Join me in this journey, where I’ll try to make something useful, something fun XD

0
1
11

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…