Skip to content

无埋点记录用户行为轨迹(aop-ui层 mmap-i/o层)

License

Notifications You must be signed in to change notification settings

hatjs880328s/NBPBehaviorTrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABSTRACT-NBPUser- behavior trace

1.nbp user behavior trace[use objc Aspects kit]

2.sqlite3.2 from master rebuild

3.mergeSort - swift

4.custom queue [use closure do it]

5.logic layer [ibll follow JAVA-SPRING]

1.0 nbp user behavior trace DISK-progress center

  • 1.use mmap save the memory event infos.
  • 2.read event info from file : if success then deleate the file , if deleate file success return the fileStrinfo else return nil. user should not invoking the deleate function manual.
  • 3.basic file/dir progress [file create | file deleate | file read | file write(use mmap)]

2.1 optimize the mmap

  • 1.add cache & no cache function change
  • 2.use mmap save info
  • 3.import sqliteFMDB but no use ( if mmap couldn't do well, change to sqlite very easy)

2.2 optimize the upload center

  • 1.scan documents/nopnoah_shan folder to search all files
  • 2.if one file exist directly return else analyze all except last file

--HOW TO USE :

    // start-HOOKFunctions-Service
    AOPNBPCoreManagerCenter.getInstance().startService()
    // start-upload-Service
    AOPEventUploadCenter.getInstance().startService()
    AOPEventUploadCenter.getInstance().progressAction = { strResult , handle in
    }

--CHANGE HOOK FUNCTIONS:

     // extends the superclass : GodfatherSwizzing plz.
     class ApplicitonSwizzing: GodfatherSwizzing {
     // application-sendAction
     let appSendActionBlock:@convention(block) (_ id: AspectInfo)-> Void = { aspectInfo in
         let event = AOPEventFilter.appFilter(aspectInfo: aspectInfo)
         GodfatherSwizzingPostnotification.postNotification(notiName: Notification.Name.InspurNotifications().appSendActions,
                                                       userInfo: [AOPEventType.applicationSendaction:event])
     }
     // navigation-pop(custom btn replace the sys navigationBar-backBtn)
     let navigationPopBlock:@convention(block) (_ id: AspectInfo)-> Void = { aspectInfo in
     }
     // application sendaction
     override func aopFunction() {
           do{
              try UIControl.aspect_hook(#selector(UIControl.sendAction(_:to:for:)),
                                 with: .init(rawValue: 0),
                                 usingBlock: appSendActionBlock)
              try UINavigationController.aspect_hook(#selector(UINavigationController.popViewController(animated:)), with:
            .init(rawValue: 0), usingBlock: appSendActionBlock)
     }catch {}
     }
     }

About

无埋点记录用户行为轨迹(aop-ui层 mmap-i/o层)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published