• Stars
    star
    222
  • Rank 179,123 (Top 4 %)
  • Language
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

huawei framework source

version:Honor5C, Android 7.0,EMUI5.0

ๆœฌ้กน็›ฎไธบ็ ”็ฉถhwframeworkๅฑ‚็š„ๆบ็ ใ€‚

adb pull /system/framework .

adb shell dumpsys activity top // ๅพ—ๅˆฐapk็š„packageName

adb shell pm path {packageName} //ๅพ—ๅˆฐapk็š„ๅฎ‰่ฃ…็›ฎๅฝ• apkPath eg:/system/priv-app/xxx/xxxx.apk

adb pull ../{apkPath} .   //ไปŽromไธญๆๅ–apkๆ–‡ไปถ

dextra -dextract *.oat(ๆˆ–*.odex) //ไปŽoatๆ–‡ไปถๆˆ–odexๆ–‡ไปถไธญๆๅ–dex

jadx d out --show-bad-code *.dex //่ฝฌๆขdexไธบjava
  • artไธ‹romๅ็ผ–่ฏ‘ๆŠ€ๅทง

ๅœจandroid 5.0ไน‹ๅŽ๏ผŒ็ณป็ปŸ็š„/system/framework็›ฎๅฝ•ไธ‹็š„jarๅŒ…้‡Œ้ขๅทฒ็ปไธๅŒ…ๅซไปฃ็ ไบ†๏ผŒๅชๆ˜ฏไธ€ไบ›็ฉบ็š„jarๆ–‡ไปถใ€‚ไปฃ็ ่ขซๅญ˜ๅ‚จๅœจoatๆ–‡ไปถๆˆ–่€…odexๆ–‡ไปถไธญ๏ผŒๅ…ถไธญframework็š„ไปฃ็ ไธป่ฆ้›†ไธญๅœจ๏ผš

1. /system/framework/oat/arm64

โ”œโ”€โ”€ am.odex
โ”œโ”€โ”€ android.test.runner.odex
โ”œโ”€โ”€ applist.odex
โ”œโ”€โ”€ appwidget.odex
โ”œโ”€โ”€ bmgr.odex
โ”œโ”€โ”€ bu.odex
โ”œโ”€โ”€ com.android.contacts.separated.odex
โ”œโ”€โ”€ com.android.future.usb.accessory.odex
โ”œโ”€โ”€ com.android.location.provider.odex
โ”œโ”€โ”€ com.android.media.remotedisplay.odex
โ”œโ”€โ”€ com.android.mediadrm.signer.odex
โ”œโ”€โ”€ com.android.nfc_extras.odex
โ”œโ”€โ”€ com.google.android.maps.odex
โ”œโ”€โ”€ com.google.android.media.effects.odex
โ”œโ”€โ”€ com.gsma.services.nfc.odex
โ”œโ”€โ”€ com.hisi.perfhub.odex
โ”œโ”€โ”€ com.huawei.iconnect.wearable.odex
โ”œโ”€โ”€ com.huawei.launcher.separated.odex
โ”œโ”€โ”€ com.huawei.systemmanager.separated.odex
โ”œโ”€โ”€ com.huawei.theme.stat.odex
โ”œโ”€โ”€ content.odex
โ”œโ”€โ”€ dpm.odex
โ”œโ”€โ”€ ethernet-service.odex
โ”œโ”€โ”€ hid.odex
โ”œโ”€โ”€ hwServices.odex
โ”œโ”€โ”€ hwWifi-service.odex
โ”œโ”€โ”€ hwcustServices.odex
โ”œโ”€โ”€ hwcustwifi-service.odex
โ”œโ”€โ”€ hwpush.odex
โ”œโ”€โ”€ hwtransition.odex
โ”œโ”€โ”€ ime.odex
โ”œโ”€โ”€ input.odex
โ”œโ”€โ”€ javax.obex.odex
โ”œโ”€โ”€ jcifs-1.3.17-dex.odex
โ”œโ”€โ”€ media_cmd.odex
โ”œโ”€โ”€ monkey.odex
โ”œโ”€โ”€ pm.odex
โ”œโ”€โ”€ requestsync.odex
โ”œโ”€โ”€ services.odex
โ”œโ”€โ”€ settings.odex
โ”œโ”€โ”€ sm.odex
โ”œโ”€โ”€ svc.odex
โ”œโ”€โ”€ telecom.odex
โ”œโ”€โ”€ uiautomator.odex
โ”œโ”€โ”€ wifi-service.odex
โ””โ”€โ”€ wm.odex

2. /system/framework/arm64
.
โ”œโ”€โ”€ boot-apache-xml.art
โ”œโ”€โ”€ boot-apache-xml.oat
โ”œโ”€โ”€ boot-bouncycastle.art
โ”œโ”€โ”€ boot-bouncycastle.oat
โ”œโ”€โ”€ boot-conscrypt.art
โ”œโ”€โ”€ boot-conscrypt.oat
โ”œโ”€โ”€ boot-core-junit.art
โ”œโ”€โ”€ boot-core-junit.oat
โ”œโ”€โ”€ boot-core-libart.art
โ”œโ”€โ”€ boot-core-libart.oat
โ”œโ”€โ”€ boot-ext.art
โ”œโ”€โ”€ boot-ext.oat
โ”œโ”€โ”€ boot-framework.art
โ”œโ”€โ”€ boot-framework.oat
โ”œโ”€โ”€ boot-hwEmui.art
โ”œโ”€โ”€ boot-hwEmui.oat
โ”œโ”€โ”€ boot-hwTelephony-common.art
โ”œโ”€โ”€ boot-hwTelephony-common.oat
โ”œโ”€โ”€ boot-hwaps.art
โ”œโ”€โ”€ boot-hwaps.oat
โ”œโ”€โ”€ boot-hwcustEmui.art
โ”œโ”€โ”€ boot-hwcustEmui.oat
โ”œโ”€โ”€ boot-hwcustTelephony-common.art
โ”œโ”€โ”€ boot-hwcustTelephony-common.oat
โ”œโ”€โ”€ boot-hwcustframework.art
โ”œโ”€โ”€ boot-hwcustframework.oat
โ”œโ”€โ”€ boot-hwframework.art
โ”œโ”€โ”€ boot-hwframework.oat
โ”œโ”€โ”€ boot-ims-common.art
โ”œโ”€โ”€ boot-ims-common.oat
โ”œโ”€โ”€ boot-okhttp.art
โ”œโ”€โ”€ boot-okhttp.oat
โ”œโ”€โ”€ boot-org.apache.http.legacy.boot.art
โ”œโ”€โ”€ boot-org.apache.http.legacy.boot.oat
โ”œโ”€โ”€ boot-org.ifaa.android.manager.art
โ”œโ”€โ”€ boot-org.ifaa.android.manager.oat
โ”œโ”€โ”€ boot-org.simalliance.openmobileapi.art
โ”œโ”€โ”€ boot-org.simalliance.openmobileapi.oat
โ”œโ”€โ”€ boot-telephony-common.art
โ”œโ”€โ”€ boot-telephony-common.oat
โ”œโ”€โ”€ boot-voip-common.art
โ”œโ”€โ”€ boot-voip-common.oat
โ”œโ”€โ”€ boot.art
โ””โ”€โ”€ boot.oat

ๆ—ข็„ถๆ‰พๅˆฐไบ†ไปฃ็ ็š„็œŸๆญฃๅญ˜ๅ‚จไฝ็ฝฎ๏ผŒๅช้œ€่ฆไปŽ่ฟ™ไบ›ๆ–‡ไปถไธญๆๅ–ๅ‡บไปฃ็ ๅณๅฏ๏ผŒ้ฆ–ๅ…ˆๆฅ็œ‹ไธ‹oatๆ–‡ไปถๅ’Œodexๆ–‡ไปถ็š„ๆœฌ่ดจ:

$ file boot.oat 
boot.oat: ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, stripped

$ file services.odex 
services.odex: ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, stripped

ๅฏไปฅ็œ‹ๅˆฐodexๆ–‡ไปถๅ’Œoatๆ–‡ไปถๆœฌ่ดจไธŠ้ƒฝๆ˜ฏelfๆ–‡ไปถ๏ผˆLinuxไธŠ็š„ไธ€็งๅฏๆ‰ง่กŒๆ–‡ไปถ๏ผ‰ใ€‚้€š่ฟ‡ๆŸฅ็œ‹็›ธๅ…ณๆ–‡ๆกฃๅฏไปฅๅ‘็Žฐ๏ผŒoatๆˆ–odexๆ–‡ไปถไธญๆ˜ฏๅญ˜ๅœจๆœ‰ๅฎŒๆ•ด็š„dexๆ–‡ไปถ็š„๏ผŒๆˆ‘ไปฌๅช้œ€่ฆไปŽoatๆˆ–odexไธญๅฐ†dexๆๅ–ๅ‡บๆฅๅณๅฏใ€‚

  • ๅœจMacๆˆ–LinuxๅนณๅฐไธŠๆœ‰ไธชๅผบๅคง็š„ๅทฅๅ…ทdextra๏ผŒๅช้œ€่ฆๅฆ‚ไธ‹็š„ๅ‘ฝไปคๅฐฑ่ƒฝไปŽoatๆˆ–odexไธญๆๅ–ๅ‡บdexๆ–‡ไปถ๏ผš
$ dextra -dextract services.odex 
	N OAT file (079)
	OFF: 9b4
	Dex header @0x10c7899e8 (2721 classes) at 0x9e8: /system/framework/services.jar
 	Written to system@[email protected]@classes.dex
	Location Length: 30
	
ๆๅ–ๅ‡บๆฅ็š„dexๆ–‡ไปถ๏ผš
	system@[email protected]@classes.dex
  • ๅœจWindowsๅนณๅฐ

windowsๅนณๅฐๅทฅๅ…ท๏ผš[SmaliEx] (https://github.com/testwhat/SmaliEx)

PS: ๅฏนๆญค่ฝฌๆข่ฟ‡็จ‹ๅฏไปฅๅ†™ไธช่„šๆœฌoat2dex.shๆ”พๅœจframework็›ฎๅฝ•ไธ‹๏ผŒๆฅๅฎŒๆˆๆ‰น้‡่ฝฌๆขๅทฅไฝœ๏ผš

files=`find arm64 oat/arm64 -name "*.oat" -o -name "*.odex"`
if [ -d "tmp" ]; then
	echo ๆ–‡ไปถๅคนๅญ˜ๅœจ
	rm -rf tmp
fi
mkdir tmp
echo $PWD
prefix=$PWD
cd tmp
echo "==========ไปŽoatๆˆ–odexไธญๆๅ–dex================="
for file in $files
do
	dextra -dextract "$prefix/$file"
done
echo "===========dex่ฝฌjava=============="
files=`find . -name "*.dex"`
for file in $files
do
    jadx -d out --show-bad-code $file
done

dex ๅ็ผ–่ฏ‘ๅฐฑๆœ‰ๅพˆๅคšๅทฅๅ…ทๆฅๅฎž็Žฐไบ†๏ผŒ่ฟ™้‡ŒๆŽจ่ jadx.

ps: 8.0ไน‹ๅŽdexไฟๅญ˜ๅœจvdexไธญ้œ€่ฆ็”จๆ–ฐ็š„ๅทฅๅ…ทไปŽvdexไธญๆๅ–dex๏ผŒๅทฅๅ…ท้“พๆŽฅvdexExtractor

  • ๅกๅˆทๅŒ…ๆๅ–frameworkๆ–นๆณ•
    • system.new.dat.br
    • system.new.dat
    • system.img
  1. .brๆ–‡ไปถๆ˜ฏgoogle็š„ๅŽ‹็ผฉ็ฎ—ๆณ•brotliๅŽ‹็ผฉไน‹ๅŽ็š„ไบง็‰ฉ๏ผŒ้œ€่ฆๅ…ˆ่งฃๅŽ‹็ผฉๅพ—ๅˆฐๅŽŸๅง‹ๆ–‡ไปถใ€‚ linuxไธ‹ๅฎ‰่ฃ…brotli๏ผš apt install brotli

  2. ่งฃๅŽ‹็ผฉ.brๆ–‡ไปถ brotli --decompress --input system.new.dat.br --output system.new.dat

  3. ๆๅ–system.img, ็”จๅˆฐๅผ€ๆบ้กน็›ฎsdat2img python sdat2img.py system.transfer.list system.new.dat system.img

  4. ๆŒ‚่ฝฝsystem.img mountใ€€system.img tmp

tmp็›ฎๅฝ•ไธ‹ๅณไธบ็ณป็ปŸๆ–‡ไปถใ€‚

Android 10

Android 10ไธŠ้ข,vdexไธๅŒ…ๅซdexๆ–‡ไปถไบ†๏ผŒdexๆ–‡ไปถๅญ˜ๆ”พๅœจๅŽŸapkไธญๆˆ–่€…jarๅŒ…ไธญใ€‚

Android 11

Android 11 ๆ–ฐๅขžapexๆ ผๅผๆ–‡ไปถ๏ผŒ้ƒจๅˆ†ไปฃ็ ๅญ˜ๅ‚จๅœจ/system/apex็›ฎๅฝ•ไธ‹้ข๏ผš

system/apex/
โ”œโ”€โ”€ com.android.apex.cts.shim.apex
โ”œโ”€โ”€ com.android.art.release.apex
โ”œโ”€โ”€ com.android.i18n.apex
โ”œโ”€โ”€ com.android.permission.apex
โ”œโ”€โ”€ com.android.runtime.apex
โ”œโ”€โ”€ com.android.vndk.current.apex
โ”œโ”€โ”€ com.android.wifi.apex
โ”œโ”€โ”€ com.google.android.adbd.apex
โ”œโ”€โ”€ com.google.android.cellbroadcast.apex
โ”œโ”€โ”€ com.google.android.conscrypt.apex
โ”œโ”€โ”€ com.google.android.extservices.apex
โ”œโ”€โ”€ com.google.android.ipsec.apex
โ”œโ”€โ”€ com.google.android.media.apex
โ”œโ”€โ”€ com.google.android.mediaprovider.apex
โ”œโ”€โ”€ com.google.android.media.swcodec.apex
โ”œโ”€โ”€ com.google.android.neuralnetworks.apex
โ”œโ”€โ”€ com.google.android.os.statsd.apex
โ”œโ”€โ”€ com.google.android.permission.apex
โ”œโ”€โ”€ com.google.android.resolv.apex
โ”œโ”€โ”€ com.google.android.sdkext.apex
โ”œโ”€โ”€ com.google.android.tethering.apex
โ””โ”€โ”€ com.google.android.tzdata2.apex

ไปฅcom.android.wifi.apexไธบไพ‹๏ผš

  1. ๆŸฅ็œ‹ๆ–‡ไปถๆ ผๅผ๏ผš
file com.android.wifi.apex 

output:

com.android.wifi.apex: Java archive data (JAR)
  1. ่งฃๅŽ‹ๆ–‡ไปถ:
unzip com.android.wifi.apex -d com.android.wifi.apex_out

ๆŸฅ็œ‹่งฃๅŽ‹ๅŽ็š„ๆ–‡ไปถ:

com.android.wifi.apex_out/
โ”œโ”€โ”€ AndroidManifest.xml
โ”œโ”€โ”€ apex_build_info.pb
โ”œโ”€โ”€ apex_manifest.pb
โ”œโ”€โ”€ apex_payload.img
โ”œโ”€โ”€ apex_pubkey
โ”œโ”€โ”€ assets
โ”œโ”€โ”€ META-INF
โ””โ”€โ”€ resources.arsc

  1. ๆŒ‚่ฝฝapex_payload.imgๆ–‡ไปถ:
sudo mount -o loop,ro apex_payload.img tmp/
  1. ๆŸฅ็œ‹tmp็›ฎๅฝ•ไธ‹ๅ†…ๅฎน:
tmp
โ”œโ”€โ”€ apex_manifest.pb
โ”œโ”€โ”€ app
โ”‚ย ย  โ””โ”€โ”€ OsuLogin
โ”‚ย ย      โ””โ”€โ”€ OsuLogin.apk
โ”œโ”€โ”€ etc
โ”‚ย ย  โ””โ”€โ”€ security
โ”‚ย ย      โ””โ”€โ”€ cacerts_wfa
โ”‚ย ย          โ”œโ”€โ”€ 21125ccd.0
โ”‚ย ย          โ”œโ”€โ”€ 674b5f5b.0
โ”‚ย ย          โ””โ”€โ”€ ea93cb5b.0
โ”œโ”€โ”€ javalib
โ”‚ย ย  โ”œโ”€โ”€ framework-wifi.jar
โ”‚ย ย  โ””โ”€โ”€ service-wifi.jar
โ”œโ”€โ”€ lost+found [error opening dir]
โ””โ”€โ”€ priv-app
    โ””โ”€โ”€ ServiceWifiResources
        โ””โ”€โ”€ ServiceWifiResources.apk

javalib็›ฎๅฝ•ไธ‹็š„jarๅณไธบwifiใ€€service็›ธๅ…ณ็š„ๆบ็ ใ€‚ ps: Android 10ไธŠ็š„/system/apex็›ฎๅฝ•ไธ‹ๅญ˜ๆ”พ็š„ๆ˜ฏๅฏนๅบ”็š„ๆ–‡ไปถๅคน๏ผŒๅœจๆ–‡ไปถๅคนไธ‹ๅญ˜ๆ”พ็€็›ธๅ…ณ็š„jarๅŒ…๏ผŒ็œๅŽปไบ†่งฃๅŽ‹ๆŒ‚่ฝฝๆ–‡ไปถ็ณป็ปŸ็š„ๆญฅ้ชคใ€‚ WifiServiceImpl.javaๆ‰€ๅœจ็š„jar,้œ€่ฆๆŸฅ็œ‹bpๆ–‡ไปถใ€‚ https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/refs/tags/android-11.0.0_r42/service/Android.bpใ€‚